mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 02:17:58 +00:00 
			
		
		
		
	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
					Venkat Chimata
				
			
				
					committed by
					
						 John Crispin
						John Crispin
					
				
			
			
				
	
			
			
			 John Crispin
						John Crispin
					
				
			
						parent
						
							51a71c2224
						
					
				
				
					commit
					bbc78828fc
				
			| @@ -135,9 +135,11 @@ function hostapd_start(iface) { | |||||||
| 		log.syslog(LOG_USER, "Remove the config  ${iface}"); | 		log.syslog(LOG_USER, "Remove the config  ${iface}"); | ||||||
| 		ubus.call('hostapd', 'config_remove', { iface: 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 }); | 	ubus.call('hostapd', 'config_add', { iface: iface, config: path }); | ||||||
| 	system('ifconfig ' + iface + ' up'); | 	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 */ | /* 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]) | 	if (object_hostapd != 'hostapd' || !ifaces[object_ifaces]) | ||||||
| 		return; | 		return; | ||||||
| 	if (add) { | 	if (add) { | ||||||
| 		log.syslog(LOG_USER, "adding ${path}"); | 		log.syslog(LOG_USER, "adding " + path); | ||||||
| 		hapd_subscriber.subscribe(path); | 		hapd_subscriber.subscribe(path); | ||||||
| 		ifaces[object_ifaces].hostapd = true; | 		ifaces[object_ifaces].hostapd = true; | ||||||
| 		ifaces[object_ifaces].path = path; | 		ifaces[object_ifaces].path = path; | ||||||
| 	} else { | 	} else { | ||||||
|  | 		// Mark the port as unauthorized. but dont delete it | ||||||
|  | 		// ifaces  contains the configured (from uci config) ports | ||||||
| 		netifd_handle_iface(object_ifaces, false); | 		netifd_handle_iface(object_ifaces, false); | ||||||
| 		delete ifaces[object_ifaces]; |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user