- if (tb[OPT_IPADDR])
- n_v4 = parse_address_option(iface, tb[OPT_IPADDR], false, netmask, ext);
+ 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);