summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_gre.c6
-rw-r--r--sys/net/if_stf.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 0a0857b..b72f064 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -356,7 +356,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
* RFC2004 specifies that fragmented diagrams shouldn't
* be encapsulated.
*/
- if (ip->ip_off & (IP_MF | IP_OFFMASK)) {
+ if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) {
_IF_DROP(&ifp->if_snd);
m_freem(m);
error = EINVAL; /* is there better errno? */
@@ -410,7 +410,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
}
ip = mtod(m, struct ip *);
memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz);
- ip->ip_len = ntohs(ip->ip_len) + msiz;
+ ip->ip_len = htons(ntohs(ip->ip_len) + msiz);
} else { /* AF_INET */
_IF_DROP(&ifp->if_snd);
m_freem(m);
@@ -493,7 +493,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
((struct ip*)gh)->ip_ttl = GRE_TTL;
((struct ip*)gh)->ip_tos = gre_ip_tos;
((struct ip*)gh)->ip_id = gre_ip_id;
- gh->gi_len = m->m_pkthdr.len;
+ gh->gi_len = htons(m->m_pkthdr.len);
}
ifp->if_opackets++;
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index 90dac40..edde456 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -524,7 +524,7 @@ stf_output(ifp, m, dst, ro)
bcopy(&in4, &ip->ip_dst, sizeof(ip->ip_dst));
ip->ip_p = IPPROTO_IPV6;
ip->ip_ttl = ip_stf_ttl;
- ip->ip_len = m->m_pkthdr.len; /*host order*/
+ ip->ip_len = htons(m->m_pkthdr.len);
if (ifp->if_flags & IFF_LINK1)
ip_ecn_ingress(ECN_ALLOWED, &ip->ip_tos, &tos);
else
OpenPOWER on IntegriCloud