netstat patch

Pawel Biernacki kaktus at dragonflybsd.pl
Fri Oct 15 16:20:10 PDT 2004


hi,

it's small patch that fix wrong display of inet6 ports, like

  0 udp4       0      0 127.0.0.1.500         *.*
  0 udp6       0      0 fe80:1::230:84ff.500   *.*

and 

  0 udp4       0      0 127.0.0.1.500         *.*
  0 udp6       0      0 fe80:1::230:84ff.500  *.*

after patch.

Index: inet6.c
===================================================================
RCS file: /home/dcvs/src/usr.bin/netstat/inet6.c,v
retrieving revision 1.4
diff -u -r1.4 inet6.c
--- inet6.c     30 Aug 2004 18:06:50 -0000      1.4
+++ inet6.c     16 Oct 2004 01:17:23 -0000
@@ -1057,7 +1057,7 @@
                sprintf(cp, "%.8s", sp ? sp->s_name : "*");
        else
                sprintf(cp, "%d", ntohs((u_short)port));
-       width = Wflag ? 45 : Aflag ? 18 : 22;
+       width = Wflag ? 45 : Aflag ? 17 : 21;
        printf("%-*.*s ", width, width, line);
 }

-- 






More information about the Submit mailing list