mirror of
https://github.com/outbackdingo/wlan-ap.git
synced 2026-01-28 18:20:54 +00:00
Report VIF as if_type = vif in Wifi_Inet_State. Do not put invalid if_type vif in /etc/config/network.
Signed-off-by: Rick Sommerville <rick.sommerville@netexperience.com>
This commit is contained in:
committed by
John Crispin
parent
c6461046a3
commit
cebe525681
@@ -83,7 +83,10 @@ static void wifi_inet_conf_load(struct uci_section *s)
|
||||
if (tb[NET_ATTR_TYPE])
|
||||
SCHEMA_SET_STR(conf.if_type, blobmsg_get_string(tb[NET_ATTR_TYPE]));
|
||||
else
|
||||
SCHEMA_SET_STR(conf.if_type, "eth");
|
||||
if (strstr(s->e.name,"wlan") != NULL)
|
||||
SCHEMA_SET_STR(conf.if_type, "vif");
|
||||
else
|
||||
SCHEMA_SET_STR(conf.if_type, "eth");
|
||||
|
||||
if (!tb[NET_ATTR_DISABLED] || !blobmsg_get_u8(tb[NET_ATTR_DISABLED])) {
|
||||
conf.enabled = true;
|
||||
@@ -182,7 +185,7 @@ static int wifi_inet_conf_add(struct schema_Wifi_Inet_Config *iconf)
|
||||
blobmsg_add_bool(&del, "disabled", 1);
|
||||
|
||||
if (!iconf->parent_ifname_exists && strcmp(iconf->if_type, "eth")
|
||||
&& strcmp(iconf->if_type, "gre")) {
|
||||
&& strcmp(iconf->if_type, "gre") && strcmp(iconf->if_type, "vif")) {
|
||||
blobmsg_add_string(&b, "type", iconf->if_type);
|
||||
blobmsg_add_bool(&b, "vlan_filtering", 1);
|
||||
} else if (!strcmp(iconf->if_type, "gre")) {
|
||||
|
||||
@@ -133,9 +133,12 @@ void wifi_inet_state_set(struct blob_attr *msg)
|
||||
if (info.vid)
|
||||
SCHEMA_SET_INT(state.vlan_id, info.vid);
|
||||
}
|
||||
} else
|
||||
SCHEMA_SET_STR(state.if_type, "eth");
|
||||
|
||||
} else {
|
||||
if (strstr(state.if_name, "wlan") != NULL)
|
||||
SCHEMA_SET_STR(state.if_type, "vif");
|
||||
else
|
||||
SCHEMA_SET_STR(state.if_type, "eth");
|
||||
}
|
||||
|
||||
if (tb[NET_ATTR_IPV4_ADDR] && blobmsg_data_len(tb[NET_ATTR_IPV4_ADDR])) {
|
||||
struct blob_attr *ipv4[__IPV4_ATTR_MAX] = { };
|
||||
|
||||
Reference in New Issue
Block a user