summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2011-10-21 11:11:18 +0000
committerglebius <glebius@FreeBSD.org>2011-10-21 11:11:18 +0000
commit0391c17cc27b992bf21d809d8ab8ceaf2ba95226 (patch)
tree3a06d630e9fff65ec20ed15f7854044df9bb1d21 /sys
parent6c6abb3ddc0d7b2572a91949e5eaf448f0a392af (diff)
downloadFreeBSD-src-0391c17cc27b992bf21d809d8ab8ceaf2ba95226.zip
FreeBSD-src-0391c17cc27b992bf21d809d8ab8ceaf2ba95226.tar.gz
In FreeBSD ip_output() expects ip_len and ip_off in host byte order
PR: kern/159029
Diffstat (limited to 'sys')
-rw-r--r--sys/contrib/pf/net/if_pfsync.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/contrib/pf/net/if_pfsync.c b/sys/contrib/pf/net/if_pfsync.c
index 1b7cc98..8ca7924 100644
--- a/sys/contrib/pf/net/if_pfsync.c
+++ b/sys/contrib/pf/net/if_pfsync.c
@@ -1959,7 +1959,11 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
ip->ip_hl = sizeof(sc->sc_template) >> 2;
ip->ip_tos = IPTOS_LOWDELAY;
/* len and id are set later */
+#ifdef __FreeBSD__
+ ip->ip_off = IP_DF;
+#else
ip->ip_off = htons(IP_DF);
+#endif
ip->ip_ttl = PFSYNC_DFLTTL;
ip->ip_p = IPPROTO_PFSYNC;
ip->ip_src.s_addr = INADDR_ANY;
@@ -2211,7 +2215,11 @@ pfsync_sendout(void)
bcopy(&sc->sc_template, ip, sizeof(*ip));
offset = sizeof(*ip);
+#ifdef __FreeBSD__
+ ip->ip_len = m->m_pkthdr.len;
+#else
ip->ip_len = htons(m->m_pkthdr.len);
+#endif
ip->ip_id = htons(ip_randomid());
/* build the pfsync header */
OpenPOWER on IntegriCloud