summaryrefslogtreecommitdiff
path: root/sysdep/bsd/sysio.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-02-08 14:34:48 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-02-08 14:34:48 +0100
commitc259669fa33ca13b5c6ae60eb8ffa0874ddc01b2 (patch)
tree09003c2fa4d614b1e4f1fb10d16fba21acb56b4d /sysdep/bsd/sysio.h
parent82f42ea09176afdb67ab119258d714e8c8e54d12 (diff)
parentda65a3d898fde0ce567782d86919a66e29916ed7 (diff)
Merge branch 'master' into int-new
Diffstat (limited to 'sysdep/bsd/sysio.h')
-rw-r--r--sysdep/bsd/sysio.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdep/bsd/sysio.h b/sysdep/bsd/sysio.h
index 0c5f8fbb..0e895e20 100644
--- a/sysdep/bsd/sysio.h
+++ b/sysdep/bsd/sysio.h
@@ -9,6 +9,7 @@
#include <net/if_dl.h>
#include <netinet/in_systm.h> // Workaround for some BSDs
#include <netinet/ip.h>
+#include <sys/param.h>
#ifdef __NetBSD__
@@ -179,8 +180,8 @@ sk_prepare_ip_header(sock *s, void *hdr, int dlen)
ip->ip_src = ipa_to_in4(s->saddr);
ip->ip_dst = ipa_to_in4(s->daddr);
-#ifdef __OpenBSD__
- /* OpenBSD expects ip_len in network order, other BSDs expect host order */
+#if (defined __OpenBSD__) || (defined __DragonFly__) || (defined __FreeBSD__ && (__FreeBSD_version >= 1100030))
+ /* Different BSDs have different expectations of ip_len endianity */
ip->ip_len = htons(ip->ip_len);
#endif
}