summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-udp.c
diff options
context:
space:
mode:
authorkn <kn@openbsd.org>2018-10-22 16:12:45 +0000
committerkn <kn@openbsd.org>2018-10-22 16:12:45 +0000
commite654d8cdd26d89ab3ef1c8068214ba920c998264 (patch)
tree4f9889dc410cf5d22d7fd2ffb728135b1347786b /usr.sbin/tcpdump/print-udp.c
parentipsec: use monotonic clock for SA creation/lookup timestamps; ok dlg@ (diff)
downloadwireguard-openbsd-e654d8cdd26d89ab3ef1c8068214ba920c998264.tar.xz
wireguard-openbsd-e654d8cdd26d89ab3ef1c8068214ba920c998264.zip
Remove #ifdef INET6
There's not reason to build without IPv6 support, `-U INET6' builds were broken anyway. Fix an empty redefine for IPPROTO_IPV6 in print-ip.c while here. No object change on amd64 and sparc64 with clang, gcc compiles differently but behaviour stays the same. OK denis deraadt
Diffstat (limited to 'usr.sbin/tcpdump/print-udp.c')
-rw-r--r--usr.sbin/tcpdump/print-udp.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/usr.sbin/tcpdump/print-udp.c b/usr.sbin/tcpdump/print-udp.c
index f1d8d47e4d9..f27ff8959a7 100644
--- a/usr.sbin/tcpdump/print-udp.c
+++ b/usr.sbin/tcpdump/print-udp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-udp.c,v 1.50 2018/07/10 00:38:52 dlg Exp $ */
+/* $OpenBSD: print-udp.c,v 1.51 2018/10/22 16:12:45 kn Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
@@ -26,6 +26,7 @@
#include <netinet/in.h>
#include <netinet/ip.h>
+#include <netinet/ip6.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
@@ -49,10 +50,6 @@
#include <stdio.h>
#include <string.h>
-#ifdef INET6
-#include <netinet/ip6.h>
-#endif
-
#include "interface.h"
#include "addrtoname.h"
#include "extract.h"
@@ -318,11 +315,9 @@ rtcp_print(const u_char *hdr, const u_char *ep)
#define MULTICASTDNS_PORT 5353
#define MPLS_PORT 6635
-#ifdef INET6
#define RIPNG_PORT 521 /*XXX*/
#define DHCP6_PORT1 546 /*XXX*/
#define DHCP6_PORT2 547 /*XXX*/
-#endif
void
udp_print(const u_char *bp, u_int length, const void *iph)
@@ -343,7 +338,6 @@ udp_print(const u_char *bp, u_int length, const void *iph)
ipv = ip->ip_v;
switch (ipv) {
-#ifdef INET6
case 6: {
const struct ip6_hdr *ip6 = iph;
@@ -356,7 +350,6 @@ udp_print(const u_char *bp, u_int length, const void *iph)
sizeof(ip6->ip6_dst), cksum);
break;
}
-#endif /*INET6*/
case 4:
ipsrc = ipaddr_string(&ip->ip_src);
ipdst = ipaddr_string(&ip->ip_dst);
@@ -570,13 +563,11 @@ udp_print(const u_char *bp, u_int length, const void *iph)
vxlan_print(cp, length);
else if (ISPORT(MPLS_PORT))
mpls_print(cp, length);
-#ifdef INET6
else if (ISPORT(RIPNG_PORT))
ripng_print(cp, length);
else if (ISPORT(DHCP6_PORT1) || ISPORT(DHCP6_PORT2)) {
dhcp6_print(cp, length, sport, dport);
}
-#endif /*INET6*/
else if (ISPORT(GTP_C_PORT) || ISPORT(GTP_U_PORT) ||
ISPORT(GTP_PRIME_PORT))
gtp_print(cp, length, sport, dport);