mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-30 18:07:52 +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; | 	char *lan = NULL; | ||||||
|  |  | ||||||
| 	wan = get_eth_map_info("wan"); | 	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); | 		SCHEMA_SET_STR(config->eth_ports, wan); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	lan = get_eth_map_info("lan"); | 	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); | 		SCHEMA_SET_STR(config->eth_ports, lan); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -284,14 +284,17 @@ static void update_eth_ports_states(struct schema_Wifi_Inet_State *state) | |||||||
| 	char brname[IFNAMSIZ] = {'\0'}; | 	char brname[IFNAMSIZ] = {'\0'}; | ||||||
|  |  | ||||||
| 	wan = get_eth_map_info("wan"); | 	wan = get_eth_map_info("wan"); | ||||||
| 	update_eth_state(wan, &wanport); | 	if (wan != NULL) | ||||||
|  | 		update_eth_state(wan, &wanport); | ||||||
|  |  | ||||||
| 	lan = get_eth_map_info("lan"); | 	lan = get_eth_map_info("lan"); | ||||||
| 	eth = strtok (lan," "); | 	if (lan != NULL) { | ||||||
| 	for (i = 0; i < MAX_ETH_PORTS && eth != NULL; i++) | 		eth = strtok (lan," "); | ||||||
| 	{ | 		for (i = 0; i < MAX_ETH_PORTS && eth != NULL; i++) | ||||||
| 		update_eth_state(eth, &lanport[i]); | 		{ | ||||||
| 		eth = strtok (NULL, " "); | 			update_eth_state(eth, &lanport[i]); | ||||||
|  | 			eth = strtok (NULL, " "); | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (!strncmp(state->if_name, "wan", 3)) | 	if (!strncmp(state->if_name, "wan", 3)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user