mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-25 16:13:17 +00:00
Remove NetBSD'isms (add FreeBSD'isms?), which makes gre(4) working again.
This commit is contained in:
parent
9148fa21dd
commit
4c83789253
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125226
@ -351,8 +351,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
gh = mtod(m, struct greip *);
|
||||
if (sc->g_proto == IPPROTO_GRE) {
|
||||
/* we don't have any GRE flags for now */
|
||||
|
||||
memset((void *)&gh->gi_g, 0, sizeof(struct gre_h));
|
||||
memset((void *)gh, 0, sizeof(struct greip));
|
||||
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_tos = ip->ip_tos;
|
||||
((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++;
|
||||
|
@ -204,8 +204,8 @@ gre_input2(struct mbuf *m ,int hlen, u_char proto)
|
||||
m_freem(m);
|
||||
return (EINVAL);
|
||||
}
|
||||
/* Unlike NetBSD, in FreeBSD m_adj() adjusts m->m_pkthdr.len as well */
|
||||
m_adj(m, hlen);
|
||||
m->m_pkthdr.len -= hlen;
|
||||
|
||||
if (sc->sc_if.if_bpf) {
|
||||
u_int32_t af = AF_INET;
|
||||
|
Loading…
Reference in New Issue
Block a user