Remove NetBSD'isms (add FreeBSD'isms?), which makes gre(4) working again.
This commit is contained in:
+2
-3
@@ -351,8 +351,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
|||||||
gh = mtod(m, struct greip *);
|
gh = mtod(m, struct greip *);
|
||||||
if (sc->g_proto == IPPROTO_GRE) {
|
if (sc->g_proto == IPPROTO_GRE) {
|
||||||
/* we don't have any GRE flags for now */
|
/* we don't have any GRE flags for now */
|
||||||
|
memset((void *)gh, 0, sizeof(struct greip));
|
||||||
memset((void *)&gh->gi_g, 0, sizeof(struct gre_h));
|
|
||||||
gh->gi_ptype = htons(etype);
|
gh->gi_ptype = htons(etype);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,7 +363,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
|||||||
((struct ip*)gh)->ip_ttl = GRE_TTL;
|
((struct ip*)gh)->ip_ttl = GRE_TTL;
|
||||||
((struct ip*)gh)->ip_tos = ip->ip_tos;
|
((struct ip*)gh)->ip_tos = ip->ip_tos;
|
||||||
((struct ip*)gh)->ip_id = ip->ip_id;
|
((struct ip*)gh)->ip_id = ip->ip_id;
|
||||||
gh->gi_len = htons(m->m_pkthdr.len);
|
gh->gi_len = m->m_pkthdr.len;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_opackets++;
|
ifp->if_opackets++;
|
||||||
|
|||||||
@@ -204,8 +204,8 @@ gre_input2(struct mbuf *m ,int hlen, u_char proto)
|
|||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
}
|
}
|
||||||
|
/* Unlike NetBSD, in FreeBSD m_adj() adjusts m->m_pkthdr.len as well */
|
||||||
m_adj(m, hlen);
|
m_adj(m, hlen);
|
||||||
m->m_pkthdr.len -= hlen;
|
|
||||||
|
|
||||||
if (sc->sc_if.if_bpf) {
|
if (sc->sc_if.if_bpf) {
|
||||||
u_int32_t af = AF_INET;
|
u_int32_t af = AF_INET;
|
||||||
|
|||||||
Reference in New Issue
Block a user