@@ -314,6 +314,7 @@ static int wifi_gen_bss_section(FILE *hostapd, struct lyd_node *cifs, const char
314314{
315315 const char * ssid , * hidden , * security_mode , * secret_name , * secret ;
316316 struct lyd_node * cif , * wifi , * ap , * security , * secret_node ;
317+ char bssid [18 ];
317318
318319 /* Find the interface node for this BSS */
319320 LYX_LIST_FOR_EACH (cifs , cif , "interface" ) {
@@ -333,6 +334,10 @@ static int wifi_gen_bss_section(FILE *hostapd, struct lyd_node *cifs, const char
333334 fprintf (hostapd , "\n# BSS %s\n" , ifname );
334335 fprintf (hostapd , "bss=%s\n" , ifname );
335336
337+ /* Set BSSID if custom MAC is configured */
338+ if (!interface_get_phys_addr (cif , bssid ))
339+ fprintf (hostapd , "bssid=%s\n" , bssid );
340+
336341 /* SSID configuration */
337342 ssid = lydx_get_cattr (ap , "ssid" );
338343 hidden = lydx_get_cattr (ap , "hidden" );
@@ -484,7 +489,13 @@ static int wifi_gen_aps_on_radio(const char *radio_name, struct lyd_node *cifs,
484489
485490 fprintf (hostapd , "interface=%s\n" , primary_ifname );
486491 fprintf (hostapd , "driver=nl80211\n" );
487- fprintf (hostapd , "ctrl_interface=/run/hostapd\n\n" );
492+ fprintf (hostapd , "ctrl_interface=/run/hostapd\n" );
493+
494+ /* Set BSSID if custom MAC is configured */
495+ char bssid [18 ];
496+ if (!interface_get_phys_addr (primary_cif , bssid ))
497+ fprintf (hostapd , "bssid=%s\n" , bssid );
498+ fprintf (hostapd , "\n" );
488499
489500 fprintf (hostapd , "ssid=%s\n" , ssid );
490501 if (hidden && !strcmp (hidden , "true" ))
0 commit comments