Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Mar 2005 20:25:38 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        glebius@FreeBSD.org, freebsd-bugs@FreeBSD.org, andre@FreeBSD.org
Subject:   Re: kern/78893: [patch] ip_fastfwd.c: fast forward will crash the system in 5.x.
Message-ID:  <200503172025.j2HKPcV7097646@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503172025.j2HKPcV7097646>