Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/external/bsd/ipf/netinet Pull up following revision(s...



details:   https://anonhg.NetBSD.org/src/rev/fe491eb37067
branches:  netbsd-8
changeset: 455020:fe491eb37067
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Oct 04 11:28:49 2019 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1399):

        sys/external/bsd/ipf/netinet/fil.c: revision 1.31
        sys/external/bsd/ipf/netinet/ip_fil_netbsd.c: revision 1.32
        sys/external/bsd/ipf/netinet/ip_fil_netbsd.c: revision 1.33

Fix 2 bugs, reported by Edgar Fuss on tech-net@
- pfil_run_hooks() can be called recursively, so we have to
  #define FASTROUTE_RECURSION in fil.c
- ip6_if_output()/nd6_output() will free the mbuf on error, to make sure
  to set *mpp to NULL so the caller won't try to free it again.

fix double space in comment

diffstat:

 sys/external/bsd/ipf/netinet/fil.c           |  6 ++++--
 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c |  6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (54 lines):

diff -r c937674f3d66 -r fe491eb37067 sys/external/bsd/ipf/netinet/fil.c
--- a/sys/external/bsd/ipf/netinet/fil.c        Fri Oct 04 11:26:35 2019 +0000
+++ b/sys/external/bsd/ipf/netinet/fil.c        Fri Oct 04 11:28:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.20.4.3 2019/08/09 19:21:04 martin Exp $      */
+/*     $NetBSD: fil.c,v 1.20.4.4 2019/10/04 11:28:49 martin Exp $      */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -138,7 +138,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.20.4.3 2019/08/09 19:21:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.20.4.4 2019/10/04 11:28:49 martin Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -152,6 +152,8 @@
 extern int     blockreason;
 #endif /* _KERNEL */
 
+#define FASTROUTE_RECURSION
+
 #define        LBUMP(x)        softc->x++
 #define        LBUMPD(x, y)    do { softc->x.y++; DT(y); } while (0)
 
diff -r c937674f3d66 -r fe491eb37067 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
--- a/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Fri Oct 04 11:26:35 2019 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Fri Oct 04 11:28:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil_netbsd.c,v 1.23.2.1 2017/08/14 23:51:14 snj Exp $       */
+/*     $NetBSD: ip_fil_netbsd.c,v 1.23.2.2 2019/10/04 11:28:49 martin Exp $    */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.23.2.1 2017/08/14 23:51:14 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.23.2.2 2019/10/04 11:28:49 martin Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c     2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -1490,6 +1490,8 @@
 # else
                        error = nd6_output(ifp, ifp, m0, dst6, rt);
 # endif
+                       if (error)
+                               *mpp = NULL; /* m0 has been freed */
                } else {
                        error = EMSGSIZE;
                }



Home | Main Index | Thread Index | Old Index