Module Name: src
Committed By: khorben
Date: Thu Apr 2 00:12:58 UTC 2015
Modified Files:
src/external/bsd/ipf/dist/lib: interror.c
src/sys/external/bsd/ipf/netinet: fil.c
Log Message:
Fix for PR kern/48109 (and its duplicate kern/49807)
As provided by Takahiro HAYASHI in PR kern/48109. Additional error
registration in ipf(8) by myself. Changes tested with GENERIC and
XEN3_DOM0. Thanks!
XXX pull-up netbsd-7
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ipf/dist/lib/interror.c
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/ipf/netinet/fil.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/ipf/dist/lib/interror.c
diff -u src/external/bsd/ipf/dist/lib/interror.c:1.3 src/external/bsd/ipf/dist/lib/interror.c:1.4
--- src/external/bsd/ipf/dist/lib/interror.c:1.3 Wed May 8 18:20:14 2013
+++ src/external/bsd/ipf/dist/lib/interror.c Thu Apr 2 00:12:58 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: interror.c,v 1.3 2013/05/08 18:20:14 christos Exp $ */
+/* $NetBSD: interror.c,v 1.4 2015/04/02 00:12:58 khorben Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
@@ -19,7 +19,7 @@ typedef struct {
static ipf_error_entry_t *find_error __P((int));
-#define IPF_NUM_ERRORS 475
+#define IPF_NUM_ERRORS 476
/*
* NO REUSE OF NUMBERS!
@@ -179,6 +179,7 @@ static ipf_error_entry_t ipf_errors[IPF_
{ 149, "object size validation failed for kernel copyout" },
{ 150, "error copying data out for kernel copyout" },
{ 151, "version mismatch for kernel copyout" },
+ { 152, "direction does not match the group rule" },
/* -------------------------------------------------------------------------- */
{ 10001, "could not find token for auth iterator" },
{ 10002, "write permissions require to add/remove auth rule" },
Index: src/sys/external/bsd/ipf/netinet/fil.c
diff -u src/sys/external/bsd/ipf/netinet/fil.c:1.15 src/sys/external/bsd/ipf/netinet/fil.c:1.16
--- src/sys/external/bsd/ipf/netinet/fil.c:1.15 Mon Jun 16 12:38:32 2014
+++ src/sys/external/bsd/ipf/netinet/fil.c Thu Apr 2 00:12:58 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fil.c,v 1.15 2014/06/16 12:38:32 christos Exp $ */
+/* $NetBSD: fil.c,v 1.16 2015/04/02 00:12:58 khorben Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
@@ -138,7 +138,7 @@ extern struct timeout ipf_slowtimer_ch;
#if !defined(lint)
#if defined(__NetBSD__)
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.15 2014/06/16 12:38:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.16 2015/04/02 00:12:58 khorben 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 $";
@@ -4495,6 +4495,11 @@ frrequest(ipf_main_softc_t *softc, int u
if (addrem == 0) {
fg = ipf_group_add(softc, group, NULL,
fp->fr_flags, unit, set);
+ if (fg == NULL) {
+ IPFERROR(152);
+ error = ESRCH;
+ goto donenolock;
+ }
fp->fr_grp = fg;
} else {
fg = ipf_findgroup(softc, group, unit,