Module Name: src Committed By: pgoyette Date: Mon Jul 18 21:07:30 UTC 2016
Modified Files: src/sys/external/bsd/ipf/netinet: ip_fil_netbsd.c Log Message: Rearrange code to avoid testing an error value that has not been set. Also, for the built-in case, rather than re-inserting our devsw and then ignoring the EEXIST error, don't bother re-inserting. CID 1364140 To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.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/external/bsd/ipf/netinet/ip_fil_netbsd.c diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.17 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.18 --- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.17 Sun Jul 17 02:02:01 2016 +++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c Mon Jul 18 21:07:30 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_fil_netbsd.c,v 1.17 2016/07/17 02:02:01 pgoyette Exp $ */ +/* $NetBSD: ip_fil_netbsd.c,v 1.18 2016/07/18 21:07:30 pgoyette Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -8,7 +8,7 @@ #if !defined(lint) #if defined(__NetBSD__) #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.17 2016/07/17 02:02:01 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.18 2016/07/18 21:07:30 pgoyette Exp $"); #else static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed"; static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp"; @@ -2202,20 +2202,12 @@ ipl_init(void *opaque) #ifdef _MODULE /* - * Insert ourself into the cdevsw list. It's OK if we are - * already there, since this will happen when our module is - * built-in to the kernel. (We could skip the insert in - * that case, but that would break the possibility of a - * unload/re-load sequence for the built-in module, which - * corresponds to disable/re-enable.) + * Insert ourself into the cdevsw list. */ error = devsw_attach("ipl", NULL, &ipl_bmaj, &ipl_cdevsw, &ipl_cmaj); - if (error == EEXIST) - error = 0; -#endif - if (error) ipl_fini(opaque); +#endif return error; }