Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 Make sure icmp6_redirect_input frees mbuf befor...



details:   https://anonhg.NetBSD.org/src/rev/21b15de19070
branches:  trunk
changeset: 815430:21b15de19070
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue May 17 03:24:46 2016 +0000

description:
Make sure icmp6_redirect_input frees mbuf before return

diffstat:

 sys/netinet6/icmp6.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 4510bd43032c -r 21b15de19070 sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Tue May 17 03:20:58 2016 +0000
+++ b/sys/netinet6/icmp6.c      Tue May 17 03:24:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.c,v 1.183 2016/05/12 02:24:17 ozaki-r Exp $      */
+/*     $NetBSD: icmp6.c,v 1.184 2016/05/17 03:24:46 ozaki-r Exp $      */
 /*     $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.183 2016/05/12 02:24:17 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.184 2016/05/17 03:24:46 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2140,8 +2140,8 @@
        struct in6_addr reddst6;
        union nd_opts ndopts;
 
-       if (!ifp)
-               return;
+       if (ifp == NULL)
+               goto freeit;
 
        /* XXX if we are router, we don't update route by icmp6 redirect */
        if (ip6_forwarding)
@@ -2277,7 +2277,7 @@
                if (0 <= ip6_maxdynroutes && rtcount >= ip6_maxdynroutes)
                        goto freeit;
                if (0 <= icmp6_redirect_hiwat && rtcount > icmp6_redirect_hiwat)
-                       return;
+                       goto freeit;
                else if (0 <= icmp6_redirect_lowat &&
                    rtcount > icmp6_redirect_lowat) {
                        /*



Home | Main Index | Thread Index | Old Index