From a2d723b237b262f226f6116925e1b784e9116524 Mon Sep 17 00:00:00 2001 From: Arulanbu Balusamy Date: Tue, 23 Jan 2024 15:21:41 +0530 Subject: [PATCH] hostapd: Update the hostapd module to handle the NULL value of wds_bridge. By default, the wds_bridge parameter in the hostapd config file is NULL character,So it updates the NULL character as bridge name. Because of this, it fails to add the wds interface into the bridge while running the hostapd manually. Earlier the bridge value assigns at the hostapd_set_wds_sta module, So it does not cause any issue while reading the value from hostapd config. Here the wds_bridge parameter is updated while asigning the bridge name at hostapd_config_fill module.Then again it re-assign the value of wds_bridge parameter. At this time wds_bridge parameter is filled with null character as in hostapd config file, then it is considered as a valid pointer and re-update the wds_bridge variable. This change checks the wds_bridge parameter and assign the wds bridge name as per in the hostapd config, when the character is not NULL. Otherwise, the wds_bridge remains in the default bridge interface name. Signed-off-by: Arulanbu Balusamy --- hostapd/config_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 7916ba5..96405bf 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2254,7 +2254,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, } else if (os_strcmp(buf, "vlan_bridge") == 0) { os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); } else if (os_strcmp(buf, "wds_bridge") == 0) { - os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); + if (*pos != '\0') + os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); } else if (os_strcmp(buf, "driver") == 0) { int j; const struct wpa_driver_ops *driver = NULL; -- 2.17.1