kern/78893: [patch] ip_fastfwd.c: fast forward will crash the system in 5.x.

Gleb Smirnoff glebius at FreeBSD.org
Thu Mar 17 12:25:39 PST 2005


Synopsis: [patch] ip_fastfwd.c: fast forward will crash the system in 5.x.

Responsible-Changed-From-To: freebsd-bugs->andre
Responsible-Changed-By: glebius
Responsible-Changed-When: Thu Mar 17 20:16:46 GMT 2005
Responsible-Changed-Why: 
Good catch, thanks! Your patch is correct, but I'd better don't
use assignment as boolean expression.  I suggest this patch:

diff -u -r1.26 ip_fastfwd.c
--- ip_fastfwd.c        7 Jan 2005 01:45:44 -0000       1.26
+++ ip_fastfwd.c        17 Mar 2005 20:13:52 -0000
@@ -594,9 +594,8 @@
                        } while ((m = m0) != NULL);
                        if (error) {
                                /* Reclaim remaining fragments */
-                               for (; m; m = m0) {
+                               for (m = m0; m; m = m0) {
                                        m0 = m->m_nextpkt;
-                                       m->m_nextpkt = NULL;
                                        m_freem(m);
                                }
                        } else


I think it is more clear. It also removes redundant assignment.

I pass the PR and patch for Andre review, who is author of this file.

http://www.freebsd.org/cgi/query-pr.cgi?pr=78893


More information about the freebsd-bugs mailing list