diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-05-13 15:51:06 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-05-13 15:51:06 +0200 |
commit | 68880012767f47598b77db01d4e4bf86d018670f (patch) | |
tree | bc9a1fcac7777409ca1deaa84cf779bae0376ddf /proto.c | |
parent | f7ac9bf93cc07755d15a7ab65d17dc66b8fcea80 (diff) |
drop broadcast/netmask parsing from proto_apply_ip_settings
Diffstat (limited to 'proto.c')
-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"; |