summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2014-04-17 15:36:53 +0000
committerclaudio <claudio@openbsd.org>2014-04-17 15:36:53 +0000
commit98edac3a3bf63a907ccbcc7d700374e7cdcb73c2 (patch)
tree331810d6c5901517be1b35172a7394e776320a9b
parentSync show.c to what we have in netstat.c (at least steal some good idioms (diff)
downloadwireguard-openbsd-98edac3a3bf63a907ccbcc7d700374e7cdcb73c2.tar.xz
wireguard-openbsd-98edac3a3bf63a907ccbcc7d700374e7cdcb73c2.zip
Sync show.c with the route version. Make the two files more similar but
still not identical. OK sthen@ mpi@ jca@
-rw-r--r--usr.bin/netstat/show.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c
index 963e140a7f0..e26074612c7 100644
--- a/usr.bin/netstat/show.c
+++ b/usr.bin/netstat/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.40 2013/11/21 17:32:13 mikeb Exp $ */
+/* $OpenBSD: show.c,v 1.41 2014/04/17 15:36:53 claudio Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -31,12 +31,10 @@
*/
#include <sys/param.h>
-#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
-#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/pfkeyv2.h>
@@ -98,6 +96,7 @@ static const struct bits bits[] = {
{ 0 }
};
+int WID_DST(int);
void p_rtentry(struct rt_msghdr *);
void p_pfkentry(struct sadb_msg *);
void pr_family(int);
@@ -213,7 +212,7 @@ p_rttables(int af, u_int tableid)
*/
#define WID_GW(af) ((af) == AF_INET6 ? (nflag ? 30 : 18) : 18)
-static int
+int
WID_DST(int af)
{
@@ -296,6 +295,7 @@ p_rtentry(struct rt_msghdr *rtm)
return;
get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
+
if (Fflag && rti_info[RTAX_GATEWAY]->sa_family != sa->sa_family) {
return;
}
@@ -400,9 +400,6 @@ pr_family(int af)
case AF_MPLS:
afname = "MPLS";
break;
- case AF_APPLETALK:
- afname = "AppleTalk";
- break;
default:
afname = NULL;
break;
@@ -761,7 +758,7 @@ netname6(struct sockaddr_in6 *sa6, struct sockaddr_in6 *mask)
if (mask) {
lim = mask->sin6_len - offsetof(struct sockaddr_in6, sin6_addr);
lim = lim < (int)sizeof(struct in6_addr) ?
- lim : sizeof(struct in6_addr);
+ lim : (int)sizeof(struct in6_addr);
for (p = (u_char *)&mask->sin6_addr, i = 0; i < lim; p++) {
if (final && *p) {
illegal++;
@@ -815,7 +812,7 @@ netname6(struct sockaddr_in6 *sa6, struct sockaddr_in6 *mask)
else
sin6.sin6_addr.s6_addr[i++] = 0x00;
}
- while (i < sizeof(struct in6_addr))
+ while (i < (int)sizeof(struct in6_addr))
sin6.sin6_addr.s6_addr[i++] = 0x00;
} else
masklen = 128;