mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 02:17:58 +00:00 
			
		
		
		
	wifi-4651: Fix NM crash in single ethernet port APs
Fix by adding LAN port check in case of single ethernet port APs where LAN port is not available. Signed-off-by: Chaitanya Godavarthi <chaitanya.kiran@netexperience.com>
This commit is contained in:
		 Chaitanya Godavarthi
					Chaitanya Godavarthi
				
			
				
					committed by
					
						 Arif
						Arif
					
				
			
			
				
	
			
			
			 Arif
						Arif
					
				
			
						parent
						
							98104a2e8d
						
					
				
				
					commit
					3bbfb52649
				
			| @@ -98,12 +98,12 @@ static void init_eth_ports_config(struct schema_Wifi_Inet_Config *config) | ||||
| 	char *lan = NULL; | ||||
|  | ||||
| 	wan = get_eth_map_info("wan"); | ||||
| 	if (!strncmp(config->if_name, "wan", 3)) { | ||||
| 	if (wan != NULL && !strncmp(config->if_name, "wan", 3)) { | ||||
| 		SCHEMA_SET_STR(config->eth_ports, wan); | ||||
| 	} | ||||
|  | ||||
| 	lan = get_eth_map_info("lan"); | ||||
| 	if (!strncmp(config->if_name, "lan", 3)) { | ||||
| 	if (lan != NULL && !strncmp(config->if_name, "lan", 3)) { | ||||
| 		SCHEMA_SET_STR(config->eth_ports, lan); | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -284,15 +284,18 @@ static void update_eth_ports_states(struct schema_Wifi_Inet_State *state) | ||||
| 	char brname[IFNAMSIZ] = {'\0'}; | ||||
|  | ||||
| 	wan = get_eth_map_info("wan"); | ||||
| 	if (wan != NULL) | ||||
| 		update_eth_state(wan, &wanport); | ||||
|  | ||||
| 	lan = get_eth_map_info("lan"); | ||||
| 	if (lan != NULL) { | ||||
| 		eth = strtok (lan," "); | ||||
| 		for (i = 0; i < MAX_ETH_PORTS && eth != NULL; i++) | ||||
| 		{ | ||||
| 			update_eth_state(eth, &lanport[i]); | ||||
| 			eth = strtok (NULL, " "); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (!strncmp(state->if_name, "wan", 3)) | ||||
| 		strncpy(brname, "br-wan", 6); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user