Module Name:    src
Committed By:   maxv
Date:           Mon Feb 12 15:38:14 UTC 2018

Modified Files:
        src/sys/net: if_gif.c if_pppoe.c

Log Message:
Use m_freem instead of m_free. Otherwise we're leaking the next mbufs in
the chain.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/net/if_gif.c
cvs rdiff -u -r1.133 -r1.134 src/sys/net/if_pppoe.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/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.138 src/sys/net/if_gif.c:1.139
--- src/sys/net/if_gif.c:1.138	Mon Jan 15 09:26:21 2018
+++ src/sys/net/if_gif.c	Mon Feb 12 15:38:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.138 2018/01/15 09:26:21 maxv Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.139 2018/02/12 15:38:14 maxv Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.138 2018/01/15 09:26:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.139 2018/02/12 15:38:14 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -458,7 +458,7 @@ gif_output(struct ifnet *ifp, struct mbu
 	IFQ_CLASSIFY(&ifp->if_snd, m, dst->sa_family);
 
 	if ((error = gif_check_nesting(ifp, m)) != 0) {
-		m_free(m);
+		m_freem(m);
 		goto end;
 	}
 

Index: src/sys/net/if_pppoe.c
diff -u src/sys/net/if_pppoe.c:1.133 src/sys/net/if_pppoe.c:1.134
--- src/sys/net/if_pppoe.c:1.133	Thu Dec  7 10:22:04 2017
+++ src/sys/net/if_pppoe.c	Mon Feb 12 15:38:14 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.133 2017/12/07 10:22:04 ozaki-r Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.134 2018/02/12 15:38:14 maxv Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.133 2017/12/07 10:22:04 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.134 2018/02/12 15:38:14 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -1795,7 +1795,7 @@ pppoe_transmit(struct ifnet *ifp, struct
 	PPPOE_LOCK(sc, RW_READER);
 	if (sc->sc_state < PPPOE_STATE_SESSION) {
 		PPPOE_UNLOCK(sc);
-		m_free(m);
+		m_freem(m);
 		return ENOBUFS;
 	}
 
@@ -1887,13 +1887,13 @@ static void
 pppoe_enqueue(struct ifqueue *inq, struct mbuf *m)
 {
 	if (m->m_flags & M_PROMISC) {
-		m_free(m);
+		m_freem(m);
 		return;
 	}
 
 #ifndef PPPOE_SERVER
 	if (m->m_flags & (M_MCAST | M_BCAST)) {
-		m_free(m);
+		m_freem(m);
 		return;
 	}
 #endif

Reply via email to