Module Name:    src
Committed By:   ozaki-r
Date:           Tue May 17 03:24:46 UTC 2016

Modified Files:
        src/sys/netinet6: icmp6.c

Log Message:
Make sure icmp6_redirect_input frees mbuf before return


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/netinet6/icmp6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/icmp6.c
diff -u src/sys/netinet6/icmp6.c:1.183 src/sys/netinet6/icmp6.c:1.184
--- src/sys/netinet6/icmp6.c:1.183	Thu May 12 02:24:17 2016
+++ src/sys/netinet6/icmp6.c	Tue May 17 03:24:46 2016
@@ -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 @@ icmp6_redirect_input(struct mbuf *m, int
 	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 @@ icmp6_redirect_input(struct mbuf *m, int
 		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) {
 			/*

Reply via email to