From 63582c800a4c27374ca8fccaaacc4ca6ccfe6f75 Mon Sep 17 00:00:00 2001 From: Bernd Eckenfels Date: Mon, 5 Jul 2010 22:52:00 +0000 Subject: Remove garbage ipv6 scopes in netstat output (Debian Bug #508110) Thanks Marco Steinacher for reporting. --- lib/inet6.c | 10 ++++++---- 1 file 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, * 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; /* ?;) */ } -- cgit v1.2.3-65-gdbad