X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto.c;h=44bd42d4223d8d352d5d9b48cbbc8f9788c6b64f;hp=a39518717c7e1d2c68abae536be36078d29f53f8;hb=68880012767f47598b77db01d4e4bf86d018670f;hpb=f7ac9bf93cc07755d15a7ab65d17dc66b8fcea80 diff --git a/proto.c b/proto.c index a395187..44bd42d 100644 --- 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; - 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)); - 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, - netmask, ext, bcast.s_addr); + 32, ext, bcast.s_addr); 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";