From 7efd755635cf3b7566887648a492de87f729bddc Mon Sep 17 00:00:00 2001 From: mav Date: Wed, 1 Jul 2009 08:08:56 +0000 Subject: 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 --- sys/netgraph/ng_iface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/netgraph') 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); -- cgit v1.1