mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 18:38:10 +00:00 
			
		
		
		
	udevstats: fix adding the same vlans to the config
Add filtering the same vlans before adding to the vlan config. The issue was detected during connection many WiFi client using dynamic vlans on the network. Fixes: WIFI-13538 Signed-off-by: Marek Kwaczynski <marek@shasta.cloud>
This commit is contained in:
		 Marek Kwaczynski
					Marek Kwaczynski
				
			
				
					committed by
					
						 John Crispin
						John Crispin
					
				
			
			
				
	
			
			
			 John Crispin
						John Crispin
					
				
			
						parent
						
							856ac16e86
						
					
				
				
					commit
					1ca8f18b9d
				
			| @@ -129,6 +129,21 @@ function vlan_add(dev, vid, ad) | |||||||
| 	vlans[keystr] = true; | 	vlans[keystr] = true; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function vlan_config_push(vlan_config, dev, vid) | ||||||
|  | { | ||||||
|  | 	let vlan_found = false; | ||||||
|  |  | ||||||
|  | 	for (let v in vlan_config[dev]) { | ||||||
|  | 		if (v[0] == vid) { | ||||||
|  | 			vlan_found = true; | ||||||
|  | 			break; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if (!vlan_found) | ||||||
|  | 		push(vlan_config[dev], [ vid, "rx", "tx"]); | ||||||
|  | } | ||||||
|  |  | ||||||
| function vlan_set_config(config) | function vlan_set_config(config) | ||||||
| { | { | ||||||
| 	vlan_config = config; | 	vlan_config = config; | ||||||
| @@ -221,7 +236,7 @@ function run_service() { | |||||||
| 					return ubus.STATUS_INVALID_ARGUMENT; | 					return ubus.STATUS_INVALID_ARGUMENT; | ||||||
| 				if (!vlan_config[req.args.device]) | 				if (!vlan_config[req.args.device]) | ||||||
| 					vlan_config[req.args.device] = []; | 					vlan_config[req.args.device] = []; | ||||||
| 				push(vlan_config[req.args.device], [ req.args.vlan, "rx", "tx"]); | 				vlan_config_push(vlan_config, req.args.device, req.args.vlan); | ||||||
| 				vlan_set_config(vlan_config); | 				vlan_set_config(vlan_config); | ||||||
| 				return 0;                            | 				return 0;                            | ||||||
| 			},                            | 			},                            | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user