+ return 0;
+
+error:
+ interface_add_error(iface, "proto", error, NULL, 0);
+out:
+ return -1;
+}
+
+int
+proto_apply_ip_settings(struct interface *iface, struct blob_attr *attr, bool ext)
+{
+ struct blob_attr *tb[__OPT_MAX];
+ struct blob_attr *cur;
+ const char *error;
+ int n_v4 = 0, n_v6 = 0;
+
+ blobmsg_parse(proto_ip_attributes, __OPT_MAX, tb, blob_data(attr), blob_len(attr));
+
+ if ((cur = tb[OPT_IPADDR]))
+ n_v4 = parse_address_list(iface, cur, false, ext);
+
+ if ((cur = tb[OPT_IP6ADDR]))
+ n_v6 = parse_address_list(iface, cur, true, ext);
+
+ if (!n_v4 && !n_v6) {
+ error = "NO_ADDRESS";
+ goto error;
+ }
+
+ if (n_v4 < 0 || n_v6 < 0)
+ goto out;