wireless: pass the real network ifname to the setup script
authorFelix Fietkau <nbd@nbd.name>
Fri, 4 Jun 2021 06:41:34 +0000 (08:41 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 4 Jun 2021 06:41:36 +0000 (08:41 +0200)
If the network ifname is a VLAN on top of a VLAN-filtering bridge, hostapd
needs to know the VLAN ifname to communicate with other APs, if 802.11r is enabled.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
scripts/netifd-wireless.sh
wireless.c

index b920296a9764ab61e513644c31694ab037668956..552779162251c7e67c04733f3238aa4dcc0a7e00 100644 (file)
@@ -314,6 +314,7 @@ for_each_interface() {
                json_select "$_w_iface"
                if [ -n "$_w_types" ]; then
                        json_get_var network_bridge bridge
+                       json_get_var network_ifname bridge-ifname
                        json_get_var multicast_to_unicast multicast_to_unicast
                        json_select config
                        _wireless_set_brsnoop_isolation "$multicast_to_unicast"
index c465a16590edb96fa16c17d92bfbe80fbeacd2e3..55605bcd598964312dc4fcbda8b5fad6c877522e 100644 (file)
@@ -117,7 +117,7 @@ static void
 vif_config_add_bridge(struct blob_buf *buf, struct blob_attr *networks, bool prepare)
 {
        struct interface *iface;
-       struct device *dev = NULL;
+       struct device *dev = NULL, *orig_dev;
        struct blob_attr *cur;
        const char *network;
        int rem;
@@ -143,6 +143,7 @@ vif_config_add_bridge(struct blob_buf *buf, struct blob_attr *networks, bool pre
        if (!dev)
                return;
 
+       orig_dev = dev;
        if (dev->hotplug_ops && dev->hotplug_ops->prepare)
                dev->hotplug_ops->prepare(dev, &dev);
 
@@ -150,6 +151,7 @@ vif_config_add_bridge(struct blob_buf *buf, struct blob_attr *networks, bool pre
                return;
 
        blobmsg_add_string(buf, "bridge", dev->ifname);
+       blobmsg_add_string(buf, "bridge-ifname", orig_dev->ifname);
 
        if (dev->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST)
                blobmsg_add_u8(buf, "multicast_to_unicast",