(SIGAR-140) interface aliases are valid in sigar_net_interface_config_primary_get
This commit is contained in:
		
							parent
							
								
									880a24ad30
								
							
						
					
					
						commit
						6d6b5577b1
					
				
							
								
								
									
										10
									
								
								src/sigar.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/sigar.c
									
									
									
									
									
								
							@ -1810,19 +1810,23 @@ sigar_net_interface_config_primary_get(sigar_t *sigar,
 | 
			
		||||
 | 
			
		||||
        if ((status != SIGAR_OK) ||
 | 
			
		||||
            (ifconfig->flags & SIGAR_IFF_LOOPBACK) ||
 | 
			
		||||
            !ifconfig->hwaddr.addr.in ||   /* no mac address */
 | 
			
		||||
            strchr(iflist.data[i], ':'))  /* alias */
 | 
			
		||||
            !ifconfig->hwaddr.addr.in)   /* no mac address */
 | 
			
		||||
        {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!possible_config.flags) {
 | 
			
		||||
            /* save for later for use if we're not connected to the net */
 | 
			
		||||
            /* save for later for use if we're not connected to the net
 | 
			
		||||
             * or all interfaces are aliases (e.g. solaris zone)
 | 
			
		||||
             */
 | 
			
		||||
            memcpy(&possible_config, ifconfig, sizeof(*ifconfig));
 | 
			
		||||
        }
 | 
			
		||||
        if (!ifconfig->address.addr.in) {
 | 
			
		||||
            continue; /* no ip address */
 | 
			
		||||
        }
 | 
			
		||||
        if (strchr(iflist.data[i], ':')) {
 | 
			
		||||
            continue; /* alias */
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        found = 1;
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user