Bug 98281 - netstat -ni output is merging columns
Summary: netstat -ni output is merging columns
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: net-tools
Version: 2.1
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: 87937
TreeView+ depends on / blocked
 
Reported: 2003-06-30 13:14 UTC by Need Real Name
Modified: 2015-03-05 01:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-08-19 12:27:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2003-06-30 13:14:47 UTC
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 [ecki.de]
Sent: 17 June 2003 17:45
To: Frank Currie
Cc: 'philb'; 'net-tools.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.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 13:26:26 UTC
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 09:32:48 UTC
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 12:27:45 UTC
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.