pike.git / lib / modules / NetUtils.pmod

version» Context lines:

pike.git/lib/modules/NetUtils.pmod:662:    (sscanf( q, "inet6 %[^ ] %s", i, m )) )    {    if (!has_value(i, "/")) {    int bits = -1;    // ifconfig(1) from Linux net-tools reports    // the prefix length separately.    if (sscanf(m, "%*sprefixlen %d", bits) && (bits > 0)) {    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) ||    (sscanf( q, "%*sbroadcast %s", i ) == 2 ) )    {    next__broadcast_addresses[iface] += ({i});    }    }    if( sizeof( ips ) )    next__interfaces[iface] = ips;