summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2006-05-27 19:24:01 +0000
committerclaudio <claudio@openbsd.org>2006-05-27 19:24:01 +0000
commit8ead94fc979741496d6c786935bf35a05dd9f6bc (patch)
tree3de4f99c4ee6afc7a659797fcbafc6a47f1d9927
parentMoving netstat from kvm snooping to retrieving the routing tables via (diff)
downloadwireguard-openbsd-8ead94fc979741496d6c786935bf35a05dd9f6bc.tar.xz
wireguard-openbsd-8ead94fc979741496d6c786935bf35a05dd9f6bc.zip
Kill upHex and use %X instead. Crazy old code found by deraadt.
-rw-r--r--usr.bin/netstat/if.c25
-rw-r--r--usr.bin/netstat/netstat.h3
2 files changed, 4 insertions, 24 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index 10bc7c18516..d7210150588 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.47 2006/05/27 19:16:37 claudio Exp $ */
+/* $OpenBSD: if.c,v 1.48 2006/05/27 19:24:01 claudio Exp $ */
/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
#else
-static char *rcsid = "$OpenBSD: if.c,v 1.47 2006/05/27 19:16:37 claudio Exp $";
+static char *rcsid = "$OpenBSD: if.c,v 1.48 2006/05/27 19:24:01 claudio Exp $";
#endif
#endif /* not lint */
@@ -280,9 +280,8 @@ intpr(int interval, u_long ifnetaddr)
char netnum[8];
*(union ipx_net *)&net = sipx->sipx_addr.ipx_net;
- snprintf(netnum, sizeof netnum, "%xH",
+ snprintf(netnum, sizeof netnum, "%XH",
ntohl(net));
- upHex(netnum);
printf("ipx:%-8s", netnum);
printf("%-17s ",
ipx_phost((struct sockaddr *)sipx));
@@ -552,24 +551,6 @@ catchalarm(int signo)
signalled = YES;
}
-void
-upHex(char *p0)
-{
- char *p = p0;
-
- for (; *p; p++)
- switch (*p) {
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- *p += ('A' - 'a');
- break;
- }
-}
-
char *
ipx_phost(struct sockaddr *sa)
{
diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h
index 7a1c370737c..3fa66de9bd5 100644
--- a/usr.bin/netstat/netstat.h
+++ b/usr.bin/netstat/netstat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: netstat.h,v 1.36 2006/05/27 19:16:37 claudio Exp $ */
+/* $OpenBSD: netstat.h,v 1.37 2006/05/27 19:24:01 claudio Exp $ */
/* $NetBSD: netstat.h,v 1.6 1996/05/07 02:55:05 thorpej Exp $ */
/*
@@ -102,7 +102,6 @@ void pr_encaphdr(void);
void pr_family(int);
char *ns_phost(struct sockaddr *);
char *ipx_phost(struct sockaddr *);
-void upHex(char *);
#ifdef INET6
struct in6_addr;