Module Name: src Committed By: snj Date: Fri Apr 10 20:26:47 UTC 2015
Modified Files: src/external/bsd/ipf/dist/lib [netbsd-7]: interror.c src/sys/external/bsd/ipf/netinet [netbsd-7]: fil.c Log Message: Pull up following revision(s) (requested by khorben in ticket #671): external/bsd/ipf/dist/lib/interror.c: revision 1.4 sys/external/bsd/ipf/netinet/fil.c: revision 1.16 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! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.6.1 src/external/bsd/ipf/dist/lib/interror.c cvs rdiff -u -r1.15 -r1.15.2.1 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.3.6.1 --- 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 Fri Apr 10 20:26:46 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: interror.c,v 1.3 2013/05/08 18:20:14 christos Exp $ */ +/* $NetBSD: interror.c,v 1.3.6.1 2015/04/10 20:26:46 snj 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.15.2.1 --- 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 Fri Apr 10 20:26:46 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fil.c,v 1.15 2014/06/16 12:38:32 christos Exp $ */ +/* $NetBSD: fil.c,v 1.15.2.1 2015/04/10 20:26:46 snj 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.15.2.1 2015/04/10 20:26:46 snj 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,