Denys Vlasenko schrieb:

> -               *skip_non_whitespace(line_ptr) = '\0';
> +               *strpbrk(line_ptr, " \t\n:") = '\0';
> 
> Why ':' is considered a terminator too? (I want to add a comment there).
> 
> Applied. Thanks.
> --
> vda

My /proc/net/dev looks like that (trimmed for readability):

Inter-|   Receive
  face |bytes    packets
     lo:1359900045 13129150
   eth0:3298170923 803340181
   eth1:3404454341 393982431


This only lists devices/interfaces, not aliases, so you will not have 
"eth0:0" or something like that in here. OTOH you'll see vlan-interfaces 
like eth0.1 as created via vconfig. Like this:
eth0.2:       0       0
eth2.1000:       0       0

 From the kernel-perspective these are standalone interfaces, while 
aliases are just another address on the same interface.

The kernel-code to output /proc/net/dev looks like that:

seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
          "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
          dev->name, stats->rx_bytes, stats->rx_packets,

Hmmm, so while thinking about it, it would be enough to just look for ':'.

Nico
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to