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
This commit is contained in:
Alexander Motin 2009-07-01 08:08:56 +00:00
parent f09a384fae
commit 505feb8f37
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195231

View File

@ -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);