Branch: Tag:

2013-11-14

2013-11-14 23:27:29 by Henrik Grubbström (Grubba) <grubba@grubba.org>

NetUtils: Survive global IPv4 compat networks.

NetUtils got confused by interfaces like

inet6 ::127.0.0.1 prefixlen 96 scopeid 0x90<compat,host>

and claimed that eg 224.0.0.1 was on the local network.

669:    i += "/" + bits;    }    } -  if( !has_prefix( i, "fe80::" ) ) +  int ip = string_to_ip(i); +  int bits = -1; +  sscanf(i, "%*s/%d", bits); +  if( !has_prefix( i, "fe80::" ) && +  ((ip > 0xffffffff) || (bits > 96)) ) { +  // Skip the link-local and global IPv4 compat networks.    ips += ({ i }); -  +  }    next__broadcast_addresses[iface] += ({ "ff02::1" });    }    if( (sscanf( q, "%*sBcast:%[^ ]", i ) == 2) ||