summaryrefslogtreecommitdiffhomepage
path: root/proto.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-05-13 15:51:06 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-05-13 15:51:06 +0200
commit68880012767f47598b77db01d4e4bf86d018670f (patch)
treebc9a1fcac7777409ca1deaa84cf779bae0376ddf /proto.c
parentf7ac9bf93cc07755d15a7ab65d17dc66b8fcea80 (diff)
drop broadcast/netmask parsing from proto_apply_ip_settings
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c20
1 files changed, 2 insertions, 18 deletions
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";