ieee8021x: Fix connectivity issues with a non-vlan based event Non-vlan based ieee8021x client was not able get IP Addess through the AP. The reason was that ieee8021x.uc subscriptions could n't subscribe hostapd events as the subscribe functions are called before creating the interfaces.

To handle this, invoke hapd_subscriber.subscribe after the interface is created.
Also dont delete the interface from ifaces as ifaces should always contain the
configured ports (from uci config) per ieee8021x.uc design.
Deleting interfaces from ifaces will lead to ieee8021x.uc crashes.

Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
This commit is contained in:
Venkat Chimata
2024-07-15 13:16:26 +05:30
committed by John Crispin
parent 51a71c2224
commit bbc78828fc

View File

@@ -135,9 +135,11 @@ function hostapd_start(iface) {
log.syslog(LOG_USER, "Remove the config ${iface}");
ubus.call('hostapd', 'config_remove', { iface: iface });
}
log.syslog(LOG_USER, "Add config (clear the old one) ${iface}");
log.syslog(LOG_USER, "Add config (clear the old one) " + iface);
ubus.call('hostapd', 'config_add', { iface: iface, config: path });
system('ifconfig ' + iface + ' up');
// Subscribe to corresponding hostapd if it is (re)added
hapd_subscriber.subscribe("hostapd." + iface);
}
/* build a list of all running and new interfaces */
@@ -188,13 +190,14 @@ function ubus_unsub_object(add, id, path) {
if (object_hostapd != 'hostapd' || !ifaces[object_ifaces])
return;
if (add) {
log.syslog(LOG_USER, "adding ${path}");
log.syslog(LOG_USER, "adding " + path);
hapd_subscriber.subscribe(path);
ifaces[object_ifaces].hostapd = true;
ifaces[object_ifaces].path = path;
} else {
// Mark the port as unauthorized. but dont delete it
// ifaces contains the configured (from uci config) ports
netifd_handle_iface(object_ifaces, false);
delete ifaces[object_ifaces];
}
}