[patch] sockstat display glitch with IPv6

Francis GUDIN fgudin at nerim.net
Thu Apr 13 12:51:56 PDT 2006


Hi,

The attached patch fixes this behaviour:

> sockstat -6
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN
ADDRESS
doudou   ssh        38236 4  tcp6   2001:7a8:6633:0:220:35ff:fe75:9fb7:26562001:660:3302:282a:204:75ff:fe9f:9e11:22
doudou   ssh        8358  3  tcp6   2001:7a8:6633:0:220:35ff:fe75:9fb7:15142001:7a8:6633:0:20d:9dff:fe82:bcf6:22

forcing a space between the two IP6 addresses.

Thanks in advance,

-- 
Francis GUDIN - GPG Key: 0x15E36AB2

Le DADVSI : le point de vue d'un simple citoyen:
 http://tinyurl.com/jpd4b et http://www.eucd.info/
diff -r 5e7796ecf9a8 usr.bin/sockstat/sockstat.c
--- a/usr.bin/sockstat/sockstat.c	Fri Mar 24 07:57:30 2006 +0000
+++ b/usr.bin/sockstat/sockstat.c	Thu Apr 13 21:41:02 2006 +0200
@@ -506,8 +506,9 @@ display(void)
 		case AF_INET:
 		case AF_INET6:
 			pos += printaddr(s->family, &s->laddr);
-			while (pos < 58)
+			while (pos < 57)
 				pos += xprintf(" ");
+			xprintf(" ");
 			pos += printaddr(s->family, &s->faddr);
 			break;
 		case AF_UNIX:
Attachment:
pgp00001.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00001.pgp
Type: application/octet-stream
Size: 189 bytes
Desc: "Description: PGP signature"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20060413/37bcdbc2/attachment-0018.obj>


More information about the Submit mailing list