The settings might be present in the config as leftovers when switching
a vif from AP to sta mode. In that case, they will not be applied by wpad,
so they also must not be used by netifd
Signed-off-by: Felix Fietkau <nbd@nbd.name>
if ((cur = tb[VIF_ATTR_NETWORK]))
vif->network = cur;
+ cur = tb[VIF_ATTR_MODE];
+ if (cur)
+ vif->ap_mode = !strcmp(blobmsg_get_string(cur), "ap");
+
+ if (!vif->ap_mode)
+ return;
+
cur = tb[VIF_ATTR_ISOLATE];
if (cur)
vif->isolate = blobmsg_get_bool(cur);
if (cur)
vif->proxyarp = blobmsg_get_bool(cur);
- cur = tb[VIF_ATTR_MODE];
- if (cur)
- vif->ap_mode = !strcmp(blobmsg_get_string(cur), "ap");
}
/* vlist update call for wireless interface list */