Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/982cacbfbd3d
branches:  netbsd-9
changeset: 963063:982cacbfbd3d
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Oct 03 17:18:32 2019 +0000

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

        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 61228e5264aa -r 982cacbfbd3d sys/external/bsd/ipf/netinet/fil.c
--- a/sys/external/bsd/ipf/netinet/fil.c        Thu Oct 03 17:14:47 2019 +0000
+++ b/sys/external/bsd/ipf/netinet/fil.c        Thu Oct 03 17:18:32 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.29.2.1 2019/08/09 19:18:47 martin Exp $      */
+/*     $NetBSD: fil.c,v 1.29.2.2 2019/10/03 17:18:32 martin Exp $      */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -141,7 +141,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.29.2.1 2019/08/09 19:18:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.29.2.2 2019/10/03 17:18:32 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 $";
@@ -155,6 +155,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 61228e5264aa -r 982cacbfbd3d sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
--- a/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Thu Oct 03 17:14:47 2019 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Thu Oct 03 17:18:32 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil_netbsd.c,v 1.31 2018/08/10 07:16:13 maxv Exp $  */
+/*     $NetBSD: ip_fil_netbsd.c,v 1.31.4.1 2019/10/03 17:18:32 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.31 2018/08/10 07:16:13 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.31.4.1 2019/10/03 17:18:32 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";
@@ -1493,6 +1493,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