diff options
author | hrs <hrs@FreeBSD.org> | 2013-07-12 12:18:07 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-07-12 12:18:07 +0000 |
commit | 59e83b64133e8a613e75e88b3c0857bb685708c4 (patch) | |
tree | 95cc6160e881a53d71be0f8ca1ef1ce8df02438e /sys/net | |
parent | 7804a995aae45b8567b56468471e25b9bfa385e6 (diff) | |
download | FreeBSD-src-59e83b64133e8a613e75e88b3c0857bb685708c4.zip FreeBSD-src-59e83b64133e8a613e75e88b3c0857bb685708c4.tar.gz |
- Drop GIF_ACCEPT_REVETHIP flag by default.
- Add IFF_MONITOR support.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_gif.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 2a6f890..874bbc00 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -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) |