diff options
author | mav <mav@FreeBSD.org> | 2009-07-01 08:08:56 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-07-01 08:08:56 +0000 |
commit | 7efd755635cf3b7566887648a492de87f729bddc (patch) | |
tree | eb5239464eb31db2d042ce786efa65f004f7ff9e /sys/netgraph | |
parent | 609bc8c9f9535ade55a81a03f302a2405a269f30 (diff) | |
download | FreeBSD-src-7efd755635cf3b7566887648a492de87f729bddc.zip FreeBSD-src-7efd755635cf3b7566887648a492de87f729bddc.tar.gz |
Fix infinite loop in ng_iface, that happens when packet passes out via
two different ng interfaces sequentially due to tunnelling.
PR: kern/134557
Submitted by: Mikolaj Golub
Approved by: re (kensmith)
MFC after: 3 days
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_iface.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 18c37c2..cd65ad3 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -382,7 +382,8 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, } /* Protect from deadly infinite recursion. */ - while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) { + mtag = NULL; + while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, mtag))) { if (*(struct ifnet **)(mtag + 1) == ifp) { log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname); m_freem(m); |