From e73053c457488a7267abd7aa87f25b3e9e5508a2 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 28 Oct 2015 03:21:15 +0000 Subject: [PATCH] Fix FreeBSD version check for raw socket byte order. Fixes #217. See #196, #50 --- libnetutil/netutil.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index 096149860..72d9eb2e2 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -3604,7 +3604,7 @@ int send_ip_packet_sd(int sd, const struct sockaddr_in *dst, must deal with it here rather than when building the packet, because they should be in NBO when I'm sending over raw ethernet */ -#if (defined(FREEBSD) && (__FreeBSD_version < 1000022)) || BSDI || NETBSD || DEC || MACOSX +#if (defined(FREEBSD) && (__FreeBSD_version < 1100030)) || BSDI || NETBSD || DEC || MACOSX ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); #endif @@ -3614,7 +3614,7 @@ int send_ip_packet_sd(int sd, const struct sockaddr_in *dst, (int) sizeof(struct sockaddr_in)); /* Undo the byte order switching. */ -#if (defined(FREEBSD) && (__FreeBSD_version < 1000022)) || BSDI || NETBSD || DEC || MACOSX +#if (defined(FREEBSD) && (__FreeBSD_version < 1100030)) || BSDI || NETBSD || DEC || MACOSX ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); #endif