aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Eckenfels <net-tools@lina.inka.de>2010-07-05 22:52:00 +0000
committerBernd Eckenfels <net-tools@lina.inka.de>2010-07-05 22:52:00 +0000
commit63582c800a4c27374ca8fccaaacc4ca6ccfe6f75 (patch)
tree5cb15d1ecb83b0cd862c142e35b6a1f4b43ed5d7
parentnetstat: PIDs can be long, Bug #199702 of Ubuntu Launchpad, Bug #16913 of Ber... (diff)
downloadnet-tools-63582c800a4c27374ca8fccaaacc4ca6ccfe6f75.tar.gz
net-tools-63582c800a4c27374ca8fccaaacc4ca6ccfe6f75.tar.bz2
net-tools-63582c800a4c27374ca8fccaaacc4ca6ccfe6f75.zip
Remove garbage ipv6 scopes in netstat output (Debian Bug #508110)
Thanks Marco Steinacher for reporting.
-rw-r--r--lib/inet6.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/inet6.c b/lib/inet6.c
index 9a484a0..c8406fd 100644
--- a/lib/inet6.c
+++ b/lib/inet6.c
@@ -3,7 +3,7 @@
* support functions for the net-tools.
* (most of it copied from lib/inet.c 1.26).
*
- * Version: $Id: inet6.c,v 1.12 2002/12/10 01:03:09 ecki Exp $
+ * Version: $Id: inet6.c,v 1.13 2010-07-05 22:52:00 ecki Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* Copyright 1993 MicroWalt Corporation
@@ -157,12 +157,14 @@ static int INET6_getsock(char *bufp, struct sockaddr *sap)
sin6 = (struct sockaddr_in6 *) sap;
sin6->sin6_family = AF_INET6;
sin6->sin6_port = 0;
+ sin6->sin6_scope_id = 0;
+ sin6->sin6_flowinfo = 0;
if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
return (-1);
- p = fix_v4_address(bufp, &sin6->sin6_addr);
- if (p != bufp)
- memcpy(bufp, p, strlen(p)+1);
+ p = fix_v4_address(bufp, &sin6->sin6_addr);
+ if (p != bufp)
+ memcpy(bufp, p, strlen(p)+1);
return 16; /* ?;) */
}