Subject: kern/26672: sysctl_create(esp_net_deflev) is called twice with FAST_IPSEC kernel
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <fun@naobsd.org>
List: netbsd-bugs
Date: 08/16/2004 02:22:58
>Number:         26672
>Category:       kern
>Synopsis:       sysctl_create(esp_net_deflev) is called twice with FAST_IPSEC kernel
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 15 17:49:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     FUKAUMI Naoki
>Release:        NetBSD 2.0G
>Organization:
	FUKAUMI Naoki
>Environment:
System: NetBSD eden.naobsd.org 2.0G NetBSD 2.0G (EDENh) #0: Sun Aug 15 03:35:37 JST 2004 root@ea65.naobsd.org:/usr/obj/i386/sys/arch/i386/compile/EDENh i386
Architecture: i386
Machine: i386
>Description:
	This is dmesg output from FAST_IPSEC enabled kernel,

NetBSD 2.0G (EDENh) #0: Sun Aug 15 03:35:37 JST 2004
	root@ea65.naobsd.org:/usr/obj/i386/sys/arch/i386/compile/EDENh
total memory = 495 MB
avail memory = 480 MB
sysctl_createv: sysctl_create(esp_net_deflev) returned 17
BIOS32 rev. 0 found at 0xfb000
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: VIA C3 Samuel 2/Ezra (686-class), 601.41 MHz, id 0x673
cpu0: features 80803035<FPU,DE,TSC,MSR,MTRR>
  :

>How-To-Repeat:
	Add "options FAST_IPSEC" to kernel config file.
>Fix:
Index: sys/netipsec/ipsec_netbsd.c
===================================================================
RCS file: /home/fun/cvsroot/NetBSD/src/sys/netipsec/ipsec_netbsd.c,v
retrieving revision 1.11
diff -u -r1.11 ipsec_netbsd.c
--- sys/netipsec/ipsec_netbsd.c	17 Jul 2004 16:36:39 -0000	1.11
+++ sys/netipsec/ipsec_netbsd.c	15 Aug 2004 15:39:30 -0000
@@ -501,12 +501,6 @@
 		       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		       CTLTYPE_INT, "esp_net_deflev", NULL,
 		       sysctl_fast_ipsec, 0, &ip4_esp_net_deflev, 0,
-		       CTL_NET, PF_INET, IPPROTO_ESP,
-		       IPSECCTL_DEF_ESP_NETLEV, CTL_EOL);
-	sysctl_createv(clog, 0, NULL, NULL,
-		       CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
-		       CTLTYPE_INT, "esp_net_deflev", NULL,
-		       sysctl_fast_ipsec, 0, &ip4_esp_net_deflev, 0,
 		       CTL_NET, PF_INET, ipproto_ipsec,
 		       IPSECCTL_DEF_ESP_NETLEV, CTL_EOL);
 	sysctl_createv(clog, 0, NULL, NULL,
>Release-Note:
>Audit-Trail:
>Unformatted: