Bug 98281 - netstat -ni output is merging columns
netstat -ni output is merging columns
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: net-tools (Show other bugs)
2.1
All Linux
high Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Ben Levenson
:
Depends On:
Blocks: 87937
  Show dependency treegraph
 
Reported: 2003-06-30 09:14 EDT by Need Real Name
Modified: 2015-03-04 20:12 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-19 08:27:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2003-06-30 09:14:47 EDT
Description of problem:
I have found that the output of "netstat -ni" results in the merging of 
columns. The columns in questions are the Met and RX-OK as well as RX-OVR and 
TX-OK which is needed by the monitor script.

Present netstat from the net-tools-1.60.tar.bz2 release:
---
# /bin/netstat -ni
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   079203284      0      0      0 9782304      0      0      0 BMRU
lo    16436   026090095      0      0      026090095      0      0      0 LRU
---

I have found that adjusting the following lines in
net-tools-1.60/lib/interface.c fixes the issue.
---
# diff lib/interface.c lib/interface.c.old
583c583
<     printf("%5d %3d ", ptr->mtu, ptr->metric);
---
>     printf("%5d %3d", ptr->mtu, ptr->metric);
586c586
<       printf("%8llu %6lu %6lu %6lu ",
---
>       printf("%8llu %6lu %6lu %6lu",
----

Which results in :
---
# /bin/netstat -ni
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 79240273      0      0      0 9785204      0      0      0 BMRU
lo    16436   0 26114268      0      0      0 26114268      0      0      0 LRU
---


the linux netstat developers state:

-----Original Message-----
From: Bernd Eckenfels [mailto:ecki@lina.inka.de]
Sent: 17 June 2003 17:45
To: Frank Currie
Cc: 'philb@gnu.org'; 'net-tools@lina.inka.de'
Subject: Re: "netstat -ni" from net-tools-1.60.tar.bz2


On Tue, Jun 17, 2003 at 04:41:40PM +0100, Frank Currie wrote:
> list if needed but I have found that the output of "netstat -i" results in
> the merging of columns. The columns in questions are the Met and RX-OK as
> well as RX-OVR and TX-OK.

this should be fixed in debian package 1.60-7, which will also eventuelly
become the next upstream version.

Greetings
Bernd
-- 
  (OO)      -- Bernd_Eckenfels@Wendelinusstrasse39.76646Bruchsal.de --
 ( .. )  ecki@{inka.de,linux.de,debian.org} http://home.pages.de/~eckes/
  o--o     *plush*  2048/93600EFD  eckes@irc  +497257930613  BE5-RIPE
(O____O)  When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!



Version-Release number of selected component (if applicable):
[root@sptlinvm1 bin]# netstat -V
net-tools 1.60
netstat 1.42 (2001-04-15)
Fred Baumgarten, Alan Cox, Bernd Eckenfels, Phil Blundell, Tuan Hoang and others
+NEW_ADDRT +RTF_IRTT +RTF_REJECT +FW_MASQUERADE +I18N
AF: (inet) +UNIX +INET +INET6 +IPX +AX25 +NETROM +X25 +ATALK +ECONET +ROSE 
HW:  +ETHER +ARC +SLIP +PPP +TUNNEL +TR +AX25 +NETROM +X25 +FR +ROSE +ASH +SIT 
+FDDI +HIPPI +HDLC/LAPB 


How reproducible:
Every time once the cloumns exceed 8 characters.

Steps to Reproduce:
1.
2.
3.
    
Actual results:
# /bin/netstat -ni
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   079203284      0      0      0 9782304      0      0      0 BMRU
lo    16436   026090095      0      0      026090095      0      0      0 LRU


Expected results:
# /bin/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 79240273      0      0      0 9785204      0      0      0 BMRU
lo    16436   0 26114268      0      0      0 26114268      0      0      0 LRU

Additional info:
Comment 1 Need Real Name 2003-06-30 09:26:26 EDT
Please ignore the statement "which is needed by the monitor script" as it 
shouldn't have been included in the post.
Comment 3 Phil Knirsch 2003-08-08 05:32:48 EDT
Yep, i'll be including this fix in the next build. Has some duplicates as well
(iirc).

Read ya, Phil
Comment 4 Phil Knirsch 2003-08-19 08:27:45 EDT
Fixed in latest net-tools, will be built for AS2.1, too.

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.