drop broadcast/netmask parsing from proto_apply_ip_settings
[project/netifd.git] / proto.c
diff --git a/proto.c b/proto.c
index a395187..44bd42d 100644 (file)
--- a/proto.c
+++ b/proto.c
@@ -275,34 +275,18 @@ proto_apply_ip_settings(struct interface *iface, struct blob_attr *attr, bool ex
        struct blob_attr *tb[__OPT_MAX];
        struct blob_attr *cur;
        const char *error;
        struct blob_attr *tb[__OPT_MAX];
        struct blob_attr *cur;
        const char *error;
-       unsigned int netmask = 32;
        int n_v4 = 0, n_v6 = 0;
        struct in_addr bcast = {};
 
        blobmsg_parse(proto_ip_attributes, __OPT_MAX, tb, blob_data(attr), blob_len(attr));
 
        int n_v4 = 0, n_v6 = 0;
        struct in_addr bcast = {};
 
        blobmsg_parse(proto_ip_attributes, __OPT_MAX, tb, blob_data(attr), blob_len(attr));
 
-       if ((cur = tb[OPT_NETMASK])) {
-               netmask = parse_netmask_string(blobmsg_data(cur), false);
-               if (netmask > 32) {
-                       error = "INVALID_NETMASK";
-                       goto error;
-               }
-       }
-
-       if ((cur = tb[OPT_BROADCAST])) {
-               if (!inet_pton(AF_INET, blobmsg_data(cur), &bcast)) {
-                       error = "INVALID_BROADCAST";
-                       goto error;
-               }
-       }
-
        if ((cur = tb[OPT_IPADDR]))
                n_v4 = parse_address_option(iface, cur, false,
        if ((cur = tb[OPT_IPADDR]))
                n_v4 = parse_address_option(iface, cur, false,
-                       netmask, ext, bcast.s_addr);
+                       32, ext, bcast.s_addr);
 
        if ((cur = tb[OPT_IP6ADDR]))
                n_v6 = parse_address_option(iface, cur, true,
 
        if ((cur = tb[OPT_IP6ADDR]))
                n_v6 = parse_address_option(iface, cur, true,
-                       netmask, ext, 0);
+                       128, ext, 0);
 
        if (!n_v4 && !n_v6) {
                error = "NO_ADDRESS";
 
        if (!n_v4 && !n_v6) {
                error = "NO_ADDRESS";