diff options
-rw-r--r-- | proto.c | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -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"; |