Package: freebsd-utils / 10.1~svn273304-1

netstat_numeric_default.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Do not hardcode "default". Instead, let netname() handle this. This makes
"netstat -n" a print numeric address as requested.

Note: it relies on /etc/networks defining "default", which FreeBSD's
currently doesn't.

Index: freebsd-utils-jessie/src/usr.bin/netstat/route.c
===================================================================
--- freebsd-utils-jessie.orig/src/usr.bin/netstat/route.c
+++ freebsd-utils-jessie/src/usr.bin/netstat/route.c
@@ -707,12 +707,7 @@ fmt_sockaddr(struct sockaddr *sa, struct
 	    {
 		struct sockaddr_in *sockin = (struct sockaddr_in *)sa;
 
-		if ((sockin->sin_addr.s_addr == INADDR_ANY) &&
-			mask &&
-			ntohl(((struct sockaddr_in *)mask)->sin_addr.s_addr)
-				==0L)
-				cp = "default" ;
-		else if (flags & RTF_HOST)
+		if (flags & RTF_HOST)
 			cp = routename(sockin->sin_addr.s_addr);
 		else if (mask)
 			cp = netname(sockin->sin_addr.s_addr,