Addendum to my previous message.

Looking down the source code, Bernd discovered similar bug when print
in standard output the tx_packets statistics. The blank is not
guaranteed from the RX and TX data.

The -11.diff, as Bernd says, will cointain that fix (will be available
to download soon, Bernd published today).

But I'll explain my thought. What happen when the data cointained on
ptr->stats.rx_packets exceed the number of "99999999" (8 char). The
struct ptr->stats.rx_packets is "long long" but when this data printed
on standard out the stringh is righted. Maybe more char to justified?
10 char?

Some examples (the second is "netstat" fixed"):

---
[EMAIL PROTECTED] /bin/netstat.1.42 -i
Kernel Interface table
Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0   1500   0 58410193      0      0      0 46607882      0      0      0 BMRU
lo    16436   0 185555418      0      0      0 185555418      0      0
     0 LRU
[EMAIL PROTECTED] netstat -i
Kernel Interface table
Iface   MTU Met           RX-OK RX-ERR RX-DRP RX-OVR           TX-OK
TX-ERR TX-DRP TX-OVR Flg
eth0   1500   0        58410448      0      0      0        46608105  
   0      0      0 BMRU
lo    16436   0       185555418      0      0      0       185555418  
   0      0      0 LRU
---

Cesare

On 5/14/05, Bernd Eckenfels <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> my net-tools 1.60-10 does not have this problem. The metric column is left
> justfied and there is a guranteed blank in between:
> 
>   printf("%-5.5s ", ptr->name);
>     printf("%5d %-2d ", ptr->mtu, ptr->metric);
>     /* If needed, display the interface statistics. */
>     if (ptr->statistics_valid) {
>         printf("%8llu %6lu %6lu %6lu",
>                ptr->stats.rx_packets, ptr->stats.rx_errors,
>                ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors);
>         printf("%8llu %6lu %6lu %6lu ",
>                ptr->stats.tx_packets, ptr->stats.tx_errors,
>                ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors);
>     } else {
>         printf("%-56s", _("     - no statistics available -"));
>     }
> 
> do you have another source?
> 
> Please let me know if i can close this bug.
> 
> Greetings
> Bernd

Reply via email to