- Drop GIF_ACCEPT_REVETHIP flag by default.

- Add IFF_MONITOR support.
This commit is contained in:
Hiroki Sato 2013-07-12 12:18:07 +00:00
parent 1583bcb4ee
commit e9f947e27c

View File

@ -173,7 +173,7 @@ gif_clone_create(ifc, unit, params)
if_initname(GIF2IFP(sc), gifname, unit);
sc->encap_cookie4 = sc->encap_cookie6 = NULL;
sc->gif_options = GIF_ACCEPT_REVETHIP;
sc->gif_options = 0;
GIF2IFP(sc)->if_addrlen = 0;
GIF2IFP(sc)->if_mtu = GIF_MTU;
@ -437,6 +437,11 @@ gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
goto end;
}
#endif
if ((ifp->if_flags & IFF_MONITOR) != 0) {
error = ENETDOWN;
m_freem(m);
goto end;
}
/*
* gif may cause infinite recursion calls when misconfigured.
@ -551,6 +556,13 @@ gif_input(m, af, ifp)
bpf_mtap2(ifp->if_bpf, &af1, sizeof(af1), m);
}
if ((ifp->if_flags & IFF_MONITOR) != 0) {
ifp->if_ipackets++;
ifp->if_ibytes += m->m_pkthdr.len;
m_freem(m);
return;
}
if (ng_gif_input_p != NULL) {
(*ng_gif_input_p)(ifp, &m, af);
if (m == NULL)