summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--device.h1
-rw-r--r--system-linux.c2
-rw-r--r--wireless.c9
-rw-r--r--wireless.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/device.h b/device.h
index b2c0ba9..37814c8 100644
--- a/device.h
+++ b/device.h
@@ -182,6 +182,7 @@ struct device {
bool iface_config;
bool default_config;
bool wireless;
+ bool wireless_ap;
bool wireless_isolate;
struct interface *config_iface;
diff --git a/system-linux.c b/system-linux.c
index 01500a5..f51c078 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -576,7 +576,7 @@ static char *system_get_bridge(const char *name, char *buf, int buflen)
static void
system_bridge_set_wireless(struct device *bridge, struct device *dev)
{
- bool mcast_to_ucast = true;
+ bool mcast_to_ucast = dev->wireless_ap;
bool hairpin = true;
if (bridge->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST &&
diff --git a/wireless.c b/wireless.c
index d0d2942..dcadfad 100644
--- a/wireless.c
+++ b/wireless.c
@@ -36,6 +36,7 @@ enum {
VIF_ATTR_DISABLED,
VIF_ATTR_NETWORK,
VIF_ATTR_ISOLATE,
+ VIF_ATTR_MODE,
__VIF_ATTR_MAX,
};
@@ -43,6 +44,7 @@ static const struct blobmsg_policy vif_policy[__VIF_ATTR_MAX] = {
[VIF_ATTR_DISABLED] = { .name = "disabled", .type = BLOBMSG_TYPE_BOOL },
[VIF_ATTR_NETWORK] = { .name = "network", .type = BLOBMSG_TYPE_ARRAY },
[VIF_ATTR_ISOLATE] = { .name = "isolate", .type = BLOBMSG_TYPE_BOOL },
+ [VIF_ATTR_MODE] = { .name = "mode", .type = BLOBMSG_TYPE_STRING },
};
static const struct uci_blob_param_list vif_param = {
@@ -213,6 +215,7 @@ static void wireless_interface_handle_link(struct wireless_interface *vif, bool
if (dev) {
dev->wireless_isolate = vif->isolate;
dev->wireless = true;
+ dev->wireless_ap = vif->ap_mode;
}
}
@@ -582,6 +585,8 @@ vif_update(struct vlist_tree *tree, struct vlist_node *node_new,
D(WIRELESS, "Update wireless interface %s on device %s\n", vif_new->name, wdev->name);
free(vif_old->config);
vif_old->config = blob_memdup(vif_new->config);
+ vif_old->isolate = vif_new->isolate;
+ vif_old->ap_mode = vif_new->ap_mode;
wireless_interface_init_config(vif_old);
free(vif_new);
} else if (vif_new) {
@@ -714,6 +719,10 @@ void wireless_interface_create(struct wireless_device *wdev, struct blob_attr *d
if (cur && blobmsg_get_bool(cur))
vif->isolate = blobmsg_get_bool(cur);
+ cur = tb[VIF_ATTR_MODE];
+ if (cur && !strcmp(blobmsg_get_string(cur), "ap"))
+ vif->ap_mode = true;
+
vlist_add(&wdev->interfaces, &vif->node, vif->name);
}
diff --git a/wireless.h b/wireless.h
index 476c63e..cb725b2 100644
--- a/wireless.h
+++ b/wireless.h
@@ -78,6 +78,7 @@ struct wireless_interface {
const char *ifname;
struct blob_attr *network;
bool isolate;
+ bool ap_mode;
};
struct wireless_process {