Fix EtherIP. TOS field must be initialized when the inner protocol is

PF_LINK, and multicast/broadcast flag should always be dropped because
the outer protocol uses unicast even when the inner address is not for
unicast.  It had been broken since r236951 when gif_output() started to
use IFQ_HANDOFF().
This commit is contained in:
Hiroki Sato 2014-07-24 10:42:47 +00:00
parent 4bace8e721
commit 9be09a6e43
2 changed files with 4 additions and 0 deletions

View File

@ -170,6 +170,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m)
return ENOBUFS;
bcopy(&eiphdr, mtod(m, struct etherip_header *),
sizeof(struct etherip_header));
tos = 0;
break;
default:
@ -257,6 +258,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m)
#endif
}
m->m_flags &= ~(M_BCAST|M_MCAST);
error = ip_output(m, NULL, &sc->gif_ro, 0, NULL, NULL);
if (!(GIF2IFP(sc)->if_flags & IFF_LINK0) &&

View File

@ -176,6 +176,7 @@ in6_gif_output(struct ifnet *ifp,
return ENOBUFS;
bcopy(&eiphdr, mtod(m, struct etherip_header *),
sizeof(struct etherip_header));
itos = 0;
break;
default:
@ -266,6 +267,7 @@ in6_gif_output(struct ifnet *ifp,
#endif
}
m->m_flags &= ~(M_BCAST|M_MCAST);
#ifdef IPV6_MINMTU
/*
* force fragmentation to minimum MTU, to avoid path MTU discovery.