On Tue, Apr 24, 2018 at 01:45:20AM +0200, Daniel Golle wrote: > Allow mesh_fwding to be specified in a mesh bss config, pass that > to the driver (only nl80211 implemented for now) and announce > forwarding capability accordingly. Why is this adding two mesh_fwding parameters: one in the global context and one within a network profile? > diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c > @@ -2211,6 +2211,7 @@ static const struct parse_data ssid_fields[] = { > + { INT_RANGE(mesh_fwding, 0, 1) }, > @@ -2761,6 +2762,7 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid) > + ssid->mesh_fwding = DEFAULT_MESH_FWDING; This is the per-network profile one. > @@ -3976,6 +3978,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface, > + config->mesh_fwding = DEFAULT_MESH_FWDING; > @@ -4598,6 +4601,7 @@ static const struct global_parse_data global_fields[] = { > + { INT_RANGE(mesh_fwding, 0, 1), 0 }, And this is the global one. > diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h > @@ -1305,6 +1306,14 @@ struct wpa_config { > + /** > + * mesh_fwding - Mesh network layer-2 forwarding > + * > + * This controls whether to enable layer-2 forwarding. > + * By default: 1: enabled > + */ > + int mesh_fwding; > diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h > @@ -492,6 +492,11 @@ struct wpa_ssid { > + /** > + * Mesh network layer-2 forwarding > + */ > + int mesh_fwding; Both have same names and practically same documentation. > diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c > @@ -120,6 +120,7 @@ static struct mesh_conf * mesh_config_create(struct wpa_supplicant *wpa_s, > + conf->mesh_fwding = ssid->mesh_fwding; Per-network profile one is used in struct mesh_conf. > @@ -254,6 +255,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, > + bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding; And the global one in hostapd data structure configuration. > @@ -506,6 +508,10 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, > + /* always explicitely set forwarding to on or off for now */ > + params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_FORWARDING; > + params->conf.forwarding = ssid->mesh_fwding; And the driver configuration depends on the per-network profile one. > diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c > @@ -288,9 +288,9 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s, > - /* always forwarding & accepting plinks for now */ > + /* set forwarding & always accepting plinks for now */ > wpabuf_put_u8(buf, MESH_CAP_ACCEPT_ADDITIONAL_PEER | > - MESH_CAP_FORWARDING); > + (conf->mesh_fwding ? MESH_CAP_FORWARDING : 0)); While this one uses the hostapd configuration one (from global wpa_supplicant parameter above). > diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf > @@ -153,6 +153,9 @@ ap_scan=1 > +# Enable 802.11s layer-2 routing and forwarding > +#mesh_fwding=1 And only one of the parameters is documented in wpa_supplicant.conf (the global one). This looks quite confusing. What would happen if those parameters are set to conflicting values? -- Jouni Malinen PGP id EFC895FA _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap