Module Name:    src
Committed By:   maxv
Date:           Tue Jul 10 14:04:07 UTC 2018

Modified Files:
        src/sys/net/npf: npf_handler.c

Log Message:
Update the pointer when fast-kicking, because it may have been freed.
Before my changes the nonsensical pointer ininitialization held, but
when I started introducing sanity checks the whole thing collapsed.

Need pullup-8.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/net/npf/npf_handler.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/npf/npf_handler.c
diff -u src/sys/net/npf/npf_handler.c:1.40 src/sys/net/npf/npf_handler.c:1.41
--- src/sys/net/npf/npf_handler.c:1.40	Tue Jul 10 12:31:46 2018
+++ src/sys/net/npf/npf_handler.c	Tue Jul 10 14:04:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_handler.c,v 1.40 2018/07/10 12:31:46 maxv Exp $	*/
+/*	$NetBSD: npf_handler.c,v 1.41 2018/07/10 14:04:07 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf_handler.c,v 1.40 2018/07/10 12:31:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_handler.c,v 1.41 2018/07/10 14:04:07 maxv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -160,6 +160,7 @@ npf_packet_handler(npf_t *npf, struct mb
 
 	/* If error on the format, leave quickly. */
 	if (flags & NPC_FMTERR) {
+		*mp = nbuf_head_mbuf(&nbuf);
 		error = EINVAL;
 		goto fastout;
 	}

Reply via email to