From nobody@FreeBSD.org  Sun Dec 22 13:04:53 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 2CAD115E
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 22 Dec 2013 13:04:53 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 184C21B32
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 22 Dec 2013 13:04:53 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBMD4q7I060417
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 22 Dec 2013 13:04:52 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBMD4q38060416;
	Sun, 22 Dec 2013 13:04:52 GMT
	(envelope-from nobody)
Message-Id: <201312221304.rBMD4q38060416@oldred.freebsd.org>
Date: Sun, 22 Dec 2013 13:04:52 GMT
From: Nikolay Denev <ndenev@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185092
>Category:       kern
>Synopsis:       panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    melifaro
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 22 13:10:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Thu May  8 20:30:02 UTC 2014
>Originator:     Nikolay Denev
>Release:        10.0-PRERELEASE
>Organization:
>Environment:
FreeBSD mars 10.0-PRERELEASE FreeBSD 10.0-PRERELEASE #5 r259547: Sat Dec 21 21:48:57 UTC 2013     ndenev@mars:/usr/obj/usr/src/sys/MARS  i386
>Description:
I'm running with VIMAGE and RADIX_MPATH enabled on a Soekris Net5501 running 10.0-PRERELASE (r259547).

I have a VNET jail, liked with epair(4) interface to the main stack, and inside I have two OpenVPN instances running, that both install a default route (the way OpenVPN does this as 0.0.0.0/1) and the ECMP works fine.

However when I wanted to stop the OpenVPN processes and did a "killall openvpn" inside the VNET jail I got the following panic :

root@mars:/usr/obj/usr/src/sys/MARS # kgdb /boot/kernel/kernel.debug /var/crash/vmcore.2
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...

Unread portion of the kernel message buffer:
panic: rtfree 2
KDB: stack backtrace:
#0 0xc0639ec2 at kdb_backtrace+0x52
#1 0xc0607ef5 at panic+0x85
#2 0xc06df879 at rtfree+0x139
#3 0xc06e2acd at route_output+0x48d
#4 0xc06df3cf at raw_usend+0x3f
#5 0xc066fef9 at sosend_generic+0x429
#6 0xc0670217 at sosend+0x57
#7 0xc0655d44 at soo_write+0x44
#8 0xc064dab6 at dofilewrite+0x86
#9 0xc064d7b6 at kern_writev+0x96
#10 0xc064d70c at sys_write+0x5c
#11 0xc0864233 at syscall+0x353
#12 0xc084fa01 at Xint0x80_syscall+0x21
Uptime: 14h35m12s
Physical memory: 503 MB
Dumping 90 MB: 75 59 43 27 11

No symbol "stopped_cpus" in current context.
#0  doadump (textdump=-1011979520) at pcpu.h:233
233		__asm("movl %%fs:%1,%0" : "=r" (td)
(kgdb) bt
#0  doadump (textdump=-1011979520) at pcpu.h:233
#1  0xc0607c02 in kern_reboot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:447
#2  0xc0607f5e in panic (fmt=<value optimized out>) at /usr/src/sys/kern/kern_shutdown.c:754
#3  0xc06df879 in rtfree (rt=<value optimized out>) at /usr/src/sys/net/route.c:464
#4  0xc06e2acd in route_output (m=<value optimized out>) at /usr/src/sys/net/rtsock.c:951
#5  0xc06df3cf in raw_usend (so=<value optimized out>, flags=0, m=<value optimized out>, nam=0x0, control=<value optimized out>, 
    td=0xc3db8310) at /usr/src/sys/net/raw_usrreq.c:238
#6  0xc066fef9 in sosend_generic (so=0xc3e35d40, uio=<value optimized out>, top=<value optimized out>, control=0x0, 
    flags=<value optimized out>, td=<value optimized out>) at /usr/src/sys/kern/uipc_socket.c:1271
#7  0xc0670217 in sosend (so=0xc3e35d40, addr=0x0, uio=0xd9bc1c10, top=0x0, control=0x0, flags=0, td=0xc3db8310)
    at /usr/src/sys/kern/uipc_socket.c:1315
#8  0xc0655d44 in soo_write (fp=0xc3c0c428, uio=0xd9bc1c10, active_cred=0xc448ff00, flags=0, td=0xc3db8310)
    at /usr/src/sys/kern/sys_socket.c:103
#9  0xc064dab6 in dofilewrite (td=0xc3db8310, fd=3, fp=0xc3c0c428, auio=0xd9bc1c10, offset=-1, flags=0) at file.h:303
#10 0xc064d7b6 in kern_writev (td=0xc3db8310, fd=3, auio=<value optimized out>) at /usr/src/sys/kern/sys_generic.c:467
#11 0xc064d70c in sys_write (td=<value optimized out>, uap=<value optimized out>) at /usr/src/sys/kern/sys_generic.c:382
#12 0xc0864233 in syscall (frame=<value optimized out>) at subr_syscall.c:134
#13 0xc084fa01 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:270
#14 0x00000033 in ?? ()


Code in sys/net/rtsock.c:951 looks responsible for this, and is marked with XXX.
<code>
        if (rt)         /* XXX can this be true? */
                RTFREE(rt);
</code>
>How-To-Repeat:
Setup OpenVPN instances to install the same route using RADIX_MPATH inside a VNET jail. Kill the instances.

>Fix:


>Release-Note:
>Audit-Trail:

From: Nikolay Denev <ndenev@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org, 
	"freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Cc:  
Subject: Re: misc/185092: panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
Date: Wed, 1 Jan 2014 13:10:57 +0000

 --001a11c3d860640c3f04eee868e9
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable
 
 On Sun, Dec 22, 2013 at 1:10 PM, <FreeBSD-gnats-submit@freebsd.org> wrote:
 
 > Thank you very much for your problem report.
 > It has the internal identification `misc/185092'.
 > The individual assigned to look at your
 > report is: freebsd-bugs.
 >
 > You can access the state of your problem report at any time
 > via this link:
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092
 >
 > >Category:       misc
 > >Responsible:    freebsd-bugs
 > >Synopsis:       panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
 > >Arrival-Date:   Sun Dec 22 13:10:00 UTC 2013
 >
 
 I'm trying to understand exactly what is happening here, and examining a
 core dump with kgdb I'm getting some output that confuses me :
 
 (kgdb) bt
 #0  doadump (textdump=3D-1011569920) at pcpu.h:233
 #1  0xc06069b2 in kern_reboot (howto=3D260) at
 /usr/src/sys/kern/kern_shutdown.c:447
 #2  0xc0606d0e in panic (fmt=3D<value optimized out>) at
 /usr/src/sys/kern/kern_shutdown.c:754
 #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 /usr/src/sys/net/route.c:464
 #4  0xc06e188d in route_output (m=3D<value optimized out>) at
 /usr/src/sys/net/rtsock.c:951
 #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=3D<va=
 lue
 optimized out>, nam=3D0x0, control=3D<value optimized out>,
     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 #6  0xc066eca9 in sosend_generic (so=3D0xc3e9c1a8, uio=3D<value optimized o=
 ut>,
 top=3D<value optimized out>, control=3D0x0,
     flags=3D<value optimized out>, td=3D<value optimized out>) at
 /usr/src/sys/kern/uipc_socket.c:1271
 #7  0xc066efc7 in sosend (so=3D0xc3e9c1a8, addr=3D0x0, uio=3D0xd9b9cc10, to=
 p=3D0x0,
 control=3D0x0, flags=3D0, td=3D0xc3bd2000)
     at /usr/src/sys/kern/uipc_socket.c:1315
 #8  0xc0654af4 in soo_write (fp=3D0xc3c0c818, uio=3D0xd9b9cc10,
 active_cred=3D0xc3f1dd00, flags=3D0, td=3D0xc3bd2000)
     at /usr/src/sys/kern/sys_socket.c:103
 #9  0xc064c866 in dofilewrite (td=3D0xc3bd2000, fd=3D3, fp=3D0xc3c0c818,
 auio=3D0xd9b9cc10, offset=3D-1, flags=3D0) at file.h:303
 #10 0xc064c566 in kern_writev (td=3D0xc3bd2000, fd=3D3, auio=3D<value optim=
 ized
 out>) at /usr/src/sys/kern/sys_generic.c:467
 #11 0xc064c4bc in sys_write (td=3D<value optimized out>, uap=3D<value optim=
 ized
 out>) at /usr/src/sys/kern/sys_generic.c:382
 #12 0xc08614d3 in syscall (frame=3D<value optimized out>) at
 subr_syscall.c:134
 #13 0xc084cca1 in Xint0x80_syscall () at
 /usr/src/sys/i386/i386/exception.s:270
 #14 0x281975b7 in ?? ()
 Previous frame inner to this frame (corrupt stack?)
 Current language:  auto; currently minimal
 (kgdb) fr 3
 #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 /usr/src/sys/net/route.c:464
 464 panic("rtfree 2");
 (kgdb) print *rt
 $1 =3D {rt_nodes =3D {{rn_mklist =3D 0xc3b4ab30, rn_parent =3D 0x1, rn_bit =
 =3D 0,
 rn_bmask =3D 0 '\0', rn_flags =3D 0 '\0', rn_u =3D {rn_leaf =3D {
           rn_Key =3D 0xc0882687 "shutdown_post_sync", rn_Mask =3D 0x1030000
 <Address 0x1030000 out of bounds>, rn_Dupedkey =3D 0x0}, rn_node =3D {
           rn_Off =3D -1064819065, rn_L =3D 0x1030000, rn_R =3D 0x0}}}, {rn_=
 mklist
 =3D 0x0, rn_parent =3D 0x4, rn_bit =3D -18048, rn_bmask =3D -94 '?',
       rn_flags =3D 195 '?', rn_u =3D {rn_leaf =3D {rn_Key =3D 0xc3a545e0 ""=
 ,
 rn_Mask =3D 0xc3a4e440 " ??(???\020'", rn_Dupedkey =3D 0xc3a4e880},
         rn_node =3D {rn_Off =3D -1012578848, rn_L =3D 0xc3a4e440, rn_R =3D
 0xc3a4e880}}}}, rt_gateway =3D 0x74756873, rt_flags =3D 1853321060,
   rt_refcnt =3D 1936683103, rt_ifp =3D 0x79735f74, rt_ifa =3D 0x636e, rt_rm=
 x =3D
 {rmx_mtu =3D 0, rmx_expire =3D 0, rmx_pksent =3D 0, rmx_weight =3D 0},
   rt_fibnum =3D 0, rt_mtx =3D {lock_object =3D {lo_name =3D 0x0, lo_flags =
 =3D 0,
 lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 0}}
 
 
 
 rn_Key with value of =93shutdown_post_sync=94 ?
 
 It=92s visible also in the raw_usend() frame:
 
 (kgdb) fr 5
 #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=3D<va=
 lue
 optimized out>, nam=3D0x0, control=3D<value optimized out>,
     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 238 return ((*so->so_proto->pr_output)(m, so));
 (kgdb) print *m
 $2 =3D {m_hdr =3D {mh_next =3D 0xc3b4ab30, mh_nextpkt =3D 0x1, mh_data =3D =
 0x0,
 mh_len =3D -1064819065, mh_type =3D 0, mh_flags =3D 66304, mh_pad =3D 0},
   M_dat =3D {MH =3D {MH_pkthdr =3D {rcvif =3D 0x0, tags =3D {slh_first =3D =
 0x4}, len =3D
 -1012745856, flowid =3D 3282388448,
         csum_flags =3D 14097648373312316480, fibnum =3D 26739, cosqos =3D 1=
 17
 'u', rsstype =3D 116 't', l2hlen =3D 100 'd', l3hlen =3D 111 'o',
         l4hlen =3D 119 'w', l5hlen =3D 110 'n', PH_per =3D {eigth =3D "_pos=
 t_sy",
 sixteen =3D {28767, 29551, 24436, 31091}, thirtytwo =3D {1936683103,
             2037604212}, sixtyfour =3D {8751443454668533855}, unintptr =3D
 {1936683103}, ptr =3D 0x736f705f}, PH_loc =3D {
           eigth =3D "nc\000\000\000\000\000", sixteen =3D {25454, 0, 0, 0},
 thirtytwo =3D {25454, 0}, sixtyfour =3D {25454}, unintptr =3D {25454},
           ptr =3D 0x636e}}, MH_dat =3D {MH_ext =3D {ref_cnt =3D 0x0, ext_bu=
 f =3D 0x0,
 ext_size =3D 0, ext_type =3D 0, ext_flags =3D 0, ext_free =3D 0,
           ext_arg1 =3D 0x0, ext_arg2 =3D 0x0},
         MH_databuf =3D '\0' <repeats 56 times>, "file", '\0' <repeats 20
 times>,
 "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\000\0=
 00\000\000\004\000\000\000\000\000\000\00000Y?",
 '\0' <repeats 12 times>,
 "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203??\0=
 00\000\000\000\000???",
 '\0' <repeats 23 times>}},
     M_databuf =3D
 "\000\000\000\000\004\000\000\000\200????E??@??\200??shutdown_post_sync",
 '\0' <repeats 62 times>, "file", '\0' <repeats 20 times>,
 "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\000\0=
 00\000\000\004\000\000\000\000\000\000\00000Y?",
 '\0' <repeats 12 times>,
 "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203??\0=
 00\000\000\000\000???",
 '\0' <repeats 23 times>}}
 
 
 This is 10.0-PRERELEASE r259547M (with applied the recent nd6_nbr.c rtfree
 patch, which I  thought earlier might be the cause of the panics I'm
 seeing).
 
 The machine is Soekris Net5501-70 with this kernel config :
 
 cpu I586_CPU
 cpu I686_CPU
 ident MARS
 options CPU_GEODE
 options     CPU_SOEKRIS
 
 options HZ=3D2000
 options DEVICE_POLLING
 options BPF_JITTER
 
 makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols
 
 options SCHED_ULE # ULE scheduler
 options PREEMPTION # Enable kernel thread preemption
 options INET # InterNETworking
 options INET6 # IPv6 communications protocols
 options TCP_OFFLOAD # TCP offload
 options FFS # Berkeley Fast Filesystem
 options SOFTUPDATES # Enable FFS soft updates support
 options UFS_DIRHASH # Improve performance on big directories
 options PROCFS # Process filesystem (requires PSEUDOFS)
 options PSEUDOFS # Pseudo-filesystem framework
 options GEOM_PART_GPT # GUID Partition Tables.
 options GEOM_LABEL # Provides labelization
 options COMPAT_FREEBSD4 # Compatible with FreeBSD4
 options COMPAT_FREEBSD5 # Compatible with FreeBSD5
 options COMPAT_FREEBSD6 # Compatible with FreeBSD6
 options COMPAT_FREEBSD7 # Compatible with FreeBSD7
 options SCSI_DELAY=3D500 # Delay (in ms) before probing SCSI
 options KTRACE # ktrace(1) support
 options STACK # stack(9) support
 options SYSVSHM # SYSV-style shared memory
 options SYSVMSG # SYSV-style message queues
 options SYSVSEM # SYSV-style semaphores
 options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options PRINTF_BUFR_SIZE=3D128 # Prevent printf output being interspersed.
 options KBD_INSTALL_CDEV # install a CDEV entry in /dev
 options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 options CAPABILITY_MODE # Capsicum capability mode
 options CAPABILITIES # Capsicum capabilities
 options PROCDESC # Support for process descriptors
 options INCLUDE_CONFIG_FILE     # Include this file in kernel
 
 # Debugging support.  Always need this:
 options KDB # Enable kernel debugger support.
 options KDB_TRACE # Print a stack trace for a panic.
 options KDB_UNATTENDED
 
 options TEXTDUMP_PREFERRED
 options TEXTDUMP_VERBOSE
 
 device pci
 device ata # Legacy ATA/SATA controllers
 options ATA_STATIC_ID # Static device numbering
 
 # ATA/SCSI peripherals
 device scbus # SCSI bus (required for ATA/SCSI)
 device da # Direct Access (disks)
 device pass # Passthrough device (direct ATA/SCSI access)
 
 # Add suspend/resume support for the i8254.
 device pmtimer
 
 # Serial (COM) ports
 device uart # Generic UART driver
 
 device miibus # MII bus support
 device vr # VIA Rhine, Rhine II
 
 # Wireless NIC cards
 device wlan # 802.11 support
 options IEEE80211_DEBUG # enable debug msgs
 options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
 options IEEE80211_SUPPORT_MESH # enable 802.11s draft support
 device wlan_wep # 802.11 WEP support
 device wlan_ccmp # 802.11 CCMP support
 device wlan_tkip # 802.11 TKIP support
 device wlan_amrr # AMRR transmit rate control algorithm
 device ath # Atheros NICs
 device ath_pci # Atheros pci/cardbus glue
 device ath_hal # pci/cardbus chip support
 options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
 options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation
 options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later
 device ath_rate_sample # SampleRate tx rate control for ath
 
 # Pseudo devices.
 device loop # Network loopback
 device random # Entropy device
 device ether # Ethernet support
 device vlan # 802.1Q VLAN support
 device tun # Packet tunnel.
 device md # Memory "disks"
 device gif # IPv6 and IPv4 tunneling
 device      gre
 device faith # IPv6-to-IPv4 relaying (translation)
 device firmware # firmware assist module
 device      if_bridge
 
 options     VIMAGE
 options     ROUTETABLES=3D8
 options     RADIX_MPATH
 
 options     SW_WATCHDOG
 
 device      crypto
 device      cryptodev
 device      glxsb
 
 options     BOOTVERBOSE=3D1
 
 #device      pf
 #device      pflog
 #device      pfsync
 device       carp
 device       enc
 device       lagg
 device       epair
 
 #options     ALTQ
 #options     ALTQ_CBQ
 #options     ALTQ_RED
 #options     ALTQ_RIO
 #options     ALTQ_HFSC
 #options     ALTQ_PRIQ
 
 options     IPFIREWALL
 options     IPFIREWALL_DEFAULT_TO_ACCEPT
 options     IPFIREWALL_NAT
 options     LIBALIAS
 options     IPDIVERT
 options     DUMMYNET
 
 device bpf # Berkeley packet filter
 
 # USB support
 options USB_DEBUG # enable debug msgs
 device uhci # UHCI PCI->USB interface
 device ohci # OHCI PCI->USB interface
 device ehci # EHCI PCI->USB interface (USB 2.0)
 device usb     # USB Bus (required)
 device umass # Disks/Mass storage - Requires scbus and da
 
 
 Also src.conf and make.conf :
 
 root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/src.conf
 WITHOUT_ACCT=3Dyes
 WITHOUT_ACPI=3Dyes
 WITHOUT_AMD=3Dyes
 WITHOUT_APM=3Dyes
 WITHOUT_ASSERT_DEBUG=3Dyes
 WITHOUT_AT=3Dyes
 WITHOUT_ATF=3Dyes
 WITHOUT_ATM=3Dyes
 WITHOUT_AUDIT=3Dyes
 WITHOUT_BLUETOOTH=3Dyes
 WITHOUT_CALENDAR=3Dyes
 WITHOUT_CDDL=3Dyes
 WITHOUT_CTM=3Dyes
 WITHOUT_DICT=3Dyes
 WITHOUT_FLOPPY=3Dyes
 WITHOUT_GAMES=3Dyes
 WITHOUT_HTML=3Dyes
 WITHOUT_INFO=3Dyes
 WITHOUT_IPFILTER=3Dyes
 WITHOUT_IPX=3Dyes
 #WITHOUT_KERNEL_SYMBOLS=3Dyes
 WITHOUT_LEGACY_CONSOLE=3Dyes
 WITHOUT_LOCALES=3Dyes
 WITHOUT_LPR=3Dyes
 WITHOUT_MAIL=3Dyes
 WITHOUT_NDIS=3Dyes
 WITHOUT_QUOTAS=3Dyes
 WITHOUT_ROUTED=3Dyes
 WITHOUT_SENDMAIL=3Dyes
 WITH_SVN=3Dyes
 WITHOUT_ZFS=3Dyes
 
 root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/make.conf
 CFLAGS=3D-O2
 COPTFLAGS=3D -O -pipe
 CPUTYPE=3Dgeode
 KERNCONF=3DMARS
 NO_MODULES=3Dyes
 BOOTWAIT=3D0
 DOC_LANG=3Den_US.ISO8859-1
 
 
 
 --Nikolay
 
 --001a11c3d860640c3f04eee868e9
 Content-Type: text/html; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr">On Sun, Dec 22, 2013 at 1:10 PM,  <span dir=3D"ltr">&lt;<a=
  href=3D"mailto:FreeBSD-gnats-submit@freebsd.org" target=3D"_blank">FreeBSD=
 -gnats-submit@freebsd.org</a>&gt;</span> wrote:<br><div class=3D"gmail_extr=
 a"><div class=3D"gmail_quote">
 <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
 left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
 adding-left:1ex">Thank you very much for your problem report.<br>
 It has the internal identification `misc/185092&#39;.<br>
 The individual assigned to look at your<br>
 report is: freebsd-bugs.<br>
 <br>
 You can access the state of your problem report at any time<br>
 via this link:<br>
 <br>
 <a href=3D"http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092" target=3D"_=
 blank">http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092</a><br>
 <br>
 &gt;Category: =A0 =A0 =A0 misc<br>
 &gt;Responsible: =A0 =A0freebsd-bugs<br>
 &gt;Synopsis: =A0 =A0 =A0 panic: rtfree 2 (using RADIX_MPATH in a VNET jail=
 )<br>
 &gt;Arrival-Date: =A0 Sun Dec 22 13:10:00 UTC 2013<br>
 </blockquote></div><br></div><div class=3D"gmail_extra">I&#39;m trying to u=
 nderstand exactly what is happening here, and examining a core dump with kg=
 db I&#39;m getting some output that confuses me :</div><div class=3D"gmail_=
 extra">
 <br></div><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><=
 div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) bt</div></div><=
 div class=3D"gmail_extra"><div class=3D"gmail_extra">#0 =A0doadump (textdum=
 p=3D-1011569920) at pcpu.h:233</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#1 =A00xc06069b=
 2 in kern_reboot (howto=3D260) at /usr/src/sys/kern/kern_shutdown.c:447</di=
 v></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#2 =A00xc0606=
 d0e in panic (fmt=3D&lt;value optimized out&gt;) at /usr/src/sys/kern/kern_=
 shutdown.c:754</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#3 =A00xc06de63=
 9 in rtfree (rt=3D&lt;value optimized out&gt;) at /usr/src/sys/net/route.c:=
 464</div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#4 =A0=
 0xc06e188d in route_output (m=3D&lt;value optimized out&gt;) at /usr/src/sy=
 s/net/rtsock.c:951</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#5 =A00xc06de18=
 f in raw_usend (so=3D&lt;value optimized out&gt;, flags=3D0, m=3D&lt;value =
 optimized out&gt;, nam=3D0x0, control=3D&lt;value optimized out&gt;,=A0</di=
 v></div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">=A0 =A0 td=3D0xc3bd2000) at /usr/src/sys/net/raw=
 _usrreq.c:238</div></div><div class=3D"gmail_extra"><div class=3D"gmail_ext=
 ra">#6 =A00xc066eca9 in sosend_generic (so=3D0xc3e9c1a8, uio=3D&lt;value op=
 timized out&gt;, top=3D&lt;value optimized out&gt;, control=3D0x0,=A0</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 flags=
 =3D&lt;value optimized out&gt;, td=3D&lt;value optimized out&gt;) at /usr/s=
 rc/sys/kern/uipc_socket.c:1271</div></div><div class=3D"gmail_extra"><div c=
 lass=3D"gmail_extra">
 #7 =A00xc066efc7 in sosend (so=3D0xc3e9c1a8, addr=3D0x0, uio=3D0xd9b9cc10, =
 top=3D0x0, control=3D0x0, flags=3D0, td=3D0xc3bd2000)</div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 at /usr/src/sys/kern/ui=
 pc_socket.c:1315</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#8 =A00xc0654af=
 4 in soo_write (fp=3D0xc3c0c818, uio=3D0xd9b9cc10, active_cred=3D0xc3f1dd00=
 , flags=3D0, td=3D0xc3bd2000)</div></div><div class=3D"gmail_extra"><div cl=
 ass=3D"gmail_extra">
 =A0 =A0 at /usr/src/sys/kern/sys_socket.c:103</div></div><div class=3D"gmai=
 l_extra"><div class=3D"gmail_extra">#9 =A00xc064c866 in dofilewrite (td=3D0=
 xc3bd2000, fd=3D3, fp=3D0xc3c0c818, auio=3D0xd9b9cc10, offset=3D-1, flags=
 =3D0) at file.h:303</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#10 0xc064c566 =
 in kern_writev (td=3D0xc3bd2000, fd=3D3, auio=3D&lt;value optimized out&gt;=
 ) at /usr/src/sys/kern/sys_generic.c:467</div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra">
 #11 0xc064c4bc in sys_write (td=3D&lt;value optimized out&gt;, uap=3D&lt;va=
 lue optimized out&gt;) at /usr/src/sys/kern/sys_generic.c:382</div></div><d=
 iv class=3D"gmail_extra"><div class=3D"gmail_extra">#12 0xc08614d3 in sysca=
 ll (frame=3D&lt;value optimized out&gt;) at subr_syscall.c:134</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#13 0xc084cca1 =
 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:270</div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra">#14 0x281975b7 in ??=
  ()</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">Previous frame =
 inner to this frame (corrupt stack?)</div></div><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">Current language: =A0auto; currently minimal</di=
 v></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) fr 3</div></di=
 v><div class=3D"gmail_extra"><div class=3D"gmail_extra">#3 =A00xc06de639 in=
  rtfree (rt=3D&lt;value optimized out&gt;) at /usr/src/sys/net/route.c:464<=
 /div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">464<span class=3D"" s=
 tyle=3D"white-space:pre">				</span>panic(&quot;rtfree 2&quot;);</div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) print *rt</di=
 v></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">$1 =3D {rt_nodes =3D =
 {{rn_mklist =3D 0xc3b4ab30, rn_parent =3D 0x1, rn_bit =3D 0, rn_bmask =3D 0=
  &#39;\0&#39;, rn_flags =3D 0 &#39;\0&#39;, rn_u =3D {rn_leaf =3D {</div></=
 div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">=A0 =A0 =A0 =A0 =A0 rn_Key =3D 0xc0882687 &quot;=
 shutdown_post_sync&quot;, rn_Mask =3D 0x1030000 &lt;Address 0x1030000 out o=
 f bounds&gt;, rn_Dupedkey =3D 0x0}, rn_node =3D {</div></div><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra">
 =A0 =A0 =A0 =A0 =A0 rn_Off =3D -1064819065, rn_L =3D 0x1030000, rn_R =3D 0x=
 0}}}, {rn_mklist =3D 0x0, rn_parent =3D 0x4, rn_bit =3D -18048, rn_bmask =
 =3D -94 &#39;?&#39;,=A0</div></div><div class=3D"gmail_extra"><div class=3D=
 "gmail_extra">=A0 =A0 =A0 rn_flags =3D 195 &#39;?&#39;, rn_u =3D {rn_leaf =
 =3D {rn_Key =3D 0xc3a545e0 &quot;&quot;, rn_Mask =3D 0xc3a4e440 &quot; ??(?=
 ??\020&#39;&quot;, rn_Dupedkey =3D 0xc3a4e880},=A0</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 =A0 =A0=
  rn_node =3D {rn_Off =3D -1012578848, rn_L =3D 0xc3a4e440, rn_R =3D 0xc3a4e=
 880}}}}, rt_gateway =3D 0x74756873, rt_flags =3D 1853321060,=A0</div></div>=
 <div class=3D"gmail_extra">
 <div class=3D"gmail_extra">=A0 rt_refcnt =3D 1936683103, rt_ifp =3D 0x79735=
 f74, rt_ifa =3D 0x636e, rt_rmx =3D {rmx_mtu =3D 0, rmx_expire =3D 0, rmx_pk=
 sent =3D 0, rmx_weight =3D 0},=A0</div></div><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra">
 =A0 rt_fibnum =3D 0, rt_mtx =3D {lock_object =3D {lo_name =3D 0x0, lo_flags=
  =3D 0, lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 0}}</div></div></b=
 lockquote><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div><=
 div class=3D"gmail_extra">
 <br></div><div class=3D"gmail_extra">rn_Key with value of =93shutdown_post_=
 sync=94 ?</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_ext=
 ra">It=92s visible also in the raw_usend() frame:</div><div class=3D"gmail_=
 extra"><br>
 </div></div><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) fr 5</div></d=
 iv><div class=3D"gmail_extra"><div class=3D"gmail_extra">#5 =A00xc06de18f i=
 n raw_usend (so=3D&lt;value optimized out&gt;, flags=3D0, m=3D&lt;value opt=
 imized out&gt;, nam=3D0x0, control=3D&lt;value optimized out&gt;,=A0</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 td=3D0x=
 c3bd2000) at /usr/src/sys/net/raw_usrreq.c:238</div></div><div class=3D"gma=
 il_extra"><div class=3D"gmail_extra">238<span class=3D"" style=3D"white-spa=
 ce:pre">		</span>return ((*so-&gt;so_proto-&gt;pr_output)(m, so));</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) print *m=
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">$2 =3D {m=
 _hdr =3D {mh_next =3D 0xc3b4ab30, mh_nextpkt =3D 0x1, mh_data =3D 0x0, mh_l=
 en =3D -1064819065, mh_type =3D 0, mh_flags =3D 66304, mh_pad =3D 0},=A0</d=
 iv>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 M_dat =3D {=
 MH =3D {MH_pkthdr =3D {rcvif =3D 0x0, tags =3D {slh_first =3D 0x4}, len =3D=
  -1012745856, flowid =3D 3282388448,=A0</div></div><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra">
 =A0 =A0 =A0 =A0 csum_flags =3D 14097648373312316480, fibnum =3D 26739, cosq=
 os =3D 117 &#39;u&#39;, rsstype =3D 116 &#39;t&#39;, l2hlen =3D 100 &#39;d&=
 #39;, l3hlen =3D 111 &#39;o&#39;,=A0</div></div><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">
 =A0 =A0 =A0 =A0 l4hlen =3D 119 &#39;w&#39;, l5hlen =3D 110 &#39;n&#39;, PH_=
 per =3D {eigth =3D &quot;_post_sy&quot;, sixteen =3D {28767, 29551, 24436, =
 31091}, thirtytwo =3D {1936683103,=A0</div></div><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra">
 =A0 =A0 =A0 =A0 =A0 =A0 2037604212}, sixtyfour =3D {8751443454668533855}, u=
 nintptr =3D {1936683103}, ptr =3D 0x736f705f}, PH_loc =3D {</div></div><div=
  class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 =A0 =A0 =A0 eigth=
  =3D &quot;nc\000\000\000\000\000&quot;, sixteen =3D {25454, 0, 0, 0}, thir=
 tytwo =3D {25454, 0}, sixtyfour =3D {25454}, unintptr =3D {25454},=A0</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 =A0 =A0=
  =A0 ptr =3D 0x636e}}, MH_dat =3D {MH_ext =3D {ref_cnt =3D 0x0, ext_buf =3D=
  0x0, ext_size =3D 0, ext_type =3D 0, ext_flags =3D 0, ext_free =3D 0,=A0</=
 div></div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">=A0 =A0 =A0 =A0 =A0 ext_arg1 =3D 0x0, ext_arg2 =
 =3D 0x0},=A0</div></div><div class=3D"gmail_extra"><div class=3D"gmail_extr=
 a">=A0 =A0 =A0 =A0 MH_databuf =3D &#39;\0&#39; &lt;repeats 56 times&gt;, &q=
 uot;file&quot;, &#39;\0&#39; &lt;repeats 20 times&gt;, &quot;\006\000\000\0=
 00\020\000\000\000??\215?\000\000C\001\000\000\000\000\000\000\000\000\004\=
 000\000\000\000\000\000\00000Y?&quot;, &#39;\0&#39; &lt;repeats 12 times&gt=
 ;, &quot;`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000=
 \203??\000\000\000\000\000???&quot;, &#39;\0&#39; &lt;repeats 23 times&gt;}=
 },=A0</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 M_datab=
 uf =3D &quot;\000\000\000\000\004\000\000\000\200????E??@??\200??shutdown_p=
 ost_sync&quot;, &#39;\0&#39; &lt;repeats 62 times&gt;, &quot;file&quot;, &#=
 39;\0&#39; &lt;repeats 20 times&gt;, &quot;\006\000\000\000\020\000\000\000=
 ??\215?\000\000C\001\000\000\000\000\000\000\000\000\004\000\000\000\000\00=
 0\000\00000Y?&quot;, &#39;\0&#39; &lt;repeats 12 times&gt;, &quot;`2Y?\000\=
 000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203??\000\000\000=
 \000\000???&quot;, &#39;\0&#39; &lt;repeats 23 times&gt;}}</div>
 </div></blockquote><div class=3D"gmail_extra"><div class=3D"gmail_extra"><b=
 r></div><div class=3D"gmail_extra">This is 10.0-PRERELEASE r259547M (with a=
 pplied the recent nd6_nbr.c rtfree patch, which I =A0thought earlier might =
 be the cause of the panics I&#39;m seeing).</div>
 <div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">The machine=
  is Soekris Net5501-70 with this kernel config :</div><div class=3D"gmail_e=
 xtra"><br></div></div><blockquote style=3D"margin:0 0 0 40px;border:none;pa=
 dding:0px">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">cpu<span class=3D"" style=3D"white-space:pre">		</span>I586_CPU</div>=
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">
 cpu<span class=3D"" style=3D"white-space:pre">		</span>I686_CPU</div></div>=
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">ident<span class=3D"" style=3D"white-space:pre">		</span>MARS</=
 div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span class=3D"" style=3D"white-space:pre">	</span>CPU_=
 GEODE</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra=
 "><div class=3D"gmail_extra">
 options =A0 =A0 CPU_SOEKRIS</div></div></div><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div><d=
 iv class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_ext=
 ra">options<span class=3D"" style=3D"white-space:pre">		</span>HZ=3D2000</d=
 iv>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options<span class=3D"" style=3D"white-space:pre">		</spa=
 n>DEVICE_POLLING</div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra">
 <div class=3D"gmail_extra">options<span class=3D"" style=3D"white-space:pre=
 ">		</span>BPF_JITTER</div></div></div><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div><div cla=
 ss=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">makeoptions<span clas=
 s=3D"" style=3D"white-space:pre">	</span>DEBUG=3D-g<span class=3D"" style=
 =3D"white-space:pre">		</span># Build kernel with gdb(1) debug symbols</div=
 ></div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra"><br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra"><div class=3D"gmail_extra">options <span class=3D"" style=3D"white-s=
 pace:pre">	</span>SCHED_ULE<span class=3D"" style=3D"white-space:pre">		</s=
 pan># ULE scheduler</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>PREEMPTION<span class=3D"" style=3D"white-space:pre">		</span># Enable ke=
 rnel thread preemption</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>INET<span class=3D"" style=3D"white-space:pre">			</span># InterNETworkin=
 g</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span class=3D"" style=3D"white-space:pre">	</span>INET=
 6<span class=3D"" style=3D"white-space:pre">			</span># IPv6 communications=
  protocols</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>TCP_OFFLOAD<span class=3D"" style=3D"white-space:pre">		</span># TCP offl=
 oad</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span class=3D"" style=3D"white-space:pre">	</span>FFS<=
 span class=3D"" style=3D"white-space:pre">			</span># Berkeley Fast Filesys=
 tem</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span class=3D"" style=3D"white-space:pre">	</span>SOFT=
 UPDATES<span class=3D"" style=3D"white-space:pre">		</span># Enable FFS sof=
 t updates support</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>UFS_DIRHASH<span class=3D"" style=3D"white-space:pre">		</span># Improve =
 performance on big directories</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>PROCFS<span class=3D"" style=3D"white-space:pre">			</span># Process file=
 system (requires PSEUDOFS)</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>PSEUDOFS<span class=3D"" style=3D"white-space:pre">		</span># Pseudo-file=
 system framework</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>GEOM_PART_GPT<span class=3D"" style=3D"white-space:pre">		</span># GUID P=
 artition Tables.</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>GEOM_LABEL<span class=3D"" style=3D"white-space:pre">		</span># Provides =
 labelization</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>COMPAT_FREEBSD4<span class=3D"" style=3D"white-space:pre">		</span># Comp=
 atible with FreeBSD4</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>COMPAT_FREEBSD5<span class=3D"" style=3D"white-space:pre">		</span># Comp=
 atible with FreeBSD5</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>COMPAT_FREEBSD6<span class=3D"" style=3D"white-space:pre">		</span># Comp=
 atible with FreeBSD6</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>COMPAT_FREEBSD7<span class=3D"" style=3D"white-space:pre">		</span># Comp=
 atible with FreeBSD7</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>SCSI_DELAY=3D500<span class=3D"" style=3D"white-space:pre">		</span># Del=
 ay (in ms) before probing SCSI</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>KTRACE<span class=3D"" style=3D"white-space:pre">			</span># ktrace(1) su=
 pport</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>STACK<span class=3D"" style=3D"white-space:pre">			</span># stack(9) supp=
 ort</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span class=3D"" style=3D"white-space:pre">	</span>SYSV=
 SHM<span class=3D"" style=3D"white-space:pre">			</span># SYSV-style shared=
  memory</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>SYSVMSG<span class=3D"" style=3D"white-space:pre">			</span># SYSV-style =
 message queues</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>SYSVSEM<span class=3D"" style=3D"white-space:pre">			</span># SYSV-style =
 semaphores</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions</div></=
 div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">options <span class=3D"" style=3D"white-space:pre">	</span>PRINTF_BUF=
 R_SIZE=3D128<span class=3D"" style=3D"white-space:pre">	</span># Prevent pr=
 intf output being interspersed.</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>KBD_INSTALL_CDEV<span class=3D"" style=3D"white-space:pre">	</span># inst=
 all a CDEV entry in /dev</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>HWPMC_HOOKS<span class=3D"" style=3D"white-space:pre">		</span># Necessar=
 y kernel hooks for hwpmc(4)</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>CAPABILITY_MODE<span class=3D"" style=3D"white-space:pre">		</span># Caps=
 icum capability mode</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>CAPABILITIES<span class=3D"" style=3D"white-space:pre">		</span># Capsicu=
 m capabilities</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>PROCDESC<span class=3D"" style=3D"white-space:pre">		</span># Support for=
  process descriptors</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>INCLUDE_CONFIG_FILE =A0 =A0 # Include this file in kernel</div></div></di=
 v><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra"># Debugging support. =A0Always need this:</div></div></div><div clas=
 s=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options <span class=
 =3D"" style=3D"white-space:pre">	</span>KDB<span class=3D"" style=3D"white-=
 space:pre">			</span># Enable kernel debugger support.</div></div></div><di=
 v class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options <span class=
 =3D"" style=3D"white-space:pre">	</span>KDB_TRACE<span class=3D"" style=3D"=
 white-space:pre">		</span># Print a stack trace for a panic.</div></div></d=
 iv><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options<span class=3D=
 "" style=3D"white-space:pre">		</span>KDB_UNATTENDED</div></div></div><div =
 class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><br></div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options<span class=3D"" style=3D"white-space:pre">		</spa=
 n>TEXTDUMP_PREFERRED</div></div></div><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra">options<span class=3D"" style=3D"white-space:pre=
 ">		</span>TEXTDUMP_VERBOSE</div></div></div><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div><d=
 iv class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>pci</div></div></div><div class=3D"gma=
 il_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span=
  class=3D"" style=3D"white-space:pre">		</span>ata<span class=3D"" style=3D=
 "white-space:pre">		</span># Legacy ATA/SATA controllers</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pre">	</spa=
 n>ATA_STATIC_ID<span class=3D"" style=3D"white-space:pre">	</span># Static =
 device numbering</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"># ATA/SCSI peripherals</div><=
 /div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">device<span class=3D"" style=3D"white-space:pre">		</span>scbus<span =
 class=3D"" style=3D"white-space:pre">		</span># SCSI bus (required for ATA/=
 SCSI)</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre">		</span=
 >da<span class=3D"" style=3D"white-space:pre">		</span># Direct Access (dis=
 ks)</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">device<span class=3D"" style=3D"white-space:pre">		</span>pass<=
 span class=3D"" style=3D"white-space:pre">		</span># Passthrough device (di=
 rect ATA/SCSI access)</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"># Add suspend/resume support =
 for the i8254.</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre">		</span=
 >pmtimer</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_ex=
 tra"><div class=3D"gmail_extra">
 <br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra"># Serial (COM) ports</div></div></div><div clas=
 s=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">dev=
 ice<span class=3D"" style=3D"white-space:pre">		</span>uart<span class=3D""=
  style=3D"white-space:pre">		</span># Generic UART driver</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"" style=
 =3D"white-space:pre">		</span>miibus<span class=3D"" style=3D"white-space:p=
 re">		</span># MII bus support</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre">		</span=
 >vr<span class=3D"" style=3D"white-space:pre">		</span># VIA Rhine, Rhine I=
 I</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra"><br></div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra"># Wireless NIC cards</div></div></d=
 iv><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>wlan<span class=3D"" style=3D"white-sp=
 ace:pre">		</span># 802.11 support</div></div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pr=
 e">	</span>IEEE80211_DEBUG<span class=3D"" style=3D"white-space:pre">	</spa=
 n># enable debug msgs</div></div></div><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">
 <div class=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pr=
 e">	</span>IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q&#39;s</div><=
 /div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra">
 options <span class=3D"" style=3D"white-space:pre">	</span>IEEE80211_SUPPOR=
 T_MESH<span class=3D"" style=3D"white-space:pre">	</span># enable 802.11s d=
 raft support</div></div></div><div class=3D"gmail_extra"><div class=3D"gmai=
 l_extra">
 <div class=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre"=
 >		</span>wlan_wep<span class=3D"" style=3D"white-space:pre">	</span># 802.=
 11 WEP support</div></div></div><div class=3D"gmail_extra"><div class=3D"gm=
 ail_extra">
 <div class=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre"=
 >		</span>wlan_ccmp<span class=3D"" style=3D"white-space:pre">	</span># 802=
 .11 CCMP support</div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra">
 <div class=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre"=
 >		</span>wlan_tkip<span class=3D"" style=3D"white-space:pre">	</span># 802=
 .11 TKIP support</div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra">
 <div class=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre"=
 >		</span>wlan_amrr<span class=3D"" style=3D"white-space:pre">	</span># AMR=
 R transmit rate control algorithm</div></div></div><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre"=
 >		</span>ath<span class=3D"" style=3D"white-space:pre">		</span># Atheros =
 NICs</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra">
 device<span class=3D"" style=3D"white-space:pre">		</span>ath_pci<span clas=
 s=3D"" style=3D"white-space:pre">		</span># Atheros pci/cardbus glue</div><=
 /div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra">
 device<span class=3D"" style=3D"white-space:pre">		</span>ath_hal<span clas=
 s=3D"" style=3D"white-space:pre">		</span># pci/cardbus chip support</div><=
 /div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra">
 options <span class=3D"" style=3D"white-space:pre">	</span>AH_SUPPORT_AR541=
 6<span class=3D"" style=3D"white-space:pre">	</span># enable AR5416 tx/rx d=
 escriptors</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra"><div class=3D"gmail_extra">
 options <span class=3D"" style=3D"white-space:pre">	</span>AH_AR5416_INTERR=
 UPT_MITIGATION<span class=3D"" style=3D"white-space:pre">	</span># AR5416 i=
 nterrupt mitigation</div></div></div><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra">options <span class=3D"" style=3D"white-space:pr=
 e">	</span>ATH_ENABLE_11N<span class=3D"" style=3D"white-space:pre">	</span=
 ># Enable 802.11n support for AR5416 and later</div></div></div><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>ath_rate_sample<span class=3D"" style=
 =3D"white-space:pre">	</span># SampleRate tx rate control for ath</div></di=
 v></div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra"># Pseudo devices.</div></div></div><div class=3D"gmail_extra"><div c=
 lass=3D"gmail_extra">
 <div class=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre"=
 >		</span>loop<span class=3D"" style=3D"white-space:pre">		</span># Network=
  loopback</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra"><div class=3D"gmail_extra">
 device<span class=3D"" style=3D"white-space:pre">		</span>random<span class=
 =3D"" style=3D"white-space:pre">		</span># Entropy device</div></div></div>=
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">device<span class=3D"" style=3D"white-space:pre">		</span>ether<span =
 class=3D"" style=3D"white-space:pre">		</span># Ethernet support</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre">		</span=
 >vlan<span class=3D"" style=3D"white-space:pre">		</span># 802.1Q VLAN supp=
 ort</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">device<span class=3D"" style=3D"white-space:pre">		</span>tun<s=
 pan class=3D"" style=3D"white-space:pre">		</span># Packet tunnel.</div></d=
 iv></div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>md<span class=3D"" style=3D"white-spac=
 e:pre">		</span># Memory &quot;disks&quot;</div></div></div><div class=3D"g=
 mail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>gif<span class=3D"" style=3D"white-spa=
 ce:pre">		</span># IPv6 and IPv4 tunneling</div></div></div><div class=3D"g=
 mail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device =A0 =A0 =A0gre=
 </div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre">		=
 </span>faith<span class=3D"" style=3D"white-space:pre">		</span># IPv6-to-I=
 Pv4 relaying (translation)</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span class=3D"" style=3D"white-space:pre">		</span=
 >firmware<span class=3D"" style=3D"white-space:pre">	</span># firmware assi=
 st module</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device =A0 =A0 =A0if_bridge</div></div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br>=
 </div></div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">options =A0 =A0 VIMAGE</div></div></div><div class=3D"gmail_extra"><d=
 iv class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 ROUTETA=
 BLES=3D8</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options =A0 =A0 RADIX_MPATH</div></div></div><div class=3D"gmai=
 l_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></=
 div></div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 SW_WA=
 TCHDOG</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">device =A0 =A0 =A0crypto</div></div></div><div c=
 lass=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">=
 device =A0 =A0 =A0cryptodev</div></div></div><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra">
 <div class=3D"gmail_extra">device =A0 =A0 =A0glxsb</div></div></div><div cl=
 ass=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"><=
 br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">
 options =A0 =A0 BOOTVERBOSE=3D1</div></div></div><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></di=
 v><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail=
 _extra">#device =A0 =A0 =A0pf</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">#device =A0 =A0 =A0pflog</div></div></div><div class=3D"g=
 mail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">#device =
 =A0 =A0 =A0pfsync</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device =A0 =A0 =A0 carp</div></div></div><div class=3D"gm=
 ail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">device =A0=
  =A0 =A0 enc</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">device =A0 =A0 =A0 lagg</div></div></div><div class=3D"gmail_ex=
 tra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">device =A0 =A0 =
 =A0 epair</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra"><br></div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ</div></div></=
 div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ=
 _CBQ</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra">#options =A0 =A0 ALTQ_RED</div></div></div><div=
  class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ=
 _RIO</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra">#options =A0 =A0 ALTQ_HFSC</div></div></div><di=
 v class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ=
 _PRIQ</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra=
 "><div class=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">options =A0 =A0 IPFIREWALL</div></div></div><div=
  class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra=
 ">options =A0 =A0 IPFIREWALL_DEFAULT_TO_ACCEPT</div></div></div><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 IPFIR=
 EWALL_NAT</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra"><div class=3D"gmail_extra">options =A0 =A0 LIBALIAS</div></div></div>=
 <div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 IPDIV=
 ERT</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">options =A0 =A0 DUMMYNET</div></div></div><div c=
 lass=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra">device<span class=3D"" style=3D"white-space:pre">		</span>bpf<span c=
 lass=3D"" style=3D"white-space:pre">		</span># Berkeley packet filter</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"># USB support</div></div></di=
 v><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options <span class=
 =3D"" style=3D"white-space:pre">	</span>USB_DEBUG<span class=3D"" style=3D"=
 white-space:pre">	</span># enable debug msgs</div></div></div><div class=3D=
 "gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>uhci<span class=3D"" style=3D"white-sp=
 ace:pre">		</span># UHCI PCI-&gt;USB interface</div></div></div><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>ohci<span class=3D"" style=3D"white-sp=
 ace:pre">		</span># OHCI PCI-&gt;USB interface</div></div></div><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>ehci<span class=3D"" style=3D"white-sp=
 ace:pre">		</span># EHCI PCI-&gt;USB interface (USB 2.0)</div></div></div><=
 div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>usb =A0 =A0 <span class=3D"" style=3D"=
 white-space:pre">	</span># USB Bus (required)</div></div></div><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span class=3D"=
 " style=3D"white-space:pre">		</span>umass<span class=3D"" style=3D"white-s=
 pace:pre">		</span># Disks/Mass storage - Requires scbus and da</div></div>=
 </div></blockquote>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div><br></div><div>A=
 lso src.conf and make.conf :</div><div><div><br></div></div></div></div><bl=
 ockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div class=3D"=
 gmail_extra">
 <div class=3D"gmail_extra"><div><div>root@vpn_vrf:[VNET(x)]:/usr/src/sys # =
 cat /etc/src.conf=A0</div></div></div></div><div class=3D"gmail_extra"><div=
  class=3D"gmail_extra"><div>WITHOUT_ACCT=3Dyes</div></div></div><div class=
 =3D"gmail_extra">
 <div class=3D"gmail_extra"><div>WITHOUT_ACPI=3Dyes</div></div></div><div cl=
 ass=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_AMD=3Dyes</div>=
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_APM=3Dyes</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_ASSERT_DEBUG=3Dyes</div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div>WITHOUT_AT=3Dyes</div></div></div><div class=3D"gma=
 il_extra">
 <div class=3D"gmail_extra"><div>WITHOUT_ATF=3Dyes</div></div></div><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_ATM=3Dyes</div><=
 /div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHO=
 UT_AUDIT=3Dyes</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_BLUETOOTH=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra"><div>WITHOUT_CALENDAR=3Dyes</div></div></div><div class=3D=
 "gmail_extra">
 <div class=3D"gmail_extra"><div>WITHOUT_CDDL=3Dyes</div></div></div><div cl=
 ass=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_CTM=3Dyes</div>=
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_DICT=3Dyes</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_FLOPPY=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra"><div>WITHOUT_GAMES=3Dyes</div></div></div><div class=3D"gmail_=
 extra"><div class=3D"gmail_extra">
 <div>WITHOUT_HTML=3Dyes</div></div></div><div class=3D"gmail_extra"><div cl=
 ass=3D"gmail_extra"><div>WITHOUT_INFO=3Dyes</div></div></div><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_IPFILTER=3Dyes</div></=
 div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_IPX=3Dye=
 s</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><d=
 iv>#WITHOUT_KERNEL_SYMBOLS=3Dyes</div></div></div><div class=3D"gmail_extra=
 "><div class=3D"gmail_extra">
 <div>WITHOUT_LEGACY_CONSOLE=3Dyes</div></div></div><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra"><div>WITHOUT_LOCALES=3Dyes</div></div></div><=
 div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_LPR=3Dyes=
 </div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_MA=
 IL=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_ex=
 tra"><div>WITHOUT_NDIS=3Dyes</div></div></div><div class=3D"gmail_extra"><d=
 iv class=3D"gmail_extra">
 <div>WITHOUT_QUOTAS=3Dyes</div></div></div><div class=3D"gmail_extra"><div =
 class=3D"gmail_extra"><div>WITHOUT_ROUTED=3Dyes</div></div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_SENDMAIL=3Dyes</di=
 v></div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH_SVN=3Dyes</=
 div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>=
 WITHOUT_ZFS=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=3D=
 "gmail_extra">
 <div><br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra"><div>root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/make.conf</div></=
 div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>CFLAGS=
 =3D-O2</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>COPT=
 FLAGS=3D -O -pipe</div></div></div><div class=3D"gmail_extra"><div class=3D=
 "gmail_extra"><div>CPUTYPE=3Dgeode</div></div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra">
 <div>KERNCONF=3DMARS</div></div></div><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra"><div>NO_MODULES=3Dyes</div></div></div><div class=3D"gmail=
 _extra"><div class=3D"gmail_extra"><div>BOOTWAIT=3D0</div></div></div><div =
 class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div>DOC_LANG=3Den_US.ISO8859-1</div></div></div=
 ></blockquote><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></d=
 iv><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">--Nikola=
 y</div><div class=3D"gmail_extra">
 <br></div></div></div>
 
 --001a11c3d860640c3f04eee868e9--

From: Nikolay Denev <ndenev@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org, 
	"freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Cc:  
Subject: Re: misc/185092: panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
Date: Wed, 1 Jan 2014 13:21:13 +0000

 --001a11c1ba200f4f8504eee88df5
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable
 
 On Wed, Jan 1, 2014 at 1:10 PM, Nikolay Denev <ndenev@gmail.com> wrote:
 
 > On Sun, Dec 22, 2013 at 1:10 PM, <FreeBSD-gnats-submit@freebsd.org> wrote=
 :
 >
 >> Thank you very much for your problem report.
 >> It has the internal identification `misc/185092'.
 >> The individual assigned to look at your
 >> report is: freebsd-bugs.
 >>
 >> You can access the state of your problem report at any time
 >> via this link:
 >>
 >> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092
 >>
 >> >Category:       misc
 >> >Responsible:    freebsd-bugs
 >> >Synopsis:       panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
 >> >Arrival-Date:   Sun Dec 22 13:10:00 UTC 2013
 >>
 >
 > I'm trying to understand exactly what is happening here, and examining a
 > core dump with kgdb I'm getting some output that confuses me :
 >
 > (kgdb) bt
 > #0  doadump (textdump=3D-1011569920) at pcpu.h:233
 > #1  0xc06069b2 in kern_reboot (howto=3D260) at
 > /usr/src/sys/kern/kern_shutdown.c:447
 > #2  0xc0606d0e in panic (fmt=3D<value optimized out>) at
 > /usr/src/sys/kern/kern_shutdown.c:754
 > #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 > /usr/src/sys/net/route.c:464
 > #4  0xc06e188d in route_output (m=3D<value optimized out>) at
 > /usr/src/sys/net/rtsock.c:951
 > #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=3D<=
 value
 > optimized out>, nam=3D0x0, control=3D<value optimized out>,
 >     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 > #6  0xc066eca9 in sosend_generic (so=3D0xc3e9c1a8, uio=3D<value optimized
 > out>, top=3D<value optimized out>, control=3D0x0,
 >     flags=3D<value optimized out>, td=3D<value optimized out>) at
 > /usr/src/sys/kern/uipc_socket.c:1271
 > #7  0xc066efc7 in sosend (so=3D0xc3e9c1a8, addr=3D0x0, uio=3D0xd9b9cc10,
 > top=3D0x0, control=3D0x0, flags=3D0, td=3D0xc3bd2000)
 >     at /usr/src/sys/kern/uipc_socket.c:1315
 > #8  0xc0654af4 in soo_write (fp=3D0xc3c0c818, uio=3D0xd9b9cc10,
 > active_cred=3D0xc3f1dd00, flags=3D0, td=3D0xc3bd2000)
 >     at /usr/src/sys/kern/sys_socket.c:103
 > #9  0xc064c866 in dofilewrite (td=3D0xc3bd2000, fd=3D3, fp=3D0xc3c0c818,
 > auio=3D0xd9b9cc10, offset=3D-1, flags=3D0) at file.h:303
 > #10 0xc064c566 in kern_writev (td=3D0xc3bd2000, fd=3D3, auio=3D<value opt=
 imized
 > out>) at /usr/src/sys/kern/sys_generic.c:467
 > #11 0xc064c4bc in sys_write (td=3D<value optimized out>, uap=3D<value
 > optimized out>) at /usr/src/sys/kern/sys_generic.c:382
 > #12 0xc08614d3 in syscall (frame=3D<value optimized out>) at
 > subr_syscall.c:134
 > #13 0xc084cca1 in Xint0x80_syscall () at
 > /usr/src/sys/i386/i386/exception.s:270
 > #14 0x281975b7 in ?? ()
 > Previous frame inner to this frame (corrupt stack?)
 > Current language:  auto; currently minimal
 > (kgdb) fr 3
 > #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 > /usr/src/sys/net/route.c:464
 > 464 panic("rtfree 2");
 > (kgdb) print *rt
 > $1 =3D {rt_nodes =3D {{rn_mklist =3D 0xc3b4ab30, rn_parent =3D 0x1, rn_bi=
 t =3D 0,
 > rn_bmask =3D 0 '\0', rn_flags =3D 0 '\0', rn_u =3D {rn_leaf =3D {
 >           rn_Key =3D 0xc0882687 "shutdown_post_sync", rn_Mask =3D 0x10300=
 00
 > <Address 0x1030000 out of bounds>, rn_Dupedkey =3D 0x0}, rn_node =3D {
 >           rn_Off =3D -1064819065, rn_L =3D 0x1030000, rn_R =3D 0x0}}},
 > {rn_mklist =3D 0x0, rn_parent =3D 0x4, rn_bit =3D -18048, rn_bmask =3D -9=
 4 '?',
 >       rn_flags =3D 195 '?', rn_u =3D {rn_leaf =3D {rn_Key =3D 0xc3a545e0 =
 "",
 > rn_Mask =3D 0xc3a4e440 " ??(???\020'", rn_Dupedkey =3D 0xc3a4e880},
 >         rn_node =3D {rn_Off =3D -1012578848, rn_L =3D 0xc3a4e440, rn_R =
 =3D
 > 0xc3a4e880}}}}, rt_gateway =3D 0x74756873, rt_flags =3D 1853321060,
 >   rt_refcnt =3D 1936683103, rt_ifp =3D 0x79735f74, rt_ifa =3D 0x636e, rt_=
 rmx =3D
 > {rmx_mtu =3D 0, rmx_expire =3D 0, rmx_pksent =3D 0, rmx_weight =3D 0},
 >   rt_fibnum =3D 0, rt_mtx =3D {lock_object =3D {lo_name =3D 0x0, lo_flags=
  =3D 0,
 > lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 0}}
 >
 >
 >
 > rn_Key with value of =93shutdown_post_sync=94 ?
 >
 > It=92s visible also in the raw_usend() frame:
 >
 > (kgdb) fr 5
 > #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=3D<=
 value
 > optimized out>, nam=3D0x0, control=3D<value optimized out>,
 >     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 > 238 return ((*so->so_proto->pr_output)(m, so));
 > (kgdb) print *m
 > $2 =3D {m_hdr =3D {mh_next =3D 0xc3b4ab30, mh_nextpkt =3D 0x1, mh_data =
 =3D 0x0,
 > mh_len =3D -1064819065, mh_type =3D 0, mh_flags =3D 66304, mh_pad =3D 0},
 >   M_dat =3D {MH =3D {MH_pkthdr =3D {rcvif =3D 0x0, tags =3D {slh_first =
 =3D 0x4}, len =3D
 > -1012745856, flowid =3D 3282388448,
 >         csum_flags =3D 14097648373312316480, fibnum =3D 26739, cosqos =3D=
  117
 > 'u', rsstype =3D 116 't', l2hlen =3D 100 'd', l3hlen =3D 111 'o',
 >         l4hlen =3D 119 'w', l5hlen =3D 110 'n', PH_per =3D {eigth =3D "_p=
 ost_sy",
 > sixteen =3D {28767, 29551, 24436, 31091}, thirtytwo =3D {1936683103,
 >             2037604212}, sixtyfour =3D {8751443454668533855}, unintptr =
 =3D
 > {1936683103}, ptr =3D 0x736f705f}, PH_loc =3D {
 >           eigth =3D "nc\000\000\000\000\000", sixteen =3D {25454, 0, 0, 0=
 },
 > thirtytwo =3D {25454, 0}, sixtyfour =3D {25454}, unintptr =3D {25454},
 >           ptr =3D 0x636e}}, MH_dat =3D {MH_ext =3D {ref_cnt =3D 0x0, ext_=
 buf =3D
 > 0x0, ext_size =3D 0, ext_type =3D 0, ext_flags =3D 0, ext_free =3D 0,
 >           ext_arg1 =3D 0x0, ext_arg2 =3D 0x0},
 >         MH_databuf =3D '\0' <repeats 56 times>, "file", '\0' <repeats 20
 > times>,
 > "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\000=
 \000\000\000\004\000\000\000\000\000\000\00000Y?",
 > '\0' <repeats 12 times>,
 > "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203??=
 \000\000\000\000\000???",
 > '\0' <repeats 23 times>}},
 >     M_databuf =3D
 > "\000\000\000\000\004\000\000\000\200????E??@??\200??shutdown_post_sync",
 > '\0' <repeats 62 times>, "file", '\0' <repeats 20 times>,
 > "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\000=
 \000\000\000\004\000\000\000\000\000\000\00000Y?",
 > '\0' <repeats 12 times>,
 > "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203??=
 \000\000\000\000\000???",
 > '\0' <repeats 23 times>}}
 >
 >
 > This is 10.0-PRERELEASE r259547M (with applied the recent nd6_nbr.c rtfre=
 e
 > patch, which I  thought earlier might be the cause of the panics I'm
 > seeing).
 >
 > The machine is Soekris Net5501-70 with this kernel config :
 >
 > cpu I586_CPU
 > cpu I686_CPU
 > ident MARS
 > options CPU_GEODE
 > options     CPU_SOEKRIS
 >
 > options HZ=3D2000
 > options DEVICE_POLLING
 > options BPF_JITTER
 >
 > makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols
 >
 > options SCHED_ULE # ULE scheduler
 > options PREEMPTION # Enable kernel thread preemption
 > options INET # InterNETworking
 > options INET6 # IPv6 communications protocols
 > options TCP_OFFLOAD # TCP offload
 > options FFS # Berkeley Fast Filesystem
 > options SOFTUPDATES # Enable FFS soft updates support
 > options UFS_DIRHASH # Improve performance on big directories
 > options PROCFS # Process filesystem (requires PSEUDOFS)
 > options PSEUDOFS # Pseudo-filesystem framework
 > options GEOM_PART_GPT # GUID Partition Tables.
 > options GEOM_LABEL # Provides labelization
 > options COMPAT_FREEBSD4 # Compatible with FreeBSD4
 > options COMPAT_FREEBSD5 # Compatible with FreeBSD5
 > options COMPAT_FREEBSD6 # Compatible with FreeBSD6
 > options COMPAT_FREEBSD7 # Compatible with FreeBSD7
 > options SCSI_DELAY=3D500 # Delay (in ms) before probing SCSI
 > options KTRACE # ktrace(1) support
 > options STACK # stack(9) support
 > options SYSVSHM # SYSV-style shared memory
 > options SYSVMSG # SYSV-style message queues
 > options SYSVSEM # SYSV-style semaphores
 > options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 > options PRINTF_BUFR_SIZE=3D128 # Prevent printf output being interspersed=
 .
 > options KBD_INSTALL_CDEV # install a CDEV entry in /dev
 > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 > options CAPABILITY_MODE # Capsicum capability mode
 > options CAPABILITIES # Capsicum capabilities
 > options PROCDESC # Support for process descriptors
 > options INCLUDE_CONFIG_FILE     # Include this file in kernel
 >
 > # Debugging support.  Always need this:
 > options KDB # Enable kernel debugger support.
 > options KDB_TRACE # Print a stack trace for a panic.
 > options KDB_UNATTENDED
 >
 > options TEXTDUMP_PREFERRED
 > options TEXTDUMP_VERBOSE
 >
 > device pci
 > device ata # Legacy ATA/SATA controllers
 > options ATA_STATIC_ID # Static device numbering
 >
 > # ATA/SCSI peripherals
 > device scbus # SCSI bus (required for ATA/SCSI)
 > device da # Direct Access (disks)
 > device pass # Passthrough device (direct ATA/SCSI access)
 >
 > # Add suspend/resume support for the i8254.
 > device pmtimer
 >
 > # Serial (COM) ports
 > device uart # Generic UART driver
 >
 > device miibus # MII bus support
 > device vr # VIA Rhine, Rhine II
 >
 > # Wireless NIC cards
 > device wlan # 802.11 support
 > options IEEE80211_DEBUG # enable debug msgs
 > options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
 > options IEEE80211_SUPPORT_MESH # enable 802.11s draft support
 > device wlan_wep # 802.11 WEP support
 > device wlan_ccmp # 802.11 CCMP support
 > device wlan_tkip # 802.11 TKIP support
 > device wlan_amrr # AMRR transmit rate control algorithm
 > device ath # Atheros NICs
 > device ath_pci # Atheros pci/cardbus glue
 > device ath_hal # pci/cardbus chip support
 > options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
 > options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation
 > options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later
 > device ath_rate_sample # SampleRate tx rate control for ath
 >
 > # Pseudo devices.
 > device loop # Network loopback
 > device random # Entropy device
 > device ether # Ethernet support
 > device vlan # 802.1Q VLAN support
 > device tun # Packet tunnel.
 > device md # Memory "disks"
 > device gif # IPv6 and IPv4 tunneling
 > device      gre
 > device faith # IPv6-to-IPv4 relaying (translation)
 > device firmware # firmware assist module
 > device      if_bridge
 >
 > options     VIMAGE
 > options     ROUTETABLES=3D8
 > options     RADIX_MPATH
 >
 > options     SW_WATCHDOG
 >
 > device      crypto
 > device      cryptodev
 > device      glxsb
 >
 > options     BOOTVERBOSE=3D1
 >
 > #device      pf
 > #device      pflog
 > #device      pfsync
 > device       carp
 > device       enc
 > device       lagg
 > device       epair
 >
 > #options     ALTQ
 > #options     ALTQ_CBQ
 > #options     ALTQ_RED
 > #options     ALTQ_RIO
 > #options     ALTQ_HFSC
 > #options     ALTQ_PRIQ
 >
 > options     IPFIREWALL
 > options     IPFIREWALL_DEFAULT_TO_ACCEPT
 > options     IPFIREWALL_NAT
 > options     LIBALIAS
 > options     IPDIVERT
 > options     DUMMYNET
 >
 > device bpf # Berkeley packet filter
 >
 > # USB support
 > options USB_DEBUG # enable debug msgs
 > device uhci # UHCI PCI->USB interface
 > device ohci # OHCI PCI->USB interface
 > device ehci # EHCI PCI->USB interface (USB 2.0)
 > device usb     # USB Bus (required)
 > device umass # Disks/Mass storage - Requires scbus and da
 >
 >
 > Also src.conf and make.conf :
 >
 > root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/src.conf
 > WITHOUT_ACCT=3Dyes
 > WITHOUT_ACPI=3Dyes
 > WITHOUT_AMD=3Dyes
 > WITHOUT_APM=3Dyes
 > WITHOUT_ASSERT_DEBUG=3Dyes
 > WITHOUT_AT=3Dyes
 > WITHOUT_ATF=3Dyes
 > WITHOUT_ATM=3Dyes
 > WITHOUT_AUDIT=3Dyes
 > WITHOUT_BLUETOOTH=3Dyes
 > WITHOUT_CALENDAR=3Dyes
 > WITHOUT_CDDL=3Dyes
 > WITHOUT_CTM=3Dyes
 > WITHOUT_DICT=3Dyes
 > WITHOUT_FLOPPY=3Dyes
 > WITHOUT_GAMES=3Dyes
 > WITHOUT_HTML=3Dyes
 > WITHOUT_INFO=3Dyes
 > WITHOUT_IPFILTER=3Dyes
 > WITHOUT_IPX=3Dyes
 > #WITHOUT_KERNEL_SYMBOLS=3Dyes
 > WITHOUT_LEGACY_CONSOLE=3Dyes
 > WITHOUT_LOCALES=3Dyes
 > WITHOUT_LPR=3Dyes
 > WITHOUT_MAIL=3Dyes
 > WITHOUT_NDIS=3Dyes
 > WITHOUT_QUOTAS=3Dyes
 > WITHOUT_ROUTED=3Dyes
 > WITHOUT_SENDMAIL=3Dyes
 > WITH_SVN=3Dyes
 > WITHOUT_ZFS=3Dyes
 >
 > root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/make.conf
 > CFLAGS=3D-O2
 > COPTFLAGS=3D -O -pipe
 > CPUTYPE=3Dgeode
 > KERNCONF=3DMARS
 > NO_MODULES=3Dyes
 > BOOTWAIT=3D0
 > DOC_LANG=3Den_US.ISO8859-1
 >
 >
 >
 > --Nikolay
 >
 >
 Also, originally I thought that the panic is when a multi path route is
 being deleted, however again from the coredump it seems that the panic
 happens when openvpn deletes the host route it installs for the remote
 openvpn server pointed to the default gw (before openvpn installs the new
 default gw pointing to the vpn tunnel) :
 
 (kgdb) fr 12
 (kgdb) x/12sb td->td_proc->p_args
 0xc4269780:  "\001"
 0xc4269782:  ""
 0xc4269783:  ""
 0xc4269784:  "B"
 0xc4269786:  ""
 0xc4269787:  ""
 0xc4269788:  "/sbin/route"
 0xc4269794:  "delete"
 0xc426979b:  "-net"
 0xc42697a0:  "78.90.222.xxx"
 0xc42697ad:  "10.255.255.0"
 0xc42697ba:  "255.255.255.255"
 (kgdb)
 
 I'm trying to reproduce this on a VirtualBox instance now, however so far
 no luck (no OpenVPN running, just adding and removing routes).
 
 
 --Nikolay
 
 --001a11c1ba200f4f8504eee88df5
 Content-Type: text/html; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr">On Wed, Jan 1, 2014 at 1:10 PM, Nikolay Denev <span dir=3D=
 "ltr">&lt;<a href=3D"mailto:ndenev@gmail.com" target=3D"_blank">ndenev@gmai=
 l.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gma=
 il_quote">
 <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
 left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
 adding-left:1ex"><div dir=3D"ltr"><div><div class=3D"h5">On Sun, Dec 22, 20=
 13 at 1:10 PM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:FreeBSD-gnats-submi=
 t@freebsd.org" target=3D"_blank">FreeBSD-gnats-submit@freebsd.org</a>&gt;</=
 span> wrote:<br>
 <div class=3D"gmail_extra"><div class=3D"gmail_quote">
 <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
 left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
 adding-left:1ex">Thank you very much for your problem report.<br>
 It has the internal identification `misc/185092&#39;.<br>
 The individual assigned to look at your<br>
 report is: freebsd-bugs.<br>
 <br>
 You can access the state of your problem report at any time<br>
 via this link:<br>
 <br>
 <a href=3D"http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092" target=3D"_=
 blank">http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092</a><br>
 <br>
 &gt;Category: =A0 =A0 =A0 misc<br>
 &gt;Responsible: =A0 =A0freebsd-bugs<br>
 &gt;Synopsis: =A0 =A0 =A0 panic: rtfree 2 (using RADIX_MPATH in a VNET jail=
 )<br>
 &gt;Arrival-Date: =A0 Sun Dec 22 13:10:00 UTC 2013<br>
 </blockquote></div><br></div></div></div><div class=3D"gmail_extra">I&#39;m=
  trying to understand exactly what is happening here, and examining a core =
 dump with kgdb I&#39;m getting some output that confuses me :</div><div cla=
 ss=3D"gmail_extra">
 
 <br></div><blockquote style=3D"margin:0px 0px 0px 40px;border:none;padding:=
 0px"><div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) bt</div><=
 /div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#0 =A0doadump (t=
 extdump=3D-1011569920) at pcpu.h:233</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#1 =A00xc06069b=
 2 in kern_reboot (howto=3D260) at /usr/src/sys/kern/kern_shutdown.c:447</di=
 v></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#2 =A00xc0606=
 d0e in panic (fmt=3D&lt;value optimized out&gt;) at /usr/src/sys/kern/kern_=
 shutdown.c:754</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#3 =A00xc06de63=
 9 in rtfree (rt=3D&lt;value optimized out&gt;) at /usr/src/sys/net/route.c:=
 464</div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#4 =A0=
 0xc06e188d in route_output (m=3D&lt;value optimized out&gt;) at /usr/src/sy=
 s/net/rtsock.c:951</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#5 =A00xc06de18=
 f in raw_usend (so=3D&lt;value optimized out&gt;, flags=3D0, m=3D&lt;value =
 optimized out&gt;, nam=3D0x0, control=3D&lt;value optimized out&gt;,=A0</di=
 v></div><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra">=A0 =A0 td=3D0xc3bd2000) at /usr/src/sys/net/raw=
 _usrreq.c:238</div></div><div class=3D"gmail_extra"><div class=3D"gmail_ext=
 ra">#6 =A00xc066eca9 in sosend_generic (so=3D0xc3e9c1a8, uio=3D&lt;value op=
 timized out&gt;, top=3D&lt;value optimized out&gt;, control=3D0x0,=A0</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 flags=
 =3D&lt;value optimized out&gt;, td=3D&lt;value optimized out&gt;) at /usr/s=
 rc/sys/kern/uipc_socket.c:1271</div></div><div class=3D"gmail_extra"><div c=
 lass=3D"gmail_extra">
 
 #7 =A00xc066efc7 in sosend (so=3D0xc3e9c1a8, addr=3D0x0, uio=3D0xd9b9cc10, =
 top=3D0x0, control=3D0x0, flags=3D0, td=3D0xc3bd2000)</div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 at /usr/src/sys/kern/ui=
 pc_socket.c:1315</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#8 =A00xc0654af=
 4 in soo_write (fp=3D0xc3c0c818, uio=3D0xd9b9cc10, active_cred=3D0xc3f1dd00=
 , flags=3D0, td=3D0xc3bd2000)</div></div><div class=3D"gmail_extra"><div cl=
 ass=3D"gmail_extra">
 
 =A0 =A0 at /usr/src/sys/kern/sys_socket.c:103</div></div><div class=3D"gmai=
 l_extra"><div class=3D"gmail_extra">#9 =A00xc064c866 in dofilewrite (td=3D0=
 xc3bd2000, fd=3D3, fp=3D0xc3c0c818, auio=3D0xd9b9cc10, offset=3D-1, flags=
 =3D0) at file.h:303</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#10 0xc064c566 =
 in kern_writev (td=3D0xc3bd2000, fd=3D3, auio=3D&lt;value optimized out&gt;=
 ) at /usr/src/sys/kern/sys_generic.c:467</div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra">
 
 #11 0xc064c4bc in sys_write (td=3D&lt;value optimized out&gt;, uap=3D&lt;va=
 lue optimized out&gt;) at /usr/src/sys/kern/sys_generic.c:382</div></div><d=
 iv class=3D"gmail_extra"><div class=3D"gmail_extra">#12 0xc08614d3 in sysca=
 ll (frame=3D&lt;value optimized out&gt;) at subr_syscall.c:134</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#13 0xc084cca1 =
 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:270</div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra">#14 0x281975b7 in ??=
  ()</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">Previous frame =
 inner to this frame (corrupt stack?)</div></div><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">Current language: =A0auto; currently minimal</di=
 v></div>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) fr 3</div></di=
 v><div class=3D"gmail_extra"><div class=3D"gmail_extra">#3 =A00xc06de639 in=
  rtfree (rt=3D&lt;value optimized out&gt;) at /usr/src/sys/net/route.c:464<=
 /div></div>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">464<span style=3D"whi=
 te-space:pre-wrap">				</span>panic(&quot;rtfree 2&quot;);</div></div><div =
 class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) print *rt</div></di=
 v>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">$1 =3D {rt_nodes =3D =
 {{rn_mklist =3D 0xc3b4ab30, rn_parent =3D 0x1, rn_bit =3D 0, rn_bmask =3D 0=
  &#39;\0&#39;, rn_flags =3D 0 &#39;\0&#39;, rn_u =3D {rn_leaf =3D {</div></=
 div><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra">=A0 =A0 =A0 =A0 =A0 rn_Key =3D 0xc0882687 &quot;=
 shutdown_post_sync&quot;, rn_Mask =3D 0x1030000 &lt;Address 0x1030000 out o=
 f bounds&gt;, rn_Dupedkey =3D 0x0}, rn_node =3D {</div></div><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra">
 
 =A0 =A0 =A0 =A0 =A0 rn_Off =3D -1064819065, rn_L =3D 0x1030000, rn_R =3D 0x=
 0}}}, {rn_mklist =3D 0x0, rn_parent =3D 0x4, rn_bit =3D -18048, rn_bmask =
 =3D -94 &#39;?&#39;,=A0</div></div><div class=3D"gmail_extra"><div class=3D=
 "gmail_extra">=A0 =A0 =A0 rn_flags =3D 195 &#39;?&#39;, rn_u =3D {rn_leaf =
 =3D {rn_Key =3D 0xc3a545e0 &quot;&quot;, rn_Mask =3D 0xc3a4e440 &quot; ??(?=
 ??\020&#39;&quot;, rn_Dupedkey =3D 0xc3a4e880},=A0</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 =A0 =A0=
  rn_node =3D {rn_Off =3D -1012578848, rn_L =3D 0xc3a4e440, rn_R =3D 0xc3a4e=
 880}}}}, rt_gateway =3D 0x74756873, rt_flags =3D 1853321060,=A0</div></div>=
 <div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra">=A0 rt_refcnt =3D 1936683103, rt_ifp =3D 0x79735=
 f74, rt_ifa =3D 0x636e, rt_rmx =3D {rmx_mtu =3D 0, rmx_expire =3D 0, rmx_pk=
 sent =3D 0, rmx_weight =3D 0},=A0</div></div><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra">
 
 =A0 rt_fibnum =3D 0, rt_mtx =3D {lock_object =3D {lo_name =3D 0x0, lo_flags=
  =3D 0, lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 0}}</div></div></b=
 lockquote><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div><=
 div class=3D"gmail_extra">
 
 <br></div><div class=3D"gmail_extra">rn_Key with value of =93shutdown_post_=
 sync=94 ?</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_ext=
 ra">It=92s visible also in the raw_usend() frame:</div><div class=3D"gmail_=
 extra"><br>
 
 </div></div><blockquote style=3D"margin:0px 0px 0px 40px;border:none;paddin=
 g:0px"><div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) fr 5</d=
 iv></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">#5 =A00xc06d=
 e18f in raw_usend (so=3D&lt;value optimized out&gt;, flags=3D0, m=3D&lt;val=
 ue optimized out&gt;, nam=3D0x0, control=3D&lt;value optimized out&gt;,=A0<=
 /div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 td=3D0x=
 c3bd2000) at /usr/src/sys/net/raw_usrreq.c:238</div></div><div class=3D"gma=
 il_extra"><div class=3D"gmail_extra">238<span style=3D"white-space:pre-wrap=
 ">		</span>return ((*so-&gt;so_proto-&gt;pr_output)(m, so));</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">(kgdb) print *m=
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">$2 =3D {m=
 _hdr =3D {mh_next =3D 0xc3b4ab30, mh_nextpkt =3D 0x1, mh_data =3D 0x0, mh_l=
 en =3D -1064819065, mh_type =3D 0, mh_flags =3D 66304, mh_pad =3D 0},=A0</d=
 iv>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 M_dat =3D {=
 MH =3D {MH_pkthdr =3D {rcvif =3D 0x0, tags =3D {slh_first =3D 0x4}, len =3D=
  -1012745856, flowid =3D 3282388448,=A0</div></div><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra">
 
 =A0 =A0 =A0 =A0 csum_flags =3D 14097648373312316480, fibnum =3D 26739, cosq=
 os =3D 117 &#39;u&#39;, rsstype =3D 116 &#39;t&#39;, l2hlen =3D 100 &#39;d&=
 #39;, l3hlen =3D 111 &#39;o&#39;,=A0</div></div><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">
 
 =A0 =A0 =A0 =A0 l4hlen =3D 119 &#39;w&#39;, l5hlen =3D 110 &#39;n&#39;, PH_=
 per =3D {eigth =3D &quot;_post_sy&quot;, sixteen =3D {28767, 29551, 24436, =
 31091}, thirtytwo =3D {1936683103,=A0</div></div><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra">
 
 =A0 =A0 =A0 =A0 =A0 =A0 <a href=3D"tel:2037604212" value=3D"+12037604212" t=
 arget=3D"_blank">2037604212</a>}, sixtyfour =3D {8751443454668533855}, unin=
 tptr =3D {1936683103}, ptr =3D 0x736f705f}, PH_loc =3D {</div></div><div cl=
 ass=3D"gmail_extra"><div class=3D"gmail_extra">
 =A0 =A0 =A0 =A0 =A0 eigth =3D &quot;nc\000\000\000\000\000&quot;, sixteen =
 =3D {25454, 0, 0, 0}, thirtytwo =3D {25454, 0}, sixtyfour =3D {25454}, unin=
 tptr =3D {25454},=A0</div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 =A0 =A0=
  =A0 ptr =3D 0x636e}}, MH_dat =3D {MH_ext =3D {ref_cnt =3D 0x0, ext_buf =3D=
  0x0, ext_size =3D 0, ext_type =3D 0, ext_flags =3D 0, ext_free =3D 0,=A0</=
 div></div><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra">=A0 =A0 =A0 =A0 =A0 ext_arg1 =3D 0x0, ext_arg2 =
 =3D 0x0},=A0</div></div><div class=3D"gmail_extra"><div class=3D"gmail_extr=
 a">=A0 =A0 =A0 =A0 MH_databuf =3D &#39;\0&#39; &lt;repeats 56 times&gt;, &q=
 uot;file&quot;, &#39;\0&#39; &lt;repeats 20 times&gt;, &quot;\006\000\000\0=
 00\020\000\000\000??\215?\000\000C\001\000\000\000\000\000\000\000\000\004\=
 000\000\000\000\000\000\00000Y?&quot;, &#39;\0&#39; &lt;repeats 12 times&gt=
 ;, &quot;`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000=
 \203??\000\000\000\000\000???&quot;, &#39;\0&#39; &lt;repeats 23 times&gt;}=
 },=A0</div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=A0 =A0 M_datab=
 uf =3D &quot;\000\000\000\000\004\000\000\000\200????E??@??\200??shutdown_p=
 ost_sync&quot;, &#39;\0&#39; &lt;repeats 62 times&gt;, &quot;file&quot;, &#=
 39;\0&#39; &lt;repeats 20 times&gt;, &quot;\006\000\000\000\020\000\000\000=
 ??\215?\000\000C\001\000\000\000\000\000\000\000\000\004\000\000\000\000\00=
 0\000\00000Y?&quot;, &#39;\0&#39; &lt;repeats 12 times&gt;, &quot;`2Y?\000\=
 000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203??\000\000\000=
 \000\000???&quot;, &#39;\0&#39; &lt;repeats 23 times&gt;}}</div>
 
 </div></blockquote><div class=3D"gmail_extra"><div class=3D"gmail_extra"><b=
 r></div><div class=3D"gmail_extra">This is 10.0-PRERELEASE r259547M (with a=
 pplied the recent nd6_nbr.c rtfree patch, which I =A0thought earlier might =
 be the cause of the panics I&#39;m seeing).</div>
 
 <div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">The machine=
  is Soekris Net5501-70 with this kernel config :</div><div class=3D"gmail_e=
 xtra"><br></div></div><blockquote style=3D"margin:0px 0px 0px 40px;border:n=
 one;padding:0px">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">cpu<span style=3D"white-space:pre-wrap">		</span>I586_CPU</div></div>=
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">
 
 cpu<span style=3D"white-space:pre-wrap">		</span>I686_CPU</div></div></div>=
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">ident<span style=3D"white-space:pre-wrap">		</span>MARS</div></div>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span style=3D"white-space:pre-wrap">	</span>CPU_GEODE<=
 /div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div=
  class=3D"gmail_extra">
 
 options =A0 =A0 CPU_SOEKRIS</div></div></div><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div><d=
 iv class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_ext=
 ra">options<span style=3D"white-space:pre-wrap">		</span>HZ=3D2000</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options<span style=3D"white-space:pre-wrap">		</span>DEVI=
 CE_POLLING</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra">
 
 <div class=3D"gmail_extra">options<span style=3D"white-space:pre-wrap">		</=
 span>BPF_JITTER</div></div></div><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra"><div class=3D"gmail_extra"><br></div></div></div><div class=3D"=
 gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">makeoptions<span styl=
 e=3D"white-space:pre-wrap">	</span>DEBUG=3D-g<span style=3D"white-space:pre=
 -wrap">		</span># Build kernel with gdb(1) debug symbols</div></div></div>
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra"><br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra"><div class=3D"gmail_extra">options <span style=3D"white-space:pre-wr=
 ap">	</span>SCHED_ULE<span style=3D"white-space:pre-wrap">		</span># ULE sc=
 heduler</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>PREE=
 MPTION<span style=3D"white-space:pre-wrap">		</span># Enable kernel thread =
 preemption</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>INET=
 <span style=3D"white-space:pre-wrap">			</span># InterNETworking</div></div=
 >
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span style=3D"white-space:pre-wrap">	</span>INET6<span=
  style=3D"white-space:pre-wrap">			</span># IPv6 communications protocols</=
 div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>TCP_=
 OFFLOAD<span style=3D"white-space:pre-wrap">		</span># TCP offload</div></d=
 iv>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span style=3D"white-space:pre-wrap">	</span>FFS<span s=
 tyle=3D"white-space:pre-wrap">			</span># Berkeley Fast Filesystem</div></d=
 iv>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span style=3D"white-space:pre-wrap">	</span>SOFTUPDATE=
 S<span style=3D"white-space:pre-wrap">		</span># Enable FFS soft updates su=
 pport</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>UFS_=
 DIRHASH<span style=3D"white-space:pre-wrap">		</span># Improve performance =
 on big directories</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>PROC=
 FS<span style=3D"white-space:pre-wrap">			</span># Process filesystem (requ=
 ires PSEUDOFS)</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>PSEU=
 DOFS<span style=3D"white-space:pre-wrap">		</span># Pseudo-filesystem frame=
 work</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>GEOM=
 _PART_GPT<span style=3D"white-space:pre-wrap">		</span># GUID Partition Tab=
 les.</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>GEOM=
 _LABEL<span style=3D"white-space:pre-wrap">		</span># Provides labelization=
 </div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>COMP=
 AT_FREEBSD4<span style=3D"white-space:pre-wrap">		</span># Compatible with =
 FreeBSD4</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>COMP=
 AT_FREEBSD5<span style=3D"white-space:pre-wrap">		</span># Compatible with =
 FreeBSD5</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>COMP=
 AT_FREEBSD6<span style=3D"white-space:pre-wrap">		</span># Compatible with =
 FreeBSD6</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>COMP=
 AT_FREEBSD7<span style=3D"white-space:pre-wrap">		</span># Compatible with =
 FreeBSD7</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>SCSI=
 _DELAY=3D500<span style=3D"white-space:pre-wrap">		</span># Delay (in ms) b=
 efore probing SCSI</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>KTRA=
 CE<span style=3D"white-space:pre-wrap">			</span># ktrace(1) support</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>STAC=
 K<span style=3D"white-space:pre-wrap">			</span># stack(9) support</div></d=
 iv>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options <span style=3D"white-space:pre-wrap">	</span>SYSVSHM<sp=
 an style=3D"white-space:pre-wrap">			</span># SYSV-style shared memory</div=
 >
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>SYSV=
 MSG<span style=3D"white-space:pre-wrap">			</span># SYSV-style message queu=
 es</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>SYSV=
 SEM<span style=3D"white-space:pre-wrap">			</span># SYSV-style semaphores</=
 div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>_KPO=
 SIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions</div></div></=
 div>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">options <span style=3D"white-space:pre-wrap">	</span>PRINTF_BUFR_SIZE=
 =3D128<span style=3D"white-space:pre-wrap">	</span># Prevent printf output =
 being interspersed.</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>KBD_=
 INSTALL_CDEV<span style=3D"white-space:pre-wrap">	</span># install a CDEV e=
 ntry in /dev</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>HWPM=
 C_HOOKS<span style=3D"white-space:pre-wrap">		</span># Necessary kernel hoo=
 ks for hwpmc(4)</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>CAPA=
 BILITY_MODE<span style=3D"white-space:pre-wrap">		</span># Capsicum capabil=
 ity mode</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>CAPA=
 BILITIES<span style=3D"white-space:pre-wrap">		</span># Capsicum capabiliti=
 es</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>PROC=
 DESC<span style=3D"white-space:pre-wrap">		</span># Support for process des=
 criptors</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>INCL=
 UDE_CONFIG_FILE =A0 =A0 # Include this file in kernel</div></div></div><div=
  class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra"># Debugging support. =A0Always need this:</div></div></div><div clas=
 s=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options <span style=
 =3D"white-space:pre-wrap">	</span>KDB<span style=3D"white-space:pre-wrap">	=
 		</span># Enable kernel debugger support.</div></div></div><div class=3D"g=
 mail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options <span style=
 =3D"white-space:pre-wrap">	</span>KDB_TRACE<span style=3D"white-space:pre-w=
 rap">		</span># Print a stack trace for a panic.</div></div></div><div clas=
 s=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options<span style=3D=
 "white-space:pre-wrap">		</span>KDB_UNATTENDED</div></div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br>=
 </div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options<span style=3D"white-space:pre-wrap">		</span>TEXT=
 DUMP_PREFERRED</div></div></div><div class=3D"gmail_extra"><div class=3D"gm=
 ail_extra">
 
 <div class=3D"gmail_extra">options<span style=3D"white-space:pre-wrap">		</=
 span>TEXTDUMP_VERBOSE</div></div></div><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div><div cla=
 ss=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>pci</div></div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=
 =3D"white-space:pre-wrap">		</span>ata<span style=3D"white-space:pre-wrap">=
 		</span># Legacy ATA/SATA controllers</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</span>ATA_=
 STATIC_ID<span style=3D"white-space:pre-wrap">	</span># Static device numbe=
 ring</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"># ATA/SCSI peripherals</div><=
 /div></div>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">device<span style=3D"white-space:pre-wrap">		</span>scbus<span style=
 =3D"white-space:pre-wrap">		</span># SCSI bus (required for ATA/SCSI)</div>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</span>da<sp=
 an style=3D"white-space:pre-wrap">		</span># Direct Access (disks)</div></d=
 iv>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">device<span style=3D"white-space:pre-wrap">		</span>pass<span s=
 tyle=3D"white-space:pre-wrap">		</span># Passthrough device (direct ATA/SCS=
 I access)</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"># Add suspend/resume support =
 for the i8254.</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</span>pmtim=
 er</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><=
 div class=3D"gmail_extra">
 
 <br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra"># Serial (COM) ports</div></div></div><div clas=
 s=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">dev=
 ice<span style=3D"white-space:pre-wrap">		</span>uart<span style=3D"white-s=
 pace:pre-wrap">		</span># Generic UART driver</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"white-sp=
 ace:pre-wrap">		</span>miibus<span style=3D"white-space:pre-wrap">		</span>=
 # MII bus support</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</span>vr<sp=
 an style=3D"white-space:pre-wrap">		</span># VIA Rhine, Rhine II</div></div=
 >
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra"><br></div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra"># Wireless NIC cards</div></div></d=
 iv><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>wlan<span style=3D"white-space:pre-wrap">		<=
 /span># 802.11 support</div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra">
 
 <div class=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</=
 span>IEEE80211_DEBUG<span style=3D"white-space:pre-wrap">	</span># enable d=
 ebug msgs</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">
 
 <div class=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</=
 span>IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q&#39;s</div></div><=
 /div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gm=
 ail_extra">
 
 options <span style=3D"white-space:pre-wrap">	</span>IEEE80211_SUPPORT_MESH=
 <span style=3D"white-space:pre-wrap">	</span># enable 802.11s draft support=
 </div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</s=
 pan>wlan_wep<span style=3D"white-space:pre-wrap">	</span># 802.11 WEP suppo=
 rt</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">
 <div class=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</s=
 pan>wlan_ccmp<span style=3D"white-space:pre-wrap">	</span># 802.11 CCMP sup=
 port</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 >
 <div class=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</s=
 pan>wlan_tkip<span style=3D"white-space:pre-wrap">	</span># 802.11 TKIP sup=
 port</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 >
 <div class=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</s=
 pan>wlan_amrr<span style=3D"white-space:pre-wrap">	</span># AMRR transmit r=
 ate control algorithm</div></div></div><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">
 
 <div class=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</s=
 pan>ath<span style=3D"white-space:pre-wrap">		</span># Atheros NICs</div></=
 div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra">
 
 device<span style=3D"white-space:pre-wrap">		</span>ath_pci<span style=3D"w=
 hite-space:pre-wrap">		</span># Atheros pci/cardbus glue</div></div></div><=
 div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_ex=
 tra">
 
 device<span style=3D"white-space:pre-wrap">		</span>ath_hal<span style=3D"w=
 hite-space:pre-wrap">		</span># pci/cardbus chip support</div></div></div><=
 div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_ex=
 tra">
 
 options <span style=3D"white-space:pre-wrap">	</span>AH_SUPPORT_AR5416<span=
  style=3D"white-space:pre-wrap">	</span># enable AR5416 tx/rx descriptors</=
 div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div =
 class=3D"gmail_extra">
 
 options <span style=3D"white-space:pre-wrap">	</span>AH_AR5416_INTERRUPT_MI=
 TIGATION<span style=3D"white-space:pre-wrap">	</span># AR5416 interrupt mit=
 igation</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_ext=
 ra">
 
 <div class=3D"gmail_extra">options <span style=3D"white-space:pre-wrap">	</=
 span>ATH_ENABLE_11N<span style=3D"white-space:pre-wrap">	</span># Enable 80=
 2.11n support for AR5416 and later</div></div></div><div class=3D"gmail_ext=
 ra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>ath_rate_sample<span style=3D"white-space:pr=
 e-wrap">	</span># SampleRate tx rate control for ath</div></div></div><div =
 class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra"># Pseudo devices.</div></div></div><div class=3D"gmail_extra"><div c=
 lass=3D"gmail_extra">
 
 <div class=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</s=
 pan>loop<span style=3D"white-space:pre-wrap">		</span># Network loopback</d=
 iv></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div c=
 lass=3D"gmail_extra">
 
 device<span style=3D"white-space:pre-wrap">		</span>random<span style=3D"wh=
 ite-space:pre-wrap">		</span># Entropy device</div></div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">devi=
 ce<span style=3D"white-space:pre-wrap">		</span>ether<span style=3D"white-s=
 pace:pre-wrap">		</span># Ethernet support</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</span>vlan<=
 span style=3D"white-space:pre-wrap">		</span># 802.1Q VLAN support</div></d=
 iv>
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">device<span style=3D"white-space:pre-wrap">		</span>tun<span st=
 yle=3D"white-space:pre-wrap">		</span># Packet tunnel.</div></div></div><di=
 v class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>md<span style=3D"white-space:pre-wrap">		</s=
 pan># Memory &quot;disks&quot;</div></div></div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>gif<span style=3D"white-space:pre-wrap">		</=
 span># IPv6 and IPv4 tunneling</div></div></div><div class=3D"gmail_extra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device =A0 =A0 =A0gre=
 </div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</span=
 >faith<span style=3D"white-space:pre-wrap">		</span># IPv6-to-IPv4 relaying=
  (translation)</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device<span style=3D"white-space:pre-wrap">		</span>firmw=
 are<span style=3D"white-space:pre-wrap">	</span># firmware assist module</d=
 iv>
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device =A0 =A0 =A0if_bridge</div></div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br>=
 </div></div></div>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra">options =A0 =A0 VIMAGE</div></div></div><div class=3D"gmail_extra"><d=
 iv class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 ROUTETA=
 BLES=3D8</div></div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">options =A0 =A0 RADIX_MPATH</div></div></div><div class=3D"gmai=
 l_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></=
 div></div><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 SW_WA=
 TCHDOG</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra">device =A0 =A0 =A0crypto</div></div></div><div c=
 lass=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">=
 device =A0 =A0 =A0cryptodev</div></div></div><div class=3D"gmail_extra"><di=
 v class=3D"gmail_extra">
 
 <div class=3D"gmail_extra">device =A0 =A0 =A0glxsb</div></div></div><div cl=
 ass=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra"><=
 br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">
 
 options =A0 =A0 BOOTVERBOSE=3D1</div></div></div><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></di=
 v><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail=
 _extra">#device =A0 =A0 =A0pf</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">#device =A0 =A0 =A0pflog</div></div></div><div class=3D"g=
 mail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">#device =
 =A0 =A0 =A0pfsync</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra">device =A0 =A0 =A0 carp</div></div></div><div class=3D"gm=
 ail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">device =A0=
  =A0 =A0 enc</div></div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra">device =A0 =A0 =A0 lagg</div></div></div><div class=3D"gmail_ex=
 tra"><div class=3D"gmail_extra"><div class=3D"gmail_extra">device =A0 =A0 =
 =A0 epair</div></div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"g=
 mail_extra"><br></div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ</div></div></=
 div><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ=
 _CBQ</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra">#options =A0 =A0 ALTQ_RED</div></div></div><div=
  class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ=
 _RIO</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"=
 ><div class=3D"gmail_extra">#options =A0 =A0 ALTQ_HFSC</div></div></div><di=
 v class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">#options =A0 =A0 ALTQ=
 _PRIQ</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra=
 "><div class=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra">options =A0 =A0 IPFIREWALL</div></div></div><div=
  class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_extra=
 ">options =A0 =A0 IPFIREWALL_DEFAULT_TO_ACCEPT</div></div></div><div class=
 =3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 IPFIR=
 EWALL_NAT</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra"><div class=3D"gmail_extra">options =A0 =A0 LIBALIAS</div></div></div>=
 <div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options =A0 =A0 IPDIV=
 ERT</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">=
 <div class=3D"gmail_extra">options =A0 =A0 DUMMYNET</div></div></div><div c=
 lass=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><br></div></div></div=
 ><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div class=3D"gmail_=
 extra">device<span style=3D"white-space:pre-wrap">		</span>bpf<span style=
 =3D"white-space:pre-wrap">		</span># Berkeley packet filter</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div clas=
 s=3D"gmail_extra"><br></div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"># USB support</div></div></di=
 v><div class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">options <span style=
 =3D"white-space:pre-wrap">	</span>USB_DEBUG<span style=3D"white-space:pre-w=
 rap">	</span># enable debug msgs</div></div></div><div class=3D"gmail_extra=
 ">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>uhci<span style=3D"white-space:pre-wrap">		<=
 /span># UHCI PCI-&gt;USB interface</div></div></div><div class=3D"gmail_ext=
 ra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>ohci<span style=3D"white-space:pre-wrap">		<=
 /span># OHCI PCI-&gt;USB interface</div></div></div><div class=3D"gmail_ext=
 ra">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>ehci<span style=3D"white-space:pre-wrap">		<=
 /span># EHCI PCI-&gt;USB interface (USB 2.0)</div></div></div><div class=3D=
 "gmail_extra">
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>usb =A0 =A0 <span style=3D"white-space:pre-w=
 rap">	</span># USB Bus (required)</div></div></div><div class=3D"gmail_extr=
 a">
 <div class=3D"gmail_extra"><div class=3D"gmail_extra">device<span style=3D"=
 white-space:pre-wrap">		</span>umass<span style=3D"white-space:pre-wrap">		=
 </span># Disks/Mass storage - Requires scbus and da</div></div></div></bloc=
 kquote>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div><br></div><div>A=
 lso src.conf and make.conf :</div><div><div><br></div></div></div></div><bl=
 ockquote style=3D"margin:0px 0px 0px 40px;border:none;padding:0px"><div cla=
 ss=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div><div>root@vpn_vrf:[VNET(x)]:/usr/src/sys # =
 cat /etc/src.conf=A0</div></div></div></div><div class=3D"gmail_extra"><div=
  class=3D"gmail_extra"><div>WITHOUT_ACCT=3Dyes</div></div></div><div class=
 =3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div>WITHOUT_ACPI=3Dyes</div></div></div><div cl=
 ass=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_AMD=3Dyes</div>=
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_APM=3Dyes</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_ASSERT_DEBUG=3Dyes</div></div></div><div class=3D"gmail_extra"><div cla=
 ss=3D"gmail_extra"><div>WITHOUT_AT=3Dyes</div></div></div><div class=3D"gma=
 il_extra">
 
 <div class=3D"gmail_extra"><div>WITHOUT_ATF=3Dyes</div></div></div><div cla=
 ss=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_ATM=3Dyes</div><=
 /div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHO=
 UT_AUDIT=3Dyes</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_BLUETOOTH=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra"><div>WITHOUT_CALENDAR=3Dyes</div></div></div><div class=3D=
 "gmail_extra">
 
 <div class=3D"gmail_extra"><div>WITHOUT_CDDL=3Dyes</div></div></div><div cl=
 ass=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_CTM=3Dyes</div>=
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_DICT=3Dyes</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH=
 OUT_FLOPPY=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=3D"=
 gmail_extra"><div>WITHOUT_GAMES=3Dyes</div></div></div><div class=3D"gmail_=
 extra"><div class=3D"gmail_extra">
 
 <div>WITHOUT_HTML=3Dyes</div></div></div><div class=3D"gmail_extra"><div cl=
 ass=3D"gmail_extra"><div>WITHOUT_INFO=3Dyes</div></div></div><div class=3D"=
 gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_IPFILTER=3Dyes</div></=
 div></div>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_IPX=3Dye=
 s</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><d=
 iv>#WITHOUT_KERNEL_SYMBOLS=3Dyes</div></div></div><div class=3D"gmail_extra=
 "><div class=3D"gmail_extra">
 
 <div>WITHOUT_LEGACY_CONSOLE=3Dyes</div></div></div><div class=3D"gmail_extr=
 a"><div class=3D"gmail_extra"><div>WITHOUT_LOCALES=3Dyes</div></div></div><=
 div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_LPR=3Dyes=
 </div></div>
 
 </div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_MA=
 IL=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_ex=
 tra"><div>WITHOUT_NDIS=3Dyes</div></div></div><div class=3D"gmail_extra"><d=
 iv class=3D"gmail_extra">
 
 <div>WITHOUT_QUOTAS=3Dyes</div></div></div><div class=3D"gmail_extra"><div =
 class=3D"gmail_extra"><div>WITHOUT_ROUTED=3Dyes</div></div></div><div class=
 =3D"gmail_extra"><div class=3D"gmail_extra"><div>WITHOUT_SENDMAIL=3Dyes</di=
 v></div></div>
 
 <div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>WITH_SVN=3Dyes</=
 div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>=
 WITHOUT_ZFS=3Dyes</div></div></div><div class=3D"gmail_extra"><div class=3D=
 "gmail_extra">
 
 <div><br></div></div></div><div class=3D"gmail_extra"><div class=3D"gmail_e=
 xtra"><div>root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/make.conf</div></=
 div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>CFLAGS=
 =3D-O2</div>
 
 </div></div><div class=3D"gmail_extra"><div class=3D"gmail_extra"><div>COPT=
 FLAGS=3D -O -pipe</div></div></div><div class=3D"gmail_extra"><div class=3D=
 "gmail_extra"><div>CPUTYPE=3Dgeode</div></div></div><div class=3D"gmail_ext=
 ra"><div class=3D"gmail_extra">
 
 <div>KERNCONF=3DMARS</div></div></div><div class=3D"gmail_extra"><div class=
 =3D"gmail_extra"><div>NO_MODULES=3Dyes</div></div></div><div class=3D"gmail=
 _extra"><div class=3D"gmail_extra"><div>BOOTWAIT=3D0</div></div></div><div =
 class=3D"gmail_extra">
 
 <div class=3D"gmail_extra"><div>DOC_LANG=3Den_US.ISO8859-1</div></div></div=
 ></blockquote><span class=3D""><font color=3D"#888888"><div class=3D"gmail_=
 extra"><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><br>=
 </div><div class=3D"gmail_extra">
 --Nikolay</div><div class=3D"gmail_extra">
 <br></div></div></font></span></div>
 </blockquote></div><br></div><div class=3D"gmail_extra">Also, originally I =
 thought that the panic is when a multi path route is being deleted, however=
  again from the coredump it seems that the panic happens when openvpn delet=
 es the host route it installs for the remote openvpn server pointed to the =
 default gw (before openvpn installs the new default gw pointing to the vpn =
 tunnel) :<div>
 <br></div><div>(kgdb) fr 12</div><div><div>(kgdb) x/12sb td-&gt;td_proc-&gt=
 ;p_args</div><div>0xc4269780:<span class=3D"" style=3D"white-space:pre">	</=
 span>=A0&quot;\001&quot;</div><div>0xc4269782:<span class=3D"" style=3D"whi=
 te-space:pre">	</span>=A0&quot;&quot;</div>
 <div>0xc4269783:<span class=3D"" style=3D"white-space:pre">	</span>=A0&quot=
 ;&quot;</div><div>0xc4269784:<span class=3D"" style=3D"white-space:pre">	</=
 span>=A0&quot;B&quot;</div><div>0xc4269786:<span class=3D"" style=3D"white-=
 space:pre">	</span>=A0&quot;&quot;</div>
 <div>0xc4269787:<span class=3D"" style=3D"white-space:pre">	</span>=A0&quot=
 ;&quot;</div><div>0xc4269788:<span class=3D"" style=3D"white-space:pre">	</=
 span>=A0&quot;/sbin/route&quot;</div><div>0xc4269794:<span class=3D"" style=
 =3D"white-space:pre">	</span>=A0&quot;delete&quot;</div>
 <div>0xc426979b:<span class=3D"" style=3D"white-space:pre">	</span>=A0&quot=
 ;-net&quot;</div><div>0xc42697a0:<span class=3D"" style=3D"white-space:pre"=
 >	</span>=A0&quot;78.90.222.xxx&quot;</div><div>0xc42697ad:<span class=3D""=
  style=3D"white-space:pre">	</span>=A0&quot;10.255.255.0&quot;</div>
 <div>0xc42697ba:<span class=3D"" style=3D"white-space:pre">	</span>=A0&quot=
 ;255.255.255.255&quot;</div><div>(kgdb)=A0</div></div><div><br></div><div>I=
 &#39;m trying to reproduce this on a VirtualBox instance now, however so fa=
 r no luck (no OpenVPN running, just adding and removing routes).</div>
 <div><br></div><div><br></div><div>--Nikolay</div></div></div>
 
 --001a11c1ba200f4f8504eee88df5--

From: Nikolay Denev <ndenev@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org, 
	"freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Cc:  
Subject: Re: misc/185092: panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
Date: Wed, 1 Jan 2014 17:39:42 +0000

 Ok, killing openvpn with -9 leaves the routes around, and particularly
 interesting are the following routes :
 
     78.90.222.xx       10.255.255.0       UGHS        0     5841 epair0 =3D=
 >
     78.90.222.xx/32    10.255.255.0       UGS         0        0 epair0
 
 Now, if I do :
 
     route delete 78.90.222.xx 10.255.255.0
 
 The route, with the H flag is deleted. If I repeat the command the
 second route is deleted as well, even if the second command specifies
 a netmask no panic.
 
 However the first delete command specifies the /32 mask like this :
 
     route delete  78.90.222.xx 10.255.255.0 255.255.255.255
 
 Then I get "rtfree 2" kernel panic immediately.
 
 This seems to be happening as I'm manually installing static routes in
 the vnet jail for the VPN remote endpoints , however OpenVPN adds such
 routes too however differently, which results in two routing entries.
 
 For example :
 
 route add $IP $GW
 and
 route add $IP $GW 255.255.255.255
 
 add to different route entries, one is /32 network, the other is a host rou=
 te.
 
 
 
 --Nikolay
 
 On Wed, Jan 1, 2014 at 1:21 PM, Nikolay Denev <ndenev@gmail.com> wrote:
 > On Wed, Jan 1, 2014 at 1:10 PM, Nikolay Denev <ndenev@gmail.com> wrote:
 >>
 >> On Sun, Dec 22, 2013 at 1:10 PM, <FreeBSD-gnats-submit@freebsd.org> wrot=
 e:
 >>>
 >>> Thank you very much for your problem report.
 >>> It has the internal identification `misc/185092'.
 >>> The individual assigned to look at your
 >>> report is: freebsd-bugs.
 >>>
 >>> You can access the state of your problem report at any time
 >>> via this link:
 >>>
 >>> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092
 >>>
 >>> >Category:       misc
 >>> >Responsible:    freebsd-bugs
 >>> >Synopsis:       panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
 >>> >Arrival-Date:   Sun Dec 22 13:10:00 UTC 2013
 >>
 >>
 >> I'm trying to understand exactly what is happening here, and examining a
 >> core dump with kgdb I'm getting some output that confuses me :
 >>
 >> (kgdb) bt
 >> #0  doadump (textdump=3D-1011569920) at pcpu.h:233
 >> #1  0xc06069b2 in kern_reboot (howto=3D260) at
 >> /usr/src/sys/kern/kern_shutdown.c:447
 >> #2  0xc0606d0e in panic (fmt=3D<value optimized out>) at
 >> /usr/src/sys/kern/kern_shutdown.c:754
 >> #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 >> /usr/src/sys/net/route.c:464
 >> #4  0xc06e188d in route_output (m=3D<value optimized out>) at
 >> /usr/src/sys/net/rtsock.c:951
 >> #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=3D=
 <value
 >> optimized out>, nam=3D0x0, control=3D<value optimized out>,
 >>     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 >> #6  0xc066eca9 in sosend_generic (so=3D0xc3e9c1a8, uio=3D<value optimize=
 d
 >> out>, top=3D<value optimized out>, control=3D0x0,
 >>     flags=3D<value optimized out>, td=3D<value optimized out>) at
 >> /usr/src/sys/kern/uipc_socket.c:1271
 >> #7  0xc066efc7 in sosend (so=3D0xc3e9c1a8, addr=3D0x0, uio=3D0xd9b9cc10,
 >> top=3D0x0, control=3D0x0, flags=3D0, td=3D0xc3bd2000)
 >>     at /usr/src/sys/kern/uipc_socket.c:1315
 >> #8  0xc0654af4 in soo_write (fp=3D0xc3c0c818, uio=3D0xd9b9cc10,
 >> active_cred=3D0xc3f1dd00, flags=3D0, td=3D0xc3bd2000)
 >>     at /usr/src/sys/kern/sys_socket.c:103
 >> #9  0xc064c866 in dofilewrite (td=3D0xc3bd2000, fd=3D3, fp=3D0xc3c0c818,
 >> auio=3D0xd9b9cc10, offset=3D-1, flags=3D0) at file.h:303
 >> #10 0xc064c566 in kern_writev (td=3D0xc3bd2000, fd=3D3, auio=3D<value op=
 timized
 >> out>) at /usr/src/sys/kern/sys_generic.c:467
 >> #11 0xc064c4bc in sys_write (td=3D<value optimized out>, uap=3D<value
 >> optimized out>) at /usr/src/sys/kern/sys_generic.c:382
 >> #12 0xc08614d3 in syscall (frame=3D<value optimized out>) at
 >> subr_syscall.c:134
 >> #13 0xc084cca1 in Xint0x80_syscall () at
 >> /usr/src/sys/i386/i386/exception.s:270
 >> #14 0x281975b7 in ?? ()
 >> Previous frame inner to this frame (corrupt stack?)
 >> Current language:  auto; currently minimal
 >> (kgdb) fr 3
 >> #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 >> /usr/src/sys/net/route.c:464
 >> 464 panic("rtfree 2");
 >> (kgdb) print *rt
 >> $1 =3D {rt_nodes =3D {{rn_mklist =3D 0xc3b4ab30, rn_parent =3D 0x1, rn_b=
 it =3D 0,
 >> rn_bmask =3D 0 '\0', rn_flags =3D 0 '\0', rn_u =3D {rn_leaf =3D {
 >>           rn_Key =3D 0xc0882687 "shutdown_post_sync", rn_Mask =3D 0x1030=
 000
 >> <Address 0x1030000 out of bounds>, rn_Dupedkey =3D 0x0}, rn_node =3D {
 >>           rn_Off =3D -1064819065, rn_L =3D 0x1030000, rn_R =3D 0x0}}},
 >> {rn_mklist =3D 0x0, rn_parent =3D 0x4, rn_bit =3D -18048, rn_bmask =3D -=
 94 '?',
 >>       rn_flags =3D 195 '?', rn_u =3D {rn_leaf =3D {rn_Key =3D 0xc3a545e0=
  "",
 >> rn_Mask =3D 0xc3a4e440 " ??(???\020'", rn_Dupedkey =3D 0xc3a4e880},
 >>         rn_node =3D {rn_Off =3D -1012578848, rn_L =3D 0xc3a4e440, rn_R =
 =3D
 >> 0xc3a4e880}}}}, rt_gateway =3D 0x74756873, rt_flags =3D 1853321060,
 >>   rt_refcnt =3D 1936683103, rt_ifp =3D 0x79735f74, rt_ifa =3D 0x636e, rt=
 _rmx =3D
 >> {rmx_mtu =3D 0, rmx_expire =3D 0, rmx_pksent =3D 0, rmx_weight =3D 0},
 >>   rt_fibnum =3D 0, rt_mtx =3D {lock_object =3D {lo_name =3D 0x0, lo_flag=
 s =3D 0,
 >> lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 0}}
 >>
 >>
 >>
 >> rn_Key with value of =93shutdown_post_sync=94 ?
 >>
 >> It=92s visible also in the raw_usend() frame:
 >>
 >> (kgdb) fr 5
 >> #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=3D=
 <value
 >> optimized out>, nam=3D0x0, control=3D<value optimized out>,
 >>     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 >> 238 return ((*so->so_proto->pr_output)(m, so));
 >> (kgdb) print *m
 >> $2 =3D {m_hdr =3D {mh_next =3D 0xc3b4ab30, mh_nextpkt =3D 0x1, mh_data =
 =3D 0x0,
 >> mh_len =3D -1064819065, mh_type =3D 0, mh_flags =3D 66304, mh_pad =3D 0}=
 ,
 >>   M_dat =3D {MH =3D {MH_pkthdr =3D {rcvif =3D 0x0, tags =3D {slh_first =
 =3D 0x4}, len =3D
 >> -1012745856, flowid =3D 3282388448,
 >>         csum_flags =3D 14097648373312316480, fibnum =3D 26739, cosqos =
 =3D 117
 >> 'u', rsstype =3D 116 't', l2hlen =3D 100 'd', l3hlen =3D 111 'o',
 >>         l4hlen =3D 119 'w', l5hlen =3D 110 'n', PH_per =3D {eigth =3D "_=
 post_sy",
 >> sixteen =3D {28767, 29551, 24436, 31091}, thirtytwo =3D {1936683103,
 >>             2037604212}, sixtyfour =3D {8751443454668533855}, unintptr =
 =3D
 >> {1936683103}, ptr =3D 0x736f705f}, PH_loc =3D {
 >>           eigth =3D "nc\000\000\000\000\000", sixteen =3D {25454, 0, 0, =
 0},
 >> thirtytwo =3D {25454, 0}, sixtyfour =3D {25454}, unintptr =3D {25454},
 >>           ptr =3D 0x636e}}, MH_dat =3D {MH_ext =3D {ref_cnt =3D 0x0, ext=
 _buf =3D
 >> 0x0, ext_size =3D 0, ext_type =3D 0, ext_flags =3D 0, ext_free =3D 0,
 >>           ext_arg1 =3D 0x0, ext_arg2 =3D 0x0},
 >>         MH_databuf =3D '\0' <repeats 56 times>, "file", '\0' <repeats 20
 >> times>,
 >> "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\00=
 0\000\000\000\004\000\000\000\000\000\000\00000Y?",
 >> '\0' <repeats 12 times>,
 >> "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203?=
 ?\000\000\000\000\000???",
 >> '\0' <repeats 23 times>}},
 >>     M_databuf =3D
 >> "\000\000\000\000\004\000\000\000\200????E??@??\200??shutdown_post_sync"=
 ,
 >> '\0' <repeats 62 times>, "file", '\0' <repeats 20 times>,
 >> "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\00=
 0\000\000\000\004\000\000\000\000\000\000\00000Y?",
 >> '\0' <repeats 12 times>,
 >> "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203?=
 ?\000\000\000\000\000???",
 >> '\0' <repeats 23 times>}}
 >>
 >>
 >> This is 10.0-PRERELEASE r259547M (with applied the recent nd6_nbr.c rtfr=
 ee
 >> patch, which I  thought earlier might be the cause of the panics I'm
 >> seeing).
 >>
 >> The machine is Soekris Net5501-70 with this kernel config :
 >>
 >> cpu I586_CPU
 >> cpu I686_CPU
 >> ident MARS
 >> options CPU_GEODE
 >> options     CPU_SOEKRIS
 >>
 >> options HZ=3D2000
 >> options DEVICE_POLLING
 >> options BPF_JITTER
 >>
 >> makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols
 >>
 >> options SCHED_ULE # ULE scheduler
 >> options PREEMPTION # Enable kernel thread preemption
 >> options INET # InterNETworking
 >> options INET6 # IPv6 communications protocols
 >> options TCP_OFFLOAD # TCP offload
 >> options FFS # Berkeley Fast Filesystem
 >> options SOFTUPDATES # Enable FFS soft updates support
 >> options UFS_DIRHASH # Improve performance on big directories
 >> options PROCFS # Process filesystem (requires PSEUDOFS)
 >> options PSEUDOFS # Pseudo-filesystem framework
 >> options GEOM_PART_GPT # GUID Partition Tables.
 >> options GEOM_LABEL # Provides labelization
 >> options COMPAT_FREEBSD4 # Compatible with FreeBSD4
 >> options COMPAT_FREEBSD5 # Compatible with FreeBSD5
 >> options COMPAT_FREEBSD6 # Compatible with FreeBSD6
 >> options COMPAT_FREEBSD7 # Compatible with FreeBSD7
 >> options SCSI_DELAY=3D500 # Delay (in ms) before probing SCSI
 >> options KTRACE # ktrace(1) support
 >> options STACK # stack(9) support
 >> options SYSVSHM # SYSV-style shared memory
 >> options SYSVMSG # SYSV-style message queues
 >> options SYSVSEM # SYSV-style semaphores
 >> options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extension=
 s
 >> options PRINTF_BUFR_SIZE=3D128 # Prevent printf output being intersperse=
 d.
 >> options KBD_INSTALL_CDEV # install a CDEV entry in /dev
 >> options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 >> options CAPABILITY_MODE # Capsicum capability mode
 >> options CAPABILITIES # Capsicum capabilities
 >> options PROCDESC # Support for process descriptors
 >> options INCLUDE_CONFIG_FILE     # Include this file in kernel
 >>
 >> # Debugging support.  Always need this:
 >> options KDB # Enable kernel debugger support.
 >> options KDB_TRACE # Print a stack trace for a panic.
 >> options KDB_UNATTENDED
 >>
 >> options TEXTDUMP_PREFERRED
 >> options TEXTDUMP_VERBOSE
 >>
 >> device pci
 >> device ata # Legacy ATA/SATA controllers
 >> options ATA_STATIC_ID # Static device numbering
 >>
 >> # ATA/SCSI peripherals
 >> device scbus # SCSI bus (required for ATA/SCSI)
 >> device da # Direct Access (disks)
 >> device pass # Passthrough device (direct ATA/SCSI access)
 >>
 >> # Add suspend/resume support for the i8254.
 >> device pmtimer
 >>
 >> # Serial (COM) ports
 >> device uart # Generic UART driver
 >>
 >> device miibus # MII bus support
 >> device vr # VIA Rhine, Rhine II
 >>
 >> # Wireless NIC cards
 >> device wlan # 802.11 support
 >> options IEEE80211_DEBUG # enable debug msgs
 >> options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
 >> options IEEE80211_SUPPORT_MESH # enable 802.11s draft support
 >> device wlan_wep # 802.11 WEP support
 >> device wlan_ccmp # 802.11 CCMP support
 >> device wlan_tkip # 802.11 TKIP support
 >> device wlan_amrr # AMRR transmit rate control algorithm
 >> device ath # Atheros NICs
 >> device ath_pci # Atheros pci/cardbus glue
 >> device ath_hal # pci/cardbus chip support
 >> options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
 >> options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation
 >> options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later
 >> device ath_rate_sample # SampleRate tx rate control for ath
 >>
 >> # Pseudo devices.
 >> device loop # Network loopback
 >> device random # Entropy device
 >> device ether # Ethernet support
 >> device vlan # 802.1Q VLAN support
 >> device tun # Packet tunnel.
 >> device md # Memory "disks"
 >> device gif # IPv6 and IPv4 tunneling
 >> device      gre
 >> device faith # IPv6-to-IPv4 relaying (translation)
 >> device firmware # firmware assist module
 >> device      if_bridge
 >>
 >> options     VIMAGE
 >> options     ROUTETABLES=3D8
 >> options     RADIX_MPATH
 >>
 >> options     SW_WATCHDOG
 >>
 >> device      crypto
 >> device      cryptodev
 >> device      glxsb
 >>
 >> options     BOOTVERBOSE=3D1
 >>
 >> #device      pf
 >> #device      pflog
 >> #device      pfsync
 >> device       carp
 >> device       enc
 >> device       lagg
 >> device       epair
 >>
 >> #options     ALTQ
 >> #options     ALTQ_CBQ
 >> #options     ALTQ_RED
 >> #options     ALTQ_RIO
 >> #options     ALTQ_HFSC
 >> #options     ALTQ_PRIQ
 >>
 >> options     IPFIREWALL
 >> options     IPFIREWALL_DEFAULT_TO_ACCEPT
 >> options     IPFIREWALL_NAT
 >> options     LIBALIAS
 >> options     IPDIVERT
 >> options     DUMMYNET
 >>
 >> device bpf # Berkeley packet filter
 >>
 >> # USB support
 >> options USB_DEBUG # enable debug msgs
 >> device uhci # UHCI PCI->USB interface
 >> device ohci # OHCI PCI->USB interface
 >> device ehci # EHCI PCI->USB interface (USB 2.0)
 >> device usb     # USB Bus (required)
 >> device umass # Disks/Mass storage - Requires scbus and da
 >>
 >>
 >> Also src.conf and make.conf :
 >>
 >> root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/src.conf
 >> WITHOUT_ACCT=3Dyes
 >> WITHOUT_ACPI=3Dyes
 >> WITHOUT_AMD=3Dyes
 >> WITHOUT_APM=3Dyes
 >> WITHOUT_ASSERT_DEBUG=3Dyes
 >> WITHOUT_AT=3Dyes
 >> WITHOUT_ATF=3Dyes
 >> WITHOUT_ATM=3Dyes
 >> WITHOUT_AUDIT=3Dyes
 >> WITHOUT_BLUETOOTH=3Dyes
 >> WITHOUT_CALENDAR=3Dyes
 >> WITHOUT_CDDL=3Dyes
 >> WITHOUT_CTM=3Dyes
 >> WITHOUT_DICT=3Dyes
 >> WITHOUT_FLOPPY=3Dyes
 >> WITHOUT_GAMES=3Dyes
 >> WITHOUT_HTML=3Dyes
 >> WITHOUT_INFO=3Dyes
 >> WITHOUT_IPFILTER=3Dyes
 >> WITHOUT_IPX=3Dyes
 >> #WITHOUT_KERNEL_SYMBOLS=3Dyes
 >> WITHOUT_LEGACY_CONSOLE=3Dyes
 >> WITHOUT_LOCALES=3Dyes
 >> WITHOUT_LPR=3Dyes
 >> WITHOUT_MAIL=3Dyes
 >> WITHOUT_NDIS=3Dyes
 >> WITHOUT_QUOTAS=3Dyes
 >> WITHOUT_ROUTED=3Dyes
 >> WITHOUT_SENDMAIL=3Dyes
 >> WITH_SVN=3Dyes
 >> WITHOUT_ZFS=3Dyes
 >>
 >> root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/make.conf
 >> CFLAGS=3D-O2
 >> COPTFLAGS=3D -O -pipe
 >> CPUTYPE=3Dgeode
 >> KERNCONF=3DMARS
 >> NO_MODULES=3Dyes
 >> BOOTWAIT=3D0
 >> DOC_LANG=3Den_US.ISO8859-1
 >>
 >>
 >>
 >> --Nikolay
 >>
 >
 > Also, originally I thought that the panic is when a multi path route is
 > being deleted, however again from the coredump it seems that the panic
 > happens when openvpn deletes the host route it installs for the remote
 > openvpn server pointed to the default gw (before openvpn installs the new
 > default gw pointing to the vpn tunnel) :
 >
 > (kgdb) fr 12
 > (kgdb) x/12sb td->td_proc->p_args
 > 0xc4269780:  "\001"
 > 0xc4269782:  ""
 > 0xc4269783:  ""
 > 0xc4269784:  "B"
 > 0xc4269786:  ""
 > 0xc4269787:  ""
 > 0xc4269788:  "/sbin/route"
 > 0xc4269794:  "delete"
 > 0xc426979b:  "-net"
 > 0xc42697a0:  "78.90.222.xxx"
 > 0xc42697ad:  "10.255.255.0"
 > 0xc42697ba:  "255.255.255.255"
 > (kgdb)
 >
 > I'm trying to reproduce this on a VirtualBox instance now, however so far=
  no
 > luck (no OpenVPN running, just adding and removing routes).
 >
 >
 > --Nikolay
Responsible-Changed-From-To: freebsd-bugs->melifaro 
Responsible-Changed-By: melifaro 
Responsible-Changed-When: Thu Jan 2 13:34:35 UTC 2014 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185092 

From: Nikolay Denev <ndenev@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org, 
	"freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Cc:  
Subject: Re: misc/185092: panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
Date: Thu, 2 Jan 2014 16:14:36 +0000

 On Wed, Jan 1, 2014 at 5:39 PM, Nikolay Denev <ndenev@gmail.com> wrote:
 > Ok, killing openvpn with -9 leaves the routes around, and particularly
 > interesting are the following routes :
 >
 >     78.90.222.xx       10.255.255.0       UGHS        0     5841 epair0 =
 =3D>
 >     78.90.222.xx/32    10.255.255.0       UGS         0        0 epair0
 >
 > Now, if I do :
 >
 >     route delete 78.90.222.xx 10.255.255.0
 >
 > The route, with the H flag is deleted. If I repeat the command the
 > second route is deleted as well, even if the second command specifies
 > a netmask no panic.
 >
 > However the first delete command specifies the /32 mask like this :
 >
 >     route delete  78.90.222.xx 10.255.255.0 255.255.255.255
 >
 > Then I get "rtfree 2" kernel panic immediately.
 >
 > This seems to be happening as I'm manually installing static routes in
 > the vnet jail for the VPN remote endpoints , however OpenVPN adds such
 > routes too however differently, which results in two routing entries.
 >
 > For example :
 >
 > route add $IP $GW
 > and
 > route add $IP $GW 255.255.255.255
 >
 > add to different route entries, one is /32 network, the other is a host r=
 oute.
 >
 >
 >
 > --Nikolay
 >
 > On Wed, Jan 1, 2014 at 1:21 PM, Nikolay Denev <ndenev@gmail.com> wrote:
 >> On Wed, Jan 1, 2014 at 1:10 PM, Nikolay Denev <ndenev@gmail.com> wrote:
 >>>
 >>> On Sun, Dec 22, 2013 at 1:10 PM, <FreeBSD-gnats-submit@freebsd.org> wro=
 te:
 >>>>
 >>>> Thank you very much for your problem report.
 >>>> It has the internal identification `misc/185092'.
 >>>> The individual assigned to look at your
 >>>> report is: freebsd-bugs.
 >>>>
 >>>> You can access the state of your problem report at any time
 >>>> via this link:
 >>>>
 >>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=3D185092
 >>>>
 >>>> >Category:       misc
 >>>> >Responsible:    freebsd-bugs
 >>>> >Synopsis:       panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
 >>>> >Arrival-Date:   Sun Dec 22 13:10:00 UTC 2013
 >>>
 >>>
 >>> I'm trying to understand exactly what is happening here, and examining =
 a
 >>> core dump with kgdb I'm getting some output that confuses me :
 >>>
 >>> (kgdb) bt
 >>> #0  doadump (textdump=3D-1011569920) at pcpu.h:233
 >>> #1  0xc06069b2 in kern_reboot (howto=3D260) at
 >>> /usr/src/sys/kern/kern_shutdown.c:447
 >>> #2  0xc0606d0e in panic (fmt=3D<value optimized out>) at
 >>> /usr/src/sys/kern/kern_shutdown.c:754
 >>> #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 >>> /usr/src/sys/net/route.c:464
 >>> #4  0xc06e188d in route_output (m=3D<value optimized out>) at
 >>> /usr/src/sys/net/rtsock.c:951
 >>> #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=
 =3D<value
 >>> optimized out>, nam=3D0x0, control=3D<value optimized out>,
 >>>     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 >>> #6  0xc066eca9 in sosend_generic (so=3D0xc3e9c1a8, uio=3D<value optimiz=
 ed
 >>> out>, top=3D<value optimized out>, control=3D0x0,
 >>>     flags=3D<value optimized out>, td=3D<value optimized out>) at
 >>> /usr/src/sys/kern/uipc_socket.c:1271
 >>> #7  0xc066efc7 in sosend (so=3D0xc3e9c1a8, addr=3D0x0, uio=3D0xd9b9cc10=
 ,
 >>> top=3D0x0, control=3D0x0, flags=3D0, td=3D0xc3bd2000)
 >>>     at /usr/src/sys/kern/uipc_socket.c:1315
 >>> #8  0xc0654af4 in soo_write (fp=3D0xc3c0c818, uio=3D0xd9b9cc10,
 >>> active_cred=3D0xc3f1dd00, flags=3D0, td=3D0xc3bd2000)
 >>>     at /usr/src/sys/kern/sys_socket.c:103
 >>> #9  0xc064c866 in dofilewrite (td=3D0xc3bd2000, fd=3D3, fp=3D0xc3c0c818=
 ,
 >>> auio=3D0xd9b9cc10, offset=3D-1, flags=3D0) at file.h:303
 >>> #10 0xc064c566 in kern_writev (td=3D0xc3bd2000, fd=3D3, auio=3D<value o=
 ptimized
 >>> out>) at /usr/src/sys/kern/sys_generic.c:467
 >>> #11 0xc064c4bc in sys_write (td=3D<value optimized out>, uap=3D<value
 >>> optimized out>) at /usr/src/sys/kern/sys_generic.c:382
 >>> #12 0xc08614d3 in syscall (frame=3D<value optimized out>) at
 >>> subr_syscall.c:134
 >>> #13 0xc084cca1 in Xint0x80_syscall () at
 >>> /usr/src/sys/i386/i386/exception.s:270
 >>> #14 0x281975b7 in ?? ()
 >>> Previous frame inner to this frame (corrupt stack?)
 >>> Current language:  auto; currently minimal
 >>> (kgdb) fr 3
 >>> #3  0xc06de639 in rtfree (rt=3D<value optimized out>) at
 >>> /usr/src/sys/net/route.c:464
 >>> 464 panic("rtfree 2");
 >>> (kgdb) print *rt
 >>> $1 =3D {rt_nodes =3D {{rn_mklist =3D 0xc3b4ab30, rn_parent =3D 0x1, rn_=
 bit =3D 0,
 >>> rn_bmask =3D 0 '\0', rn_flags =3D 0 '\0', rn_u =3D {rn_leaf =3D {
 >>>           rn_Key =3D 0xc0882687 "shutdown_post_sync", rn_Mask =3D 0x103=
 0000
 >>> <Address 0x1030000 out of bounds>, rn_Dupedkey =3D 0x0}, rn_node =3D {
 >>>           rn_Off =3D -1064819065, rn_L =3D 0x1030000, rn_R =3D 0x0}}},
 >>> {rn_mklist =3D 0x0, rn_parent =3D 0x4, rn_bit =3D -18048, rn_bmask =3D =
 -94 '?',
 >>>       rn_flags =3D 195 '?', rn_u =3D {rn_leaf =3D {rn_Key =3D 0xc3a545e=
 0 "",
 >>> rn_Mask =3D 0xc3a4e440 " ??(???\020'", rn_Dupedkey =3D 0xc3a4e880},
 >>>         rn_node =3D {rn_Off =3D -1012578848, rn_L =3D 0xc3a4e440, rn_R =
 =3D
 >>> 0xc3a4e880}}}}, rt_gateway =3D 0x74756873, rt_flags =3D 1853321060,
 >>>   rt_refcnt =3D 1936683103, rt_ifp =3D 0x79735f74, rt_ifa =3D 0x636e, r=
 t_rmx =3D
 >>> {rmx_mtu =3D 0, rmx_expire =3D 0, rmx_pksent =3D 0, rmx_weight =3D 0},
 >>>   rt_fibnum =3D 0, rt_mtx =3D {lock_object =3D {lo_name =3D 0x0, lo_fla=
 gs =3D 0,
 >>> lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 0}}
 >>>
 >>>
 >>>
 >>> rn_Key with value of =93shutdown_post_sync=94 ?
 >>>
 >>> It=92s visible also in the raw_usend() frame:
 >>>
 >>> (kgdb) fr 5
 >>> #5  0xc06de18f in raw_usend (so=3D<value optimized out>, flags=3D0, m=
 =3D<value
 >>> optimized out>, nam=3D0x0, control=3D<value optimized out>,
 >>>     td=3D0xc3bd2000) at /usr/src/sys/net/raw_usrreq.c:238
 >>> 238 return ((*so->so_proto->pr_output)(m, so));
 >>> (kgdb) print *m
 >>> $2 =3D {m_hdr =3D {mh_next =3D 0xc3b4ab30, mh_nextpkt =3D 0x1, mh_data =
 =3D 0x0,
 >>> mh_len =3D -1064819065, mh_type =3D 0, mh_flags =3D 66304, mh_pad =3D 0=
 },
 >>>   M_dat =3D {MH =3D {MH_pkthdr =3D {rcvif =3D 0x0, tags =3D {slh_first =
 =3D 0x4}, len =3D
 >>> -1012745856, flowid =3D 3282388448,
 >>>         csum_flags =3D 14097648373312316480, fibnum =3D 26739, cosqos =
 =3D 117
 >>> 'u', rsstype =3D 116 't', l2hlen =3D 100 'd', l3hlen =3D 111 'o',
 >>>         l4hlen =3D 119 'w', l5hlen =3D 110 'n', PH_per =3D {eigth =3D "=
 _post_sy",
 >>> sixteen =3D {28767, 29551, 24436, 31091}, thirtytwo =3D {1936683103,
 >>>             2037604212}, sixtyfour =3D {8751443454668533855}, unintptr =
 =3D
 >>> {1936683103}, ptr =3D 0x736f705f}, PH_loc =3D {
 >>>           eigth =3D "nc\000\000\000\000\000", sixteen =3D {25454, 0, 0,=
  0},
 >>> thirtytwo =3D {25454, 0}, sixtyfour =3D {25454}, unintptr =3D {25454},
 >>>           ptr =3D 0x636e}}, MH_dat =3D {MH_ext =3D {ref_cnt =3D 0x0, ex=
 t_buf =3D
 >>> 0x0, ext_size =3D 0, ext_type =3D 0, ext_flags =3D 0, ext_free =3D 0,
 >>>           ext_arg1 =3D 0x0, ext_arg2 =3D 0x0},
 >>>         MH_databuf =3D '\0' <repeats 56 times>, "file", '\0' <repeats 2=
 0
 >>> times>,
 >>> "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\0=
 00\000\000\000\004\000\000\000\000\000\000\00000Y?",
 >>> '\0' <repeats 12 times>,
 >>> "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203=
 ??\000\000\000\000\000???",
 >>> '\0' <repeats 23 times>}},
 >>>     M_databuf =3D
 >>> "\000\000\000\000\004\000\000\000\200????E??@??\200??shutdown_post_sync=
 ",
 >>> '\0' <repeats 62 times>, "file", '\0' <repeats 20 times>,
 >>> "\006\000\000\000\020\000\000\000??\215?\000\000C\001\000\000\000\000\0=
 00\000\000\000\004\000\000\000\000\000\000\00000Y?",
 >>> '\0' <repeats 12 times>,
 >>> "`2Y?\000\000\000\000\000\000\000\000T\211\223?\022\000\000\000\000\203=
 ??\000\000\000\000\000???",
 >>> '\0' <repeats 23 times>}}
 >>>
 >>>
 >>> This is 10.0-PRERELEASE r259547M (with applied the recent nd6_nbr.c rtf=
 ree
 >>> patch, which I  thought earlier might be the cause of the panics I'm
 >>> seeing).
 >>>
 >>> The machine is Soekris Net5501-70 with this kernel config :
 >>>
 >>> cpu I586_CPU
 >>> cpu I686_CPU
 >>> ident MARS
 >>> options CPU_GEODE
 >>> options     CPU_SOEKRIS
 >>>
 >>> options HZ=3D2000
 >>> options DEVICE_POLLING
 >>> options BPF_JITTER
 >>>
 >>> makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols
 >>>
 >>> options SCHED_ULE # ULE scheduler
 >>> options PREEMPTION # Enable kernel thread preemption
 >>> options INET # InterNETworking
 >>> options INET6 # IPv6 communications protocols
 >>> options TCP_OFFLOAD # TCP offload
 >>> options FFS # Berkeley Fast Filesystem
 >>> options SOFTUPDATES # Enable FFS soft updates support
 >>> options UFS_DIRHASH # Improve performance on big directories
 >>> options PROCFS # Process filesystem (requires PSEUDOFS)
 >>> options PSEUDOFS # Pseudo-filesystem framework
 >>> options GEOM_PART_GPT # GUID Partition Tables.
 >>> options GEOM_LABEL # Provides labelization
 >>> options COMPAT_FREEBSD4 # Compatible with FreeBSD4
 >>> options COMPAT_FREEBSD5 # Compatible with FreeBSD5
 >>> options COMPAT_FREEBSD6 # Compatible with FreeBSD6
 >>> options COMPAT_FREEBSD7 # Compatible with FreeBSD7
 >>> options SCSI_DELAY=3D500 # Delay (in ms) before probing SCSI
 >>> options KTRACE # ktrace(1) support
 >>> options STACK # stack(9) support
 >>> options SYSVSHM # SYSV-style shared memory
 >>> options SYSVMSG # SYSV-style message queues
 >>> options SYSVSEM # SYSV-style semaphores
 >>> options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensio=
 ns
 >>> options PRINTF_BUFR_SIZE=3D128 # Prevent printf output being interspers=
 ed.
 >>> options KBD_INSTALL_CDEV # install a CDEV entry in /dev
 >>> options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
 >>> options CAPABILITY_MODE # Capsicum capability mode
 >>> options CAPABILITIES # Capsicum capabilities
 >>> options PROCDESC # Support for process descriptors
 >>> options INCLUDE_CONFIG_FILE     # Include this file in kernel
 >>>
 >>> # Debugging support.  Always need this:
 >>> options KDB # Enable kernel debugger support.
 >>> options KDB_TRACE # Print a stack trace for a panic.
 >>> options KDB_UNATTENDED
 >>>
 >>> options TEXTDUMP_PREFERRED
 >>> options TEXTDUMP_VERBOSE
 >>>
 >>> device pci
 >>> device ata # Legacy ATA/SATA controllers
 >>> options ATA_STATIC_ID # Static device numbering
 >>>
 >>> # ATA/SCSI peripherals
 >>> device scbus # SCSI bus (required for ATA/SCSI)
 >>> device da # Direct Access (disks)
 >>> device pass # Passthrough device (direct ATA/SCSI access)
 >>>
 >>> # Add suspend/resume support for the i8254.
 >>> device pmtimer
 >>>
 >>> # Serial (COM) ports
 >>> device uart # Generic UART driver
 >>>
 >>> device miibus # MII bus support
 >>> device vr # VIA Rhine, Rhine II
 >>>
 >>> # Wireless NIC cards
 >>> device wlan # 802.11 support
 >>> options IEEE80211_DEBUG # enable debug msgs
 >>> options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
 >>> options IEEE80211_SUPPORT_MESH # enable 802.11s draft support
 >>> device wlan_wep # 802.11 WEP support
 >>> device wlan_ccmp # 802.11 CCMP support
 >>> device wlan_tkip # 802.11 TKIP support
 >>> device wlan_amrr # AMRR transmit rate control algorithm
 >>> device ath # Atheros NICs
 >>> device ath_pci # Atheros pci/cardbus glue
 >>> device ath_hal # pci/cardbus chip support
 >>> options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
 >>> options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation
 >>> options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later
 >>> device ath_rate_sample # SampleRate tx rate control for ath
 >>>
 >>> # Pseudo devices.
 >>> device loop # Network loopback
 >>> device random # Entropy device
 >>> device ether # Ethernet support
 >>> device vlan # 802.1Q VLAN support
 >>> device tun # Packet tunnel.
 >>> device md # Memory "disks"
 >>> device gif # IPv6 and IPv4 tunneling
 >>> device      gre
 >>> device faith # IPv6-to-IPv4 relaying (translation)
 >>> device firmware # firmware assist module
 >>> device      if_bridge
 >>>
 >>> options     VIMAGE
 >>> options     ROUTETABLES=3D8
 >>> options     RADIX_MPATH
 >>>
 >>> options     SW_WATCHDOG
 >>>
 >>> device      crypto
 >>> device      cryptodev
 >>> device      glxsb
 >>>
 >>> options     BOOTVERBOSE=3D1
 >>>
 >>> #device      pf
 >>> #device      pflog
 >>> #device      pfsync
 >>> device       carp
 >>> device       enc
 >>> device       lagg
 >>> device       epair
 >>>
 >>> #options     ALTQ
 >>> #options     ALTQ_CBQ
 >>> #options     ALTQ_RED
 >>> #options     ALTQ_RIO
 >>> #options     ALTQ_HFSC
 >>> #options     ALTQ_PRIQ
 >>>
 >>> options     IPFIREWALL
 >>> options     IPFIREWALL_DEFAULT_TO_ACCEPT
 >>> options     IPFIREWALL_NAT
 >>> options     LIBALIAS
 >>> options     IPDIVERT
 >>> options     DUMMYNET
 >>>
 >>> device bpf # Berkeley packet filter
 >>>
 >>> # USB support
 >>> options USB_DEBUG # enable debug msgs
 >>> device uhci # UHCI PCI->USB interface
 >>> device ohci # OHCI PCI->USB interface
 >>> device ehci # EHCI PCI->USB interface (USB 2.0)
 >>> device usb     # USB Bus (required)
 >>> device umass # Disks/Mass storage - Requires scbus and da
 >>>
 >>>
 >>> Also src.conf and make.conf :
 >>>
 >>> root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/src.conf
 >>> WITHOUT_ACCT=3Dyes
 >>> WITHOUT_ACPI=3Dyes
 >>> WITHOUT_AMD=3Dyes
 >>> WITHOUT_APM=3Dyes
 >>> WITHOUT_ASSERT_DEBUG=3Dyes
 >>> WITHOUT_AT=3Dyes
 >>> WITHOUT_ATF=3Dyes
 >>> WITHOUT_ATM=3Dyes
 >>> WITHOUT_AUDIT=3Dyes
 >>> WITHOUT_BLUETOOTH=3Dyes
 >>> WITHOUT_CALENDAR=3Dyes
 >>> WITHOUT_CDDL=3Dyes
 >>> WITHOUT_CTM=3Dyes
 >>> WITHOUT_DICT=3Dyes
 >>> WITHOUT_FLOPPY=3Dyes
 >>> WITHOUT_GAMES=3Dyes
 >>> WITHOUT_HTML=3Dyes
 >>> WITHOUT_INFO=3Dyes
 >>> WITHOUT_IPFILTER=3Dyes
 >>> WITHOUT_IPX=3Dyes
 >>> #WITHOUT_KERNEL_SYMBOLS=3Dyes
 >>> WITHOUT_LEGACY_CONSOLE=3Dyes
 >>> WITHOUT_LOCALES=3Dyes
 >>> WITHOUT_LPR=3Dyes
 >>> WITHOUT_MAIL=3Dyes
 >>> WITHOUT_NDIS=3Dyes
 >>> WITHOUT_QUOTAS=3Dyes
 >>> WITHOUT_ROUTED=3Dyes
 >>> WITHOUT_SENDMAIL=3Dyes
 >>> WITH_SVN=3Dyes
 >>> WITHOUT_ZFS=3Dyes
 >>>
 >>> root@vpn_vrf:[VNET(x)]:/usr/src/sys # cat /etc/make.conf
 >>> CFLAGS=3D-O2
 >>> COPTFLAGS=3D -O -pipe
 >>> CPUTYPE=3Dgeode
 >>> KERNCONF=3DMARS
 >>> NO_MODULES=3Dyes
 >>> BOOTWAIT=3D0
 >>> DOC_LANG=3Den_US.ISO8859-1
 >>>
 >>>
 >>>
 >>> --Nikolay
 >>>
 >>
 >> Also, originally I thought that the panic is when a multi path route is
 >> being deleted, however again from the coredump it seems that the panic
 >> happens when openvpn deletes the host route it installs for the remote
 >> openvpn server pointed to the default gw (before openvpn installs the ne=
 w
 >> default gw pointing to the vpn tunnel) :
 >>
 >> (kgdb) fr 12
 >> (kgdb) x/12sb td->td_proc->p_args
 >> 0xc4269780:  "\001"
 >> 0xc4269782:  ""
 >> 0xc4269783:  ""
 >> 0xc4269784:  "B"
 >> 0xc4269786:  ""
 >> 0xc4269787:  ""
 >> 0xc4269788:  "/sbin/route"
 >> 0xc4269794:  "delete"
 >> 0xc426979b:  "-net"
 >> 0xc42697a0:  "78.90.222.xxx"
 >> 0xc42697ad:  "10.255.255.0"
 >> 0xc42697ba:  "255.255.255.255"
 >> (kgdb)
 >>
 >> I'm trying to reproduce this on a VirtualBox instance now, however so fa=
 r no
 >> luck (no OpenVPN running, just adding and removing routes).
 >>
 >>
 >> --Nikolay
 
 Some more testing shows that it's pretty easy to panic the machine.
 One just have to try to delete twice a host route that has the same GW
 as the default gw and the machine panics.
 
     # ifconfig em0 10.0.0.155/24 up
     # route add default 10.0.0.1
     add net default: gateway: 10.0.0.1
     # route add 8.8.8.8 10.0.0.1
     add host 8.8.8.8: gateway: 10.0.0.1
     # route delete 8.8.8.8 10.0.0.1
     delete host 8.8.8.8: gateway: 10.0.0.1
     # route delete 8.8.8.8 10.0.0.1
     panic: rtfree 2
 
 
 --Nikolay

From: "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To: Nikolay Denev <ndenev@gmail.com>
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org, 
 "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject: Re: misc/185092: panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
Date: Fri, 03 Jan 2014 21:26:58 +0400

 This is a multi-part message in MIME format.
 --------------010209010603090701000503
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: 8bit
 
 Please check if attached patch solves your issues.
 
 This fix is temporary, more proper one is on the way.
 
 --------------010209010603090701000503
 Content-Type: text/x-patch;
  name="radix_mpath.diff"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
  filename="radix_mpath.diff"
 
 Index: route.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 --- route.c	(revision 260226)
 +++ route.c	(working copy)
 @@ -943,9 +992,20 @@
  	register struct radix_node *rn;
  	int error =3D 0;
 =20
 -	rn =3D rnh->rnh_matchaddr(dst, rnh);
 +	rn =3D rnh->rnh_lookup(dst, netmask, rnh);
  	if (rn =3D=3D NULL)
  		return (ESRCH);
 +
 +	if (netmask =3D=3D NULL) {
 +		/*
 +		 * Check 'perfect match' case
 +		 */
 +		if (!sa_equal(dst, rn->rn_key))
 +			return (ESRCH);
 +		if (rn->rn_mask !=3D NULL)
 +			return (ESRCH);
 +	}
 +
  	rto =3D rt =3D RNTORT(rn);
  	rt =3D rt_mpath_matchgate(rt, gateway);
  	if (rt =3D=3D NULL)
 
 --------------010209010603090701000503--

From: Nikolay Denev <ndenev@gmail.com>
To: "Alexander V. Chernikov" <melifaro@freebsd.org>
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org, 
	"freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject: Re: misc/185092: panic: rtfree 2 (using RADIX_MPATH in a VNET jail)
Date: Fri, 3 Jan 2014 18:16:52 +0000

 On Fri, Jan 3, 2014 at 5:26 PM, Alexander V. Chernikov
 <melifaro@freebsd.org> wrote:
 > Please check if attached patch solves your issues.
 >
 > This fix is temporary, more proper one is on the way.
 
 Thanks Alexander, this prevent the panics I was seeing, also the
 kernel now survives the route add/delete test from my previous email.
 
 --Nikolay

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185092: commit references a PR
Date: Sat,  4 Jan 2014 22:25:35 +0000 (UTC)

 Author: melifaro
 Date: Sat Jan  4 22:25:26 2014
 New Revision: 260295
 URL: http://svnweb.freebsd.org/changeset/base/260295
 
 Log:
   Change semantics for rnh_lookup() function: now
   it performs exact match search, regardless of netmask existance.
   This simplifies most of rnh_lookup() consumers.
   
   Fix panic triggered by deleting non-existent host route.
   
   PR:		kern/185092
   Submitted by:	Nikolay Denev <ndenev at gmail.com>
   MFC after:	1 month
 
 Modified:
   head/sys/net/radix.c
   head/sys/net/radix.h
   head/sys/net/radix_mpath.c
   head/sys/net/route.c
   head/sys/net/rtsock.c
 
 Modified: head/sys/net/radix.c
 ==============================================================================
 --- head/sys/net/radix.c	Sat Jan  4 22:14:59 2014	(r260294)
 +++ head/sys/net/radix.c	Sat Jan  4 22:25:26 2014	(r260295)
 @@ -208,24 +208,50 @@ rn_refines(void *m_arg, void *n_arg)
  	return (!masks_are_equal);
  }
  
 +/*
 + * Search for exact match in given @head.
 + * Assume host bits are cleared in @v_arg if @m_arg is not NULL
 + * Note that prefixes with /32 or /128 masks are treated differently
 + * from host routes.
 + */
  struct radix_node *
  rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head)
  {
  	struct radix_node *x;
 -	caddr_t netmask = 0;
 +	caddr_t netmask;
  
 -	if (m_arg) {
 +	if (m_arg != NULL) {
 +		/*
 +		 * Most common case: search exact prefix/mask
 +		 */
  		x = rn_addmask(m_arg, head->rnh_masks, 1,
  		    head->rnh_treetop->rn_offset);
 -		if (x == 0)
 -			return (0);
 +		if (x == NULL)
 +			return (NULL);
  		netmask = x->rn_key;
 -	}
 -	x = rn_match(v_arg, head);
 -	if (x && netmask) {
 -		while (x && x->rn_mask != netmask)
 +
 +		x = rn_match(v_arg, head);
 +
 +		while (x != NULL && x->rn_mask != netmask)
  			x = x->rn_dupedkey;
 +
 +		return (x);
  	}
 +
 +	/*
 +	 * Search for host address.
 +	 */
 +	if ((x = rn_match(v_arg, head)) == NULL)
 +		return (NULL);
 +
 +	/* Check if found key is the same */
 +	if (LEN(x->rn_key) != LEN(v_arg) || bcmp(x->rn_key, v_arg, LEN(v_arg)))
 +		return (NULL);
 +
 +	/* Check if this is not host route */
 +	if (x->rn_mask != NULL)
 +		return (NULL);
 +
  	return (x);
  }
  
 @@ -247,6 +273,9 @@ rn_satisfies_leaf(char *trial, struct ra
  	return (1);
  }
  
 +/*
 + * Search for longest-prefix match in given @head
 + */
  struct radix_node *
  rn_match(void *v_arg, struct radix_node_head *head)
  {
 
 Modified: head/sys/net/radix.h
 ==============================================================================
 --- head/sys/net/radix.h	Sat Jan  4 22:14:59 2014	(r260294)
 +++ head/sys/net/radix.h	Sat Jan  4 22:25:26 2014	(r260295)
 @@ -112,9 +112,9 @@ struct radix_node_head {
  		     struct radix_node_head *head, struct radix_node nodes[]);
  	struct	radix_node *(*rnh_deladdr)	/* remove based on sockaddr */
  		(void *v, void *mask, struct radix_node_head *head);
 -	struct	radix_node *(*rnh_matchaddr)	/* locate based on sockaddr */
 +	struct	radix_node *(*rnh_matchaddr)	/* longest match for sockaddr */
  		(void *v, struct radix_node_head *head);
 -	struct	radix_node *(*rnh_lookup)	/* locate based on sockaddr */
 +	struct	radix_node *(*rnh_lookup)	/*exact match for sockaddr*/
  		(void *v, void *mask, struct radix_node_head *head);
  	int	(*rnh_walktree)			/* traverse tree */
  		(struct radix_node_head *head, walktree_f_t *f, void *w);
 
 Modified: head/sys/net/radix_mpath.c
 ==============================================================================
 --- head/sys/net/radix_mpath.c	Sat Jan  4 22:14:59 2014	(r260294)
 +++ head/sys/net/radix_mpath.c	Sat Jan  4 22:25:26 2014	(r260295)
 @@ -151,6 +151,7 @@ rt_mpath_deldup(struct rtentry *headrt, 
  
  /*
   * check if we have the same key/mask/gateway on the table already.
 + * Assume @rt rt_key host bits are cleared according to @netmask
   */
  int
  rt_mpath_conflict(struct radix_node_head *rnh, struct rtentry *rt,
 @@ -158,76 +159,13 @@ rt_mpath_conflict(struct radix_node_head
  {
  	struct radix_node *rn, *rn1;
  	struct rtentry *rt1;
 -	char *p, *q, *eq;
 -	int same, l, skip;
  
  	rn = (struct radix_node *)rt;
  	rn1 = rnh->rnh_lookup(rt_key(rt), netmask, rnh);
  	if (!rn1 || rn1->rn_flags & RNF_ROOT)
 -		return 0;
 -
 -	/*
 -	 * unlike other functions we have in this file, we have to check
 -	 * all key/mask/gateway as rnh_lookup can match less specific entry.
 -	 */
 -	rt1 = (struct rtentry *)rn1;
 -
 -	/* compare key. */
 -	if (rt_key(rt1)->sa_len != rt_key(rt)->sa_len ||
 -	    bcmp(rt_key(rt1), rt_key(rt), rt_key(rt1)->sa_len))
 -		goto different;
 -
 -	/* key was the same.  compare netmask.  hairy... */
 -	if (rt_mask(rt1) && netmask) {
 -		skip = rnh->rnh_treetop->rn_offset;
 -		if (rt_mask(rt1)->sa_len > netmask->sa_len) {
 -			/*
 -			 * as rt_mask(rt1) is made optimal by radix.c,
 -			 * there must be some 1-bits on rt_mask(rt1)
 -			 * after netmask->sa_len.  therefore, in
 -			 * this case, the entries are different.
 -			 */
 -			if (rt_mask(rt1)->sa_len > skip)
 -				goto different;
 -			else {
 -				/* no bits to compare, i.e. same*/
 -				goto maskmatched;
 -			}
 -		}
 -
 -		l = rt_mask(rt1)->sa_len;
 -		if (skip > l) {
 -			/* no bits to compare, i.e. same */
 -			goto maskmatched;
 -		}
 -		p = (char *)rt_mask(rt1);
 -		q = (char *)netmask;
 -		if (bcmp(p + skip, q + skip, l - skip))
 -			goto different;
 -		/*
 -		 * need to go through all the bit, as netmask is not
 -		 * optimal and can contain trailing 0s
 -		 */
 -		eq = (char *)netmask + netmask->sa_len;
 -		q += l;
 -		same = 1;
 -		while (eq > q)
 -			if (*q++) {
 -				same = 0;
 -				break;
 -			}
 -		if (!same)
 -			goto different;
 -	} else if (!rt_mask(rt1) && !netmask)
 -		; /* no mask to compare, i.e. same */
 -	else {
 -		/* one has mask and the other does not, different */
 -		goto different;
 -	}
 -
 -maskmatched:
 +		return (0);
  
 -	/* key/mask were the same.  compare gateway for all multipaths */
 +	/* key/mask are the same. compare gateway for all multipaths */
  	do {
  		rt1 = (struct rtentry *)rn1;
  
 @@ -248,11 +186,10 @@ maskmatched:
  		}
  
  		/* all key/mask/gateway are the same.  conflicting entry. */
 -		return EEXIST;
 +		return (EEXIST);
  	} while ((rn1 = rn_mpath_next(rn1)) != NULL);
  
 -different:
 -	return 0;
 +	return (0);
  }
  
  void
 
 Modified: head/sys/net/route.c
 ==============================================================================
 --- head/sys/net/route.c	Sat Jan  4 22:14:59 2014	(r260294)
 +++ head/sys/net/route.c	Sat Jan  4 22:25:26 2014	(r260295)
 @@ -930,6 +930,57 @@ bad:
  	return (error);
  }
  
 +#if 0
 +int p_sockaddr(char *buf, int buflen, struct sockaddr *s);
 +int rt_print(char *buf, int buflen, struct rtentry *rt);
 +
 +int
 +p_sockaddr(char *buf, int buflen, struct sockaddr *s)
 +{
 +	void *paddr = NULL;
 +
 +	switch (s->sa_family) {
 +	case AF_INET:
 +		paddr = &((struct sockaddr_in *)s)->sin_addr;
 +		break;
 +	case AF_INET6:
 +		paddr = &((struct sockaddr_in6 *)s)->sin6_addr;
 +		break;
 +	}
 +
 +	if (paddr == NULL)
 +		return (0);
 +
 +	if (inet_ntop(s->sa_family, paddr, buf, buflen) == NULL)
 +		return (0);
 +	
 +	return (strlen(buf));
 +}
 +
 +int
 +rt_print(char *buf, int buflen, struct rtentry *rt)
 +{
 +	struct sockaddr *addr, *mask;
 +	int i = 0;
 +
 +	addr = rt_key(rt);
 +	mask = rt_mask(rt);
 +
 +	i = p_sockaddr(buf, buflen, addr);
 +	if (!(rt->rt_flags & RTF_HOST)) {
 +		buf[i++] = '/';
 +		i += p_sockaddr(buf + i, buflen - i, mask);
 +	}
 +
 +	if (rt->rt_flags & RTF_GATEWAY) {
 +		buf[i++] = '>';
 +		i += p_sockaddr(buf + i, buflen - i, rt->rt_gateway);
 +	}
 +
 +	return (i);
 +}
 +#endif
 +
  #ifdef RADIX_MPATH
  static int
  rn_mpath_update(int req, struct rt_addrinfo *info,
 @@ -943,10 +994,11 @@ rn_mpath_update(int req, struct rt_addri
  	register struct radix_node *rn;
  	int error = 0;
  
 -	rn = rnh->rnh_matchaddr(dst, rnh);
 +	rn = rnh->rnh_lookup(dst, netmask, rnh);
  	if (rn == NULL)
  		return (ESRCH);
  	rto = rt = RNTORT(rn);
 +
  	rt = rt_mpath_matchgate(rt, gateway);
  	if (rt == NULL)
  		return (ESRCH);
 @@ -1521,8 +1573,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int
  			rn = rnh->rnh_lookup(dst, netmask, rnh);
  			error = (rn == NULL ||
  			    (rn->rn_flags & RNF_ROOT) ||
 -			    RNTORT(rn)->rt_ifa != ifa ||
 -			    !sa_equal((struct sockaddr *)rn->rn_key, dst));
 +			    RNTORT(rn)->rt_ifa != ifa);
  			RADIX_NODE_HEAD_RUNLOCK(rnh);
  			if (error) {
  				/* this is only an error if bad on ALL tables */
 
 Modified: head/sys/net/rtsock.c
 ==============================================================================
 --- head/sys/net/rtsock.c	Sat Jan  4 22:14:59 2014	(r260294)
 +++ head/sys/net/rtsock.c	Sat Jan  4 22:25:26 2014	(r260295)
 @@ -727,10 +727,24 @@ route_output(struct mbuf *m, struct sock
  		    info.rti_info[RTAX_DST]->sa_family);
  		if (rnh == NULL)
  			senderr(EAFNOSUPPORT);
 +
  		RADIX_NODE_HEAD_RLOCK(rnh);
 -		rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST],
 -			info.rti_info[RTAX_NETMASK], rnh);
 -		if (rt == NULL) {	/* XXX looks bogus */
 +
 +		if (info.rti_info[RTAX_NETMASK] == NULL &&
 +		    rtm->rtm_type == RTM_GET) {
 +			/*
 +			 * Provide logest prefix match for
 +			 * address lookup (no mask).
 +			 * 'route -n get addr'
 +			 */
 +			rt = (struct rtentry *) rnh->rnh_matchaddr(
 +			    info.rti_info[RTAX_DST], rnh);
 +		} else
 +			rt = (struct rtentry *) rnh->rnh_lookup(
 +			    info.rti_info[RTAX_DST],
 +			    info.rti_info[RTAX_NETMASK], rnh);
 +
 +		if (rt == NULL) {
  			RADIX_NODE_HEAD_RUNLOCK(rnh);
  			senderr(ESRCH);
  		}
 @@ -787,25 +801,6 @@ route_output(struct mbuf *m, struct sock
  		RT_ADDREF(rt);
  		RADIX_NODE_HEAD_RUNLOCK(rnh);
  
 -		/* 
 -		 * Fix for PR: 82974
 -		 *
 -		 * RTM_CHANGE/LOCK need a perfect match, rn_lookup()
 -		 * returns a perfect match in case a netmask is
 -		 * specified.  For host routes only a longest prefix
 -		 * match is returned so it is necessary to compare the
 -		 * existence of the netmask.  If both have a netmask
 -		 * rnh_lookup() did a perfect match and if none of them
 -		 * have a netmask both are host routes which is also a
 -		 * perfect match.
 -		 */
 -
 -		if (rtm->rtm_type != RTM_GET && 
 -		    (!rt_mask(rt) != !info.rti_info[RTAX_NETMASK])) {
 -			RT_UNLOCK(rt);
 -			senderr(ESRCH);
 -		}
 -
  		switch(rtm->rtm_type) {
  
  		case RTM_GET:
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Sun Apr 20 01:48:45 UTC 2014 
State-Changed-Why:  
over to committer as possible MFC remidner. 


Responsible-Changed-From-To: melifaro->melifaro 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Apr 20 01:48:45 UTC 2014 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=185092 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185092: commit references a PR
Date: Thu,  8 May 2014 20:27:12 +0000 (UTC)

 Author: melifaro
 Date: Thu May  8 20:27:06 2014
 New Revision: 265708
 URL: http://svnweb.freebsd.org/changeset/base/265708
 
 Log:
   Merge r259528, r259528, r260295.
   
   r259528:
     Simplify contiguous mask checking.
   
     Suggested by: glebius
   
   r260228:
     Remove useless register variable modifiers.
     Do some more style(9).
   
   r260295:
     Change semantics for rnh_lookup() function: now
     it performs exact match search, regardless of netmask existance.
     This simplifies most of rnh_lookup() consumers.
   
     Fix panic triggered by deleting non-existent host route.
   
     PR:           kern/185092
     Submitted by: Nikolay Denev <ndenev at gmail.com>
 
 Modified:
   stable/10/sys/net/radix.c
   stable/10/sys/net/radix.h
   stable/10/sys/net/radix_mpath.c
   stable/10/sys/net/route.c
   stable/10/sys/net/rtsock.c
 Directory Properties:
   stable/10/   (props changed)
 
 Modified: stable/10/sys/net/radix.c
 ==============================================================================
 --- stable/10/sys/net/radix.c	Thu May  8 20:24:13 2014	(r265707)
 +++ stable/10/sys/net/radix.c	Thu May  8 20:27:06 2014	(r265708)
 @@ -156,12 +156,10 @@ static int	rn_satisfies_leaf(char *trial
   * Search a node in the tree matching the key.
   */
  static struct radix_node *
 -rn_search(v_arg, head)
 -	void *v_arg;
 -	struct radix_node *head;
 +rn_search(void *v_arg, struct radix_node *head)
  {
 -	register struct radix_node *x;
 -	register caddr_t v;
 +	struct radix_node *x;
 +	caddr_t v;
  
  	for (x = head, v = v_arg; x->rn_bit >= 0;) {
  		if (x->rn_bmask & v[x->rn_offset])
 @@ -177,12 +175,10 @@ rn_search(v_arg, head)
   * XXX note this function is used only once.
   */
  static struct radix_node *
 -rn_search_m(v_arg, head, m_arg)
 -	struct radix_node *head;
 -	void *v_arg, *m_arg;
 +rn_search_m(void *v_arg, struct radix_node *head, void *m_arg)
  {
 -	register struct radix_node *x;
 -	register caddr_t v = v_arg, m = m_arg;
 +	struct radix_node *x;
 +	caddr_t v = v_arg, m = m_arg;
  
  	for (x = head; x->rn_bit >= 0;) {
  		if ((x->rn_bmask & m[x->rn_offset]) &&
 @@ -191,15 +187,14 @@ rn_search_m(v_arg, head, m_arg)
  		else
  			x = x->rn_left;
  	}
 -	return x;
 +	return (x);
  }
  
  int
 -rn_refines(m_arg, n_arg)
 -	void *m_arg, *n_arg;
 +rn_refines(void *m_arg, void *n_arg)
  {
 -	register caddr_t m = m_arg, n = n_arg;
 -	register caddr_t lim, lim2 = lim = n + LEN(n);
 +	caddr_t m = m_arg, n = n_arg;
 +	caddr_t lim, lim2 = lim = n + LEN(n);
  	int longer = LEN(n++) - LEN(m++);
  	int masks_are_equal = 1;
  
 @@ -207,50 +202,71 @@ rn_refines(m_arg, n_arg)
  		lim -= longer;
  	while (n < lim) {
  		if (*n & ~(*m))
 -			return 0;
 +			return (0);
  		if (*n++ != *m++)
  			masks_are_equal = 0;
  	}
  	while (n < lim2)
  		if (*n++)
 -			return 0;
 +			return (0);
  	if (masks_are_equal && (longer < 0))
  		for (lim2 = m - longer; m < lim2; )
  			if (*m++)
 -				return 1;
 +				return (1);
  	return (!masks_are_equal);
  }
  
 +/*
 + * Search for exact match in given @head.
 + * Assume host bits are cleared in @v_arg if @m_arg is not NULL
 + * Note that prefixes with /32 or /128 masks are treated differently
 + * from host routes.
 + */
  struct radix_node *
 -rn_lookup(v_arg, m_arg, head)
 -	void *v_arg, *m_arg;
 -	struct radix_node_head *head;
 +rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head)
  {
 -	register struct radix_node *x;
 -	caddr_t netmask = 0;
 +	struct radix_node *x;
 +	caddr_t netmask;
  
 -	if (m_arg) {
 +	if (m_arg != NULL) {
 +		/*
 +		 * Most common case: search exact prefix/mask
 +		 */
  		x = rn_addmask_r(m_arg, head->rnh_masks, 1,
  		    head->rnh_treetop->rn_offset);
 -		if (x == 0)
 -			return (0);
 +		if (x == NULL)
 +			return (NULL);
  		netmask = x->rn_key;
 -	}
 -	x = rn_match(v_arg, head);
 -	if (x && netmask) {
 -		while (x && x->rn_mask != netmask)
 +
 +		x = rn_match(v_arg, head);
 +
 +		while (x != NULL && x->rn_mask != netmask)
  			x = x->rn_dupedkey;
 +
 +		return (x);
  	}
 -	return x;
 +
 +	/*
 +	 * Search for host address.
 +	 */
 +	if ((x = rn_match(v_arg, head)) == NULL)
 +		return (NULL);
 +
 +	/* Check if found key is the same */
 +	if (LEN(x->rn_key) != LEN(v_arg) || bcmp(x->rn_key, v_arg, LEN(v_arg)))
 +		return (NULL);
 +
 +	/* Check if this is not host route */
 +	if (x->rn_mask != NULL)
 +		return (NULL);
 +
 +	return (x);
  }
  
  static int
 -rn_satisfies_leaf(trial, leaf, skip)
 -	char *trial;
 -	register struct radix_node *leaf;
 -	int skip;
 +rn_satisfies_leaf(char *trial, struct radix_node *leaf, int skip)
  {
 -	register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
 +	char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
  	char *cplim;
  	int length = min(LEN(cp), LEN(cp2));
  
 @@ -261,22 +277,23 @@ rn_satisfies_leaf(trial, leaf, skip)
  	cplim = cp + length; cp3 += skip; cp2 += skip;
  	for (cp += skip; cp < cplim; cp++, cp2++, cp3++)
  		if ((*cp ^ *cp2) & *cp3)
 -			return 0;
 -	return 1;
 +			return (0);
 +	return (1);
  }
  
 +/*
 + * Search for longest-prefix match in given @head
 + */
  struct radix_node *
 -rn_match(v_arg, head)
 -	void *v_arg;
 -	struct radix_node_head *head;
 +rn_match(void *v_arg, struct radix_node_head *head)
  {
  	caddr_t v = v_arg;
 -	register struct radix_node *t = head->rnh_treetop, *x;
 -	register caddr_t cp = v, cp2;
 +	struct radix_node *t = head->rnh_treetop, *x;
 +	caddr_t cp = v, cp2;
  	caddr_t cplim;
  	struct radix_node *saved_t, *top = t;
  	int off = t->rn_offset, vlen = LEN(cp), matched_off;
 -	register int test, b, rn_bit;
 +	int test, b, rn_bit;
  
  	/*
  	 * Open code rn_search(v, top) to avoid overhead of extra
 @@ -314,7 +331,7 @@ rn_match(v_arg, head)
  	 */
  	if (t->rn_flags & RNF_ROOT)
  		t = t->rn_dupedkey;
 -	return t;
 +	return (t);
  on1:
  	test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */
  	for (b = 7; (test >>= 1) > 0;)
 @@ -335,13 +352,13 @@ on1:
  		 */
  		if (t->rn_flags & RNF_NORMAL) {
  			if (rn_bit <= t->rn_bit)
 -				return t;
 +				return (t);
  		} else if (rn_satisfies_leaf(v, t, matched_off))
 -				return t;
 +				return (t);
  	t = saved_t;
  	/* start searching up the tree */
  	do {
 -		register struct radix_mask *m;
 +		struct radix_mask *m;
  		t = t->rn_parent;
  		m = t->rn_mklist;
  		/*
 @@ -360,12 +377,12 @@ on1:
  				while (x && x->rn_mask != m->rm_mask)
  					x = x->rn_dupedkey;
  				if (x && rn_satisfies_leaf(v, x, off))
 -					return x;
 +					return (x);
  			}
  			m = m->rm_mklist;
  		}
  	} while (t != top);
 -	return 0;
 +	return (0);
  }
  
  #ifdef RN_DEBUG
 @@ -387,12 +404,9 @@ int	rn_debug =  1;
   */
  
  static struct radix_node *
 -rn_newpair(v, b, nodes)
 -	void *v;
 -	int b;
 -	struct radix_node nodes[2];
 +rn_newpair(void *v, int b, struct radix_node nodes[2])
  {
 -	register struct radix_node *tt = nodes, *t = tt + 1;
 +	struct radix_node *tt = nodes, *t = tt + 1;
  	t->rn_bit = b;
  	t->rn_bmask = 0x80 >> (b & 7);
  	t->rn_left = tt;
 @@ -416,44 +430,39 @@ rn_newpair(v, b, nodes)
  	tt->rn_ybro = rn_clist;
  	rn_clist = tt;
  #endif
 -	return t;
 +	return (t);
  }
  
  static struct radix_node *
 -rn_insert(v_arg, head, dupentry, nodes)
 -	void *v_arg;
 -	struct radix_node_head *head;
 -	int *dupentry;
 -	struct radix_node nodes[2];
 +rn_insert(void *v_arg, struct radix_node_head *head, int *dupentry,
 +    struct radix_node nodes[2])
  {
  	caddr_t v = v_arg;
  	struct radix_node *top = head->rnh_treetop;
  	int head_off = top->rn_offset, vlen = LEN(v);
 -	register struct radix_node *t = rn_search(v_arg, top);
 -	register caddr_t cp = v + head_off;
 -	register int b;
 -	struct radix_node *tt;
 +	struct radix_node *t = rn_search(v_arg, top);
 +	caddr_t cp = v + head_off;
 +	int b;
 +	struct radix_node *p, *tt, *x;
      	/*
  	 * Find first bit at which v and t->rn_key differ
  	 */
 -    {
 -	register caddr_t cp2 = t->rn_key + head_off;
 -	register int cmp_res;
 +	caddr_t cp2 = t->rn_key + head_off;
 +	int cmp_res;
  	caddr_t cplim = v + vlen;
  
  	while (cp < cplim)
  		if (*cp2++ != *cp++)
  			goto on1;
  	*dupentry = 1;
 -	return t;
 +	return (t);
  on1:
  	*dupentry = 0;
  	cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;
  	for (b = (cp - v) << 3; cmp_res; b--)
  		cmp_res >>= 1;
 -    }
 -    {
 -	register struct radix_node *p, *x = top;
 +
 +	x = top;
  	cp = v;
  	do {
  		p = x;
 @@ -485,20 +494,19 @@ on1:
  	if (rn_debug)
  		log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p);
  #endif
 -    }
  	return (tt);
  }
  
  struct radix_node *
  rn_addmask_r(void *arg, struct radix_node_head *maskhead, int search, int skip)
  {
 -	caddr_t netmask = (caddr_t)arg;
 -	register struct radix_node *x;
 -	register caddr_t cp, cplim;
 -	register int b = 0, mlen, j;
 +	unsigned char *netmask = arg;
 +	unsigned char *cp, *cplim;
 +	struct radix_node *x;
 +	int b = 0, mlen, j;
  	int maskduplicated, isnormal;
  	struct radix_node *saved_x;
 -	char addmask_key[RADIX_MAX_KEY_LEN];
 +	unsigned char addmask_key[RADIX_MAX_KEY_LEN];
  
  	if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN)
  		mlen = RADIX_MAX_KEY_LEN;
 @@ -540,20 +548,18 @@ rn_addmask_r(void *arg, struct radix_nod
  	 * Calculate index of mask, and check for normalcy.
  	 * First find the first byte with a 0 bit, then if there are
  	 * more bits left (remember we already trimmed the trailing 0's),
 -	 * the pattern must be one of those in normal_chars[], or we have
 +	 * the bits should be contiguous, otherwise we have got
  	 * a non-contiguous mask.
  	 */
 +#define	CONTIG(_c)	(((~(_c) + 1) & (_c)) == (unsigned char)(~(_c) + 1))
  	cplim = netmask + mlen;
  	isnormal = 1;
  	for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;)
  		cp++;
  	if (cp != cplim) {
 -		static char normal_chars[] = {
 -			0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff};
 -
  		for (j = 0x80; (j & *cp) != 0; j >>= 1)
  			b++;
 -		if (*cp != normal_chars[b] || cp != (cplim - 1))
 +		if (!CONTIG(*cp) || cp != (cplim - 1))
  			isnormal = 0;
  	}
  	b += (cp - netmask) << 3;
 @@ -581,29 +587,26 @@ rn_addmask(void *n_arg, int search, int 
  }
  
  static int	/* XXX: arbitrary ordering for non-contiguous masks */
 -rn_lexobetter(m_arg, n_arg)
 -	void *m_arg, *n_arg;
 +rn_lexobetter(void *m_arg, void *n_arg)
  {
 -	register u_char *mp = m_arg, *np = n_arg, *lim;
 +	u_char *mp = m_arg, *np = n_arg, *lim;
  
  	if (LEN(mp) > LEN(np))
 -		return 1;  /* not really, but need to check longer one first */
 +		return (1);  /* not really, but need to check longer one first */
  	if (LEN(mp) == LEN(np))
  		for (lim = mp + LEN(mp); mp < lim;)
  			if (*mp++ > *np++)
 -				return 1;
 -	return 0;
 +				return (1);
 +	return (0);
  }
  
  static struct radix_mask *
 -rn_new_radix_mask(tt, next)
 -	register struct radix_node *tt;
 -	register struct radix_mask *next;
 +rn_new_radix_mask(struct radix_node *tt, struct radix_mask *next)
  {
 -	register struct radix_mask *m;
 +	struct radix_mask *m;
  
  	R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask));
 -	if (m == 0) {
 +	if (m == NULL) {
  		log(LOG_ERR, "Failed to allocate route mask\n");
  		return (0);
  	}
 @@ -616,17 +619,15 @@ rn_new_radix_mask(tt, next)
  		m->rm_mask = tt->rn_mask;
  	m->rm_mklist = next;
  	tt->rn_mklist = m;
 -	return m;
 +	return (m);
  }
  
  struct radix_node *
 -rn_addroute(v_arg, n_arg, head, treenodes)
 -	void *v_arg, *n_arg;
 -	struct radix_node_head *head;
 -	struct radix_node treenodes[2];
 +rn_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
 +    struct radix_node treenodes[2])
  {
  	caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
 -	register struct radix_node *t, *x = 0, *tt;
 +	struct radix_node *t, *x = 0, *tt;
  	struct radix_node *saved_tt, *top = head->rnh_treetop;
  	short b = 0, b_leaf = 0;
  	int keyduplicated;
 @@ -754,7 +755,7 @@ rn_addroute(v_arg, n_arg, head, treenode
  on2:
  	/* Add new route to highest possible ancestor's list */
  	if ((netmask == 0) || (b > t->rn_bit ))
 -		return tt; /* can't lift at all */
 +		return (tt); /* can't lift at all */
  	b_leaf = tt->rn_bit;
  	do {
  		x = t;
 @@ -778,29 +779,27 @@ on2:
  			    log(LOG_ERR,
  			        "Non-unique normal route, mask not entered\n");
  #endif
 -				return tt;
 +				return (tt);
  			}
  		} else
  			mmask = m->rm_mask;
  		if (mmask == netmask) {
  			m->rm_refs++;
  			tt->rn_mklist = m;
 -			return tt;
 +			return (tt);
  		}
  		if (rn_refines(netmask, mmask)
  		    || rn_lexobetter(netmask, mmask))
  			break;
  	}
  	*mp = rn_new_radix_mask(tt, *mp);
 -	return tt;
 +	return (tt);
  }
  
  struct radix_node *
 -rn_delete(v_arg, netmask_arg, head)
 -	void *v_arg, *netmask_arg;
 -	struct radix_node_head *head;
 +rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head)
  {
 -	register struct radix_node *t, *p, *x, *tt;
 +	struct radix_node *t, *p, *x, *tt;
  	struct radix_mask *m, *saved_m, **mp;
  	struct radix_node *dupedkey, *saved_tt, *top;
  	caddr_t v, netmask;
 @@ -834,7 +833,7 @@ rn_delete(v_arg, netmask_arg, head)
  	if (tt->rn_flags & RNF_NORMAL) {
  		if (m->rm_leaf != tt || m->rm_refs > 0) {
  			log(LOG_ERR, "rn_delete: inconsistent annotation\n");
 -			return 0;  /* dangling ref could cause disaster */
 +			return (0);  /* dangling ref could cause disaster */
  		}
  	} else {
  		if (m->rm_mask != tt->rn_mask) {
 @@ -986,17 +985,14 @@ out:
   * exit.
   */
  static int
 -rn_walktree_from(h, a, m, f, w)
 -	struct radix_node_head *h;
 -	void *a, *m;
 -	walktree_f_t *f;
 -	void *w;
 +rn_walktree_from(struct radix_node_head *h, void *a, void *m,
 +    walktree_f_t *f, void *w)
  {
  	int error;
  	struct radix_node *base, *next;
  	u_char *xa = (u_char *)a;
  	u_char *xm = (u_char *)m;
 -	register struct radix_node *rn, *last = 0 /* shut up gcc */;
 +	struct radix_node *rn, *last = NULL; /* shut up gcc */
  	int stopping = 0;
  	int lastb;
  
 @@ -1089,18 +1085,15 @@ rn_walktree_from(h, a, m, f, w)
  		}
  
  	}
 -	return 0;
 +	return (0);
  }
  
  static int
 -rn_walktree(h, f, w)
 -	struct radix_node_head *h;
 -	walktree_f_t *f;
 -	void *w;
 +rn_walktree(struct radix_node_head *h, walktree_f_t *f, void *w)
  {
  	int error;
  	struct radix_node *base, *next;
 -	register struct radix_node *rn = h->rnh_treetop;
 +	struct radix_node *rn = h->rnh_treetop;
  	/*
  	 * This gets complicated because we may delete the node
  	 * while applying the function f to it, so we need to calculate
 @@ -1145,8 +1138,8 @@ rn_walktree(h, f, w)
  static int
  rn_inithead_internal(void **head, int off)
  {
 -	register struct radix_node_head *rnh;
 -	register struct radix_node *t, *tt, *ttt;
 +	struct radix_node_head *rnh;
 +	struct radix_node *t, *tt, *ttt;
  	if (*head)
  		return (1);
  	R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh));
 
 Modified: stable/10/sys/net/radix.h
 ==============================================================================
 --- stable/10/sys/net/radix.h	Thu May  8 20:24:13 2014	(r265707)
 +++ stable/10/sys/net/radix.h	Thu May  8 20:27:06 2014	(r265708)
 @@ -119,9 +119,9 @@ struct radix_node_head {
  		(void *v, void *mask, struct radix_node_head *head);
  	struct	radix_node *(*rnh_delpkt)	/* remove based on packet hdr */
  		(void *v, void *mask, struct radix_node_head *head);
 -	struct	radix_node *(*rnh_matchaddr)	/* locate based on sockaddr */
 +	struct	radix_node *(*rnh_matchaddr)	/* longest match for sockaddr */
  		(void *v, struct radix_node_head *head);
 -	struct	radix_node *(*rnh_lookup)	/* locate based on sockaddr */
 +	struct	radix_node *(*rnh_lookup)	/*exact match for sockaddr*/
  		(void *v, void *mask, struct radix_node_head *head);
  	struct	radix_node *(*rnh_matchpkt)	/* locate based on packet hdr */
  		(void *v, struct radix_node_head *head);
 
 Modified: stable/10/sys/net/radix_mpath.c
 ==============================================================================
 --- stable/10/sys/net/radix_mpath.c	Thu May  8 20:24:13 2014	(r265707)
 +++ stable/10/sys/net/radix_mpath.c	Thu May  8 20:27:06 2014	(r265708)
 @@ -151,6 +151,7 @@ rt_mpath_deldup(struct rtentry *headrt, 
  
  /*
   * check if we have the same key/mask/gateway on the table already.
 + * Assume @rt rt_key host bits are cleared according to @netmask
   */
  int
  rt_mpath_conflict(struct radix_node_head *rnh, struct rtentry *rt,
 @@ -158,76 +159,13 @@ rt_mpath_conflict(struct radix_node_head
  {
  	struct radix_node *rn, *rn1;
  	struct rtentry *rt1;
 -	char *p, *q, *eq;
 -	int same, l, skip;
  
  	rn = (struct radix_node *)rt;
  	rn1 = rnh->rnh_lookup(rt_key(rt), netmask, rnh);
  	if (!rn1 || rn1->rn_flags & RNF_ROOT)
 -		return 0;
 -
 -	/*
 -	 * unlike other functions we have in this file, we have to check
 -	 * all key/mask/gateway as rnh_lookup can match less specific entry.
 -	 */
 -	rt1 = (struct rtentry *)rn1;
 -
 -	/* compare key. */
 -	if (rt_key(rt1)->sa_len != rt_key(rt)->sa_len ||
 -	    bcmp(rt_key(rt1), rt_key(rt), rt_key(rt1)->sa_len))
 -		goto different;
 -
 -	/* key was the same.  compare netmask.  hairy... */
 -	if (rt_mask(rt1) && netmask) {
 -		skip = rnh->rnh_treetop->rn_offset;
 -		if (rt_mask(rt1)->sa_len > netmask->sa_len) {
 -			/*
 -			 * as rt_mask(rt1) is made optimal by radix.c,
 -			 * there must be some 1-bits on rt_mask(rt1)
 -			 * after netmask->sa_len.  therefore, in
 -			 * this case, the entries are different.
 -			 */
 -			if (rt_mask(rt1)->sa_len > skip)
 -				goto different;
 -			else {
 -				/* no bits to compare, i.e. same*/
 -				goto maskmatched;
 -			}
 -		}
 -
 -		l = rt_mask(rt1)->sa_len;
 -		if (skip > l) {
 -			/* no bits to compare, i.e. same */
 -			goto maskmatched;
 -		}
 -		p = (char *)rt_mask(rt1);
 -		q = (char *)netmask;
 -		if (bcmp(p + skip, q + skip, l - skip))
 -			goto different;
 -		/*
 -		 * need to go through all the bit, as netmask is not
 -		 * optimal and can contain trailing 0s
 -		 */
 -		eq = (char *)netmask + netmask->sa_len;
 -		q += l;
 -		same = 1;
 -		while (eq > q)
 -			if (*q++) {
 -				same = 0;
 -				break;
 -			}
 -		if (!same)
 -			goto different;
 -	} else if (!rt_mask(rt1) && !netmask)
 -		; /* no mask to compare, i.e. same */
 -	else {
 -		/* one has mask and the other does not, different */
 -		goto different;
 -	}
 -
 -maskmatched:
 +		return (0);
  
 -	/* key/mask were the same.  compare gateway for all multipaths */
 +	/* key/mask are the same. compare gateway for all multipaths */
  	do {
  		rt1 = (struct rtentry *)rn1;
  
 @@ -248,11 +186,10 @@ maskmatched:
  		}
  
  		/* all key/mask/gateway are the same.  conflicting entry. */
 -		return EEXIST;
 +		return (EEXIST);
  	} while ((rn1 = rn_mpath_next(rn1)) != NULL);
  
 -different:
 -	return 0;
 +	return (0);
  }
  
  void
 
 Modified: stable/10/sys/net/route.c
 ==============================================================================
 --- stable/10/sys/net/route.c	Thu May  8 20:24:13 2014	(r265707)
 +++ stable/10/sys/net/route.c	Thu May  8 20:27:06 2014	(r265708)
 @@ -979,6 +979,57 @@ bad:
  	return (error);
  }
  
 +#if 0
 +int p_sockaddr(char *buf, int buflen, struct sockaddr *s);
 +int rt_print(char *buf, int buflen, struct rtentry *rt);
 +
 +int
 +p_sockaddr(char *buf, int buflen, struct sockaddr *s)
 +{
 +	void *paddr = NULL;
 +
 +	switch (s->sa_family) {
 +	case AF_INET:
 +		paddr = &((struct sockaddr_in *)s)->sin_addr;
 +		break;
 +	case AF_INET6:
 +		paddr = &((struct sockaddr_in6 *)s)->sin6_addr;
 +		break;
 +	}
 +
 +	if (paddr == NULL)
 +		return (0);
 +
 +	if (inet_ntop(s->sa_family, paddr, buf, buflen) == NULL)
 +		return (0);
 +	
 +	return (strlen(buf));
 +}
 +
 +int
 +rt_print(char *buf, int buflen, struct rtentry *rt)
 +{
 +	struct sockaddr *addr, *mask;
 +	int i = 0;
 +
 +	addr = rt_key(rt);
 +	mask = rt_mask(rt);
 +
 +	i = p_sockaddr(buf, buflen, addr);
 +	if (!(rt->rt_flags & RTF_HOST)) {
 +		buf[i++] = '/';
 +		i += p_sockaddr(buf + i, buflen - i, mask);
 +	}
 +
 +	if (rt->rt_flags & RTF_GATEWAY) {
 +		buf[i++] = '>';
 +		i += p_sockaddr(buf + i, buflen - i, rt->rt_gateway);
 +	}
 +
 +	return (i);
 +}
 +#endif
 +
  #ifdef RADIX_MPATH
  static int
  rn_mpath_update(int req, struct rt_addrinfo *info,
 @@ -992,10 +1043,11 @@ rn_mpath_update(int req, struct rt_addri
  	register struct radix_node *rn;
  	int error = 0;
  
 -	rn = rnh->rnh_matchaddr(dst, rnh);
 +	rn = rnh->rnh_lookup(dst, netmask, rnh);
  	if (rn == NULL)
  		return (ESRCH);
  	rto = rt = RNTORT(rn);
 +
  	rt = rt_mpath_matchgate(rt, gateway);
  	if (rt == NULL)
  		return (ESRCH);
 @@ -1555,8 +1607,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int
  			rn = rnh->rnh_lookup(dst, netmask, rnh);
  			error = (rn == NULL ||
  			    (rn->rn_flags & RNF_ROOT) ||
 -			    RNTORT(rn)->rt_ifa != ifa ||
 -			    !sa_equal((struct sockaddr *)rn->rn_key, dst));
 +			    RNTORT(rn)->rt_ifa != ifa);
  			RADIX_NODE_HEAD_RUNLOCK(rnh);
  			if (error) {
  				/* this is only an error if bad on ALL tables */
 
 Modified: stable/10/sys/net/rtsock.c
 ==============================================================================
 --- stable/10/sys/net/rtsock.c	Thu May  8 20:24:13 2014	(r265707)
 +++ stable/10/sys/net/rtsock.c	Thu May  8 20:27:06 2014	(r265708)
 @@ -725,10 +725,24 @@ route_output(struct mbuf *m, struct sock
  		    info.rti_info[RTAX_DST]->sa_family);
  		if (rnh == NULL)
  			senderr(EAFNOSUPPORT);
 +
  		RADIX_NODE_HEAD_RLOCK(rnh);
 -		rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST],
 -			info.rti_info[RTAX_NETMASK], rnh);
 -		if (rt == NULL) {	/* XXX looks bogus */
 +
 +		if (info.rti_info[RTAX_NETMASK] == NULL &&
 +		    rtm->rtm_type == RTM_GET) {
 +			/*
 +			 * Provide logest prefix match for
 +			 * address lookup (no mask).
 +			 * 'route -n get addr'
 +			 */
 +			rt = (struct rtentry *) rnh->rnh_matchaddr(
 +			    info.rti_info[RTAX_DST], rnh);
 +		} else
 +			rt = (struct rtentry *) rnh->rnh_lookup(
 +			    info.rti_info[RTAX_DST],
 +			    info.rti_info[RTAX_NETMASK], rnh);
 +
 +		if (rt == NULL) {
  			RADIX_NODE_HEAD_RUNLOCK(rnh);
  			senderr(ESRCH);
  		}
 @@ -785,25 +799,6 @@ route_output(struct mbuf *m, struct sock
  		RT_ADDREF(rt);
  		RADIX_NODE_HEAD_RUNLOCK(rnh);
  
 -		/* 
 -		 * Fix for PR: 82974
 -		 *
 -		 * RTM_CHANGE/LOCK need a perfect match, rn_lookup()
 -		 * returns a perfect match in case a netmask is
 -		 * specified.  For host routes only a longest prefix
 -		 * match is returned so it is necessary to compare the
 -		 * existence of the netmask.  If both have a netmask
 -		 * rnh_lookup() did a perfect match and if none of them
 -		 * have a netmask both are host routes which is also a
 -		 * perfect match.
 -		 */
 -
 -		if (rtm->rtm_type != RTM_GET && 
 -		    (!rt_mask(rt) != !info.rti_info[RTAX_NETMASK])) {
 -			RT_UNLOCK(rt);
 -			senderr(ESRCH);
 -		}
 -
  		switch(rtm->rtm_type) {
  
  		case RTM_GET:
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/185092: commit references a PR
Date: Thu,  8 May 2014 20:24:19 +0000 (UTC)

 Author: melifaro
 Date: Thu May  8 20:24:13 2014
 New Revision: 265707
 URL: http://svnweb.freebsd.org/changeset/base/265707
 
 Log:
   Merge r259528, r259528, r260295.
   
   r259528:
     Simplify contiguous mask checking.
   
     Suggested by: glebius
   
   r260228:
     Remove useless register variable modifiers.
     Do some more style(9).
   
   r260295:
     Change semantics for rnh_lookup() function: now
     it performs exact match search, regardless of netmask existance.
     This simplifies most of rnh_lookup() consumers.
   
     Fix panic triggered by deleting non-existent host route.
   
     PR:           kern/185092
     Submitted by: Nikolay Denev <ndenev at gmail.com>
 
 Modified:
   stable/9/sys/net/radix.c
   stable/9/sys/net/radix.h
   stable/9/sys/net/radix_mpath.c
   stable/9/sys/net/route.c
   stable/9/sys/net/rtsock.c
 Directory Properties:
   stable/9/sys/   (props changed)
   stable/9/sys/net/   (props changed)
 
 Modified: stable/9/sys/net/radix.c
 ==============================================================================
 --- stable/9/sys/net/radix.c	Thu May  8 20:20:59 2014	(r265706)
 +++ stable/9/sys/net/radix.c	Thu May  8 20:24:13 2014	(r265707)
 @@ -156,12 +156,10 @@ static int	rn_satisfies_leaf(char *trial
   * Search a node in the tree matching the key.
   */
  static struct radix_node *
 -rn_search(v_arg, head)
 -	void *v_arg;
 -	struct radix_node *head;
 +rn_search(void *v_arg, struct radix_node *head)
  {
 -	register struct radix_node *x;
 -	register caddr_t v;
 +	struct radix_node *x;
 +	caddr_t v;
  
  	for (x = head, v = v_arg; x->rn_bit >= 0;) {
  		if (x->rn_bmask & v[x->rn_offset])
 @@ -177,12 +175,10 @@ rn_search(v_arg, head)
   * XXX note this function is used only once.
   */
  static struct radix_node *
 -rn_search_m(v_arg, head, m_arg)
 -	struct radix_node *head;
 -	void *v_arg, *m_arg;
 +rn_search_m(void *v_arg, struct radix_node *head, void *m_arg)
  {
 -	register struct radix_node *x;
 -	register caddr_t v = v_arg, m = m_arg;
 +	struct radix_node *x;
 +	caddr_t v = v_arg, m = m_arg;
  
  	for (x = head; x->rn_bit >= 0;) {
  		if ((x->rn_bmask & m[x->rn_offset]) &&
 @@ -191,15 +187,14 @@ rn_search_m(v_arg, head, m_arg)
  		else
  			x = x->rn_left;
  	}
 -	return x;
 +	return (x);
  }
  
  int
 -rn_refines(m_arg, n_arg)
 -	void *m_arg, *n_arg;
 +rn_refines(void *m_arg, void *n_arg)
  {
 -	register caddr_t m = m_arg, n = n_arg;
 -	register caddr_t lim, lim2 = lim = n + LEN(n);
 +	caddr_t m = m_arg, n = n_arg;
 +	caddr_t lim, lim2 = lim = n + LEN(n);
  	int longer = LEN(n++) - LEN(m++);
  	int masks_are_equal = 1;
  
 @@ -207,50 +202,71 @@ rn_refines(m_arg, n_arg)
  		lim -= longer;
  	while (n < lim) {
  		if (*n & ~(*m))
 -			return 0;
 +			return (0);
  		if (*n++ != *m++)
  			masks_are_equal = 0;
  	}
  	while (n < lim2)
  		if (*n++)
 -			return 0;
 +			return (0);
  	if (masks_are_equal && (longer < 0))
  		for (lim2 = m - longer; m < lim2; )
  			if (*m++)
 -				return 1;
 +				return (1);
  	return (!masks_are_equal);
  }
  
 +/*
 + * Search for exact match in given @head.
 + * Assume host bits are cleared in @v_arg if @m_arg is not NULL
 + * Note that prefixes with /32 or /128 masks are treated differently
 + * from host routes.
 + */
  struct radix_node *
 -rn_lookup(v_arg, m_arg, head)
 -	void *v_arg, *m_arg;
 -	struct radix_node_head *head;
 +rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head)
  {
 -	register struct radix_node *x;
 -	caddr_t netmask = 0;
 +	struct radix_node *x;
 +	caddr_t netmask;
  
 -	if (m_arg) {
 +	if (m_arg != NULL) {
 +		/*
 +		 * Most common case: search exact prefix/mask
 +		 */
  		x = rn_addmask_r(m_arg, head->rnh_masks, 1,
  		    head->rnh_treetop->rn_offset);
 -		if (x == 0)
 -			return (0);
 +		if (x == NULL)
 +			return (NULL);
  		netmask = x->rn_key;
 -	}
 -	x = rn_match(v_arg, head);
 -	if (x && netmask) {
 -		while (x && x->rn_mask != netmask)
 +
 +		x = rn_match(v_arg, head);
 +
 +		while (x != NULL && x->rn_mask != netmask)
  			x = x->rn_dupedkey;
 +
 +		return (x);
  	}
 -	return x;
 +
 +	/*
 +	 * Search for host address.
 +	 */
 +	if ((x = rn_match(v_arg, head)) == NULL)
 +		return (NULL);
 +
 +	/* Check if found key is the same */
 +	if (LEN(x->rn_key) != LEN(v_arg) || bcmp(x->rn_key, v_arg, LEN(v_arg)))
 +		return (NULL);
 +
 +	/* Check if this is not host route */
 +	if (x->rn_mask != NULL)
 +		return (NULL);
 +
 +	return (x);
  }
  
  static int
 -rn_satisfies_leaf(trial, leaf, skip)
 -	char *trial;
 -	register struct radix_node *leaf;
 -	int skip;
 +rn_satisfies_leaf(char *trial, struct radix_node *leaf, int skip)
  {
 -	register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
 +	char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;
  	char *cplim;
  	int length = min(LEN(cp), LEN(cp2));
  
 @@ -261,22 +277,23 @@ rn_satisfies_leaf(trial, leaf, skip)
  	cplim = cp + length; cp3 += skip; cp2 += skip;
  	for (cp += skip; cp < cplim; cp++, cp2++, cp3++)
  		if ((*cp ^ *cp2) & *cp3)
 -			return 0;
 -	return 1;
 +			return (0);
 +	return (1);
  }
  
 +/*
 + * Search for longest-prefix match in given @head
 + */
  struct radix_node *
 -rn_match(v_arg, head)
 -	void *v_arg;
 -	struct radix_node_head *head;
 +rn_match(void *v_arg, struct radix_node_head *head)
  {
  	caddr_t v = v_arg;
 -	register struct radix_node *t = head->rnh_treetop, *x;
 -	register caddr_t cp = v, cp2;
 +	struct radix_node *t = head->rnh_treetop, *x;
 +	caddr_t cp = v, cp2;
  	caddr_t cplim;
  	struct radix_node *saved_t, *top = t;
  	int off = t->rn_offset, vlen = LEN(cp), matched_off;
 -	register int test, b, rn_bit;
 +	int test, b, rn_bit;
  
  	/*
  	 * Open code rn_search(v, top) to avoid overhead of extra
 @@ -314,7 +331,7 @@ rn_match(v_arg, head)
  	 */
  	if (t->rn_flags & RNF_ROOT)
  		t = t->rn_dupedkey;
 -	return t;
 +	return (t);
  on1:
  	test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */
  	for (b = 7; (test >>= 1) > 0;)
 @@ -335,13 +352,13 @@ on1:
  		 */
  		if (t->rn_flags & RNF_NORMAL) {
  			if (rn_bit <= t->rn_bit)
 -				return t;
 +				return (t);
  		} else if (rn_satisfies_leaf(v, t, matched_off))
 -				return t;
 +				return (t);
  	t = saved_t;
  	/* start searching up the tree */
  	do {
 -		register struct radix_mask *m;
 +		struct radix_mask *m;
  		t = t->rn_parent;
  		m = t->rn_mklist;
  		/*
 @@ -360,12 +377,12 @@ on1:
  				while (x && x->rn_mask != m->rm_mask)
  					x = x->rn_dupedkey;
  				if (x && rn_satisfies_leaf(v, x, off))
 -					return x;
 +					return (x);
  			}
  			m = m->rm_mklist;
  		}
  	} while (t != top);
 -	return 0;
 +	return (0);
  }
  
  #ifdef RN_DEBUG
 @@ -387,12 +404,9 @@ int	rn_debug =  1;
   */
  
  static struct radix_node *
 -rn_newpair(v, b, nodes)
 -	void *v;
 -	int b;
 -	struct radix_node nodes[2];
 +rn_newpair(void *v, int b, struct radix_node nodes[2])
  {
 -	register struct radix_node *tt = nodes, *t = tt + 1;
 +	struct radix_node *tt = nodes, *t = tt + 1;
  	t->rn_bit = b;
  	t->rn_bmask = 0x80 >> (b & 7);
  	t->rn_left = tt;
 @@ -416,44 +430,39 @@ rn_newpair(v, b, nodes)
  	tt->rn_ybro = rn_clist;
  	rn_clist = tt;
  #endif
 -	return t;
 +	return (t);
  }
  
  static struct radix_node *
 -rn_insert(v_arg, head, dupentry, nodes)
 -	void *v_arg;
 -	struct radix_node_head *head;
 -	int *dupentry;
 -	struct radix_node nodes[2];
 +rn_insert(void *v_arg, struct radix_node_head *head, int *dupentry,
 +    struct radix_node nodes[2])
  {
  	caddr_t v = v_arg;
  	struct radix_node *top = head->rnh_treetop;
  	int head_off = top->rn_offset, vlen = LEN(v);
 -	register struct radix_node *t = rn_search(v_arg, top);
 -	register caddr_t cp = v + head_off;
 -	register int b;
 -	struct radix_node *tt;
 +	struct radix_node *t = rn_search(v_arg, top);
 +	caddr_t cp = v + head_off;
 +	int b;
 +	struct radix_node *p, *tt, *x;
      	/*
  	 * Find first bit at which v and t->rn_key differ
  	 */
 -    {
 -	register caddr_t cp2 = t->rn_key + head_off;
 -	register int cmp_res;
 +	caddr_t cp2 = t->rn_key + head_off;
 +	int cmp_res;
  	caddr_t cplim = v + vlen;
  
  	while (cp < cplim)
  		if (*cp2++ != *cp++)
  			goto on1;
  	*dupentry = 1;
 -	return t;
 +	return (t);
  on1:
  	*dupentry = 0;
  	cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;
  	for (b = (cp - v) << 3; cmp_res; b--)
  		cmp_res >>= 1;
 -    }
 -    {
 -	register struct radix_node *p, *x = top;
 +
 +	x = top;
  	cp = v;
  	do {
  		p = x;
 @@ -485,20 +494,19 @@ on1:
  	if (rn_debug)
  		log(LOG_DEBUG, "rn_insert: Coming Out:\n"), traverse(p);
  #endif
 -    }
  	return (tt);
  }
  
  struct radix_node *
  rn_addmask_r(void *arg, struct radix_node_head *maskhead, int search, int skip)
  {
 -	caddr_t netmask = (caddr_t)arg;
 -	register struct radix_node *x;
 -	register caddr_t cp, cplim;
 -	register int b = 0, mlen, j;
 +	unsigned char *netmask = arg;
 +	unsigned char *cp, *cplim;
 +	struct radix_node *x;
 +	int b = 0, mlen, j;
  	int maskduplicated, isnormal;
  	struct radix_node *saved_x;
 -	char addmask_key[RADIX_MAX_KEY_LEN];
 +	unsigned char addmask_key[RADIX_MAX_KEY_LEN];
  
  	if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN)
  		mlen = RADIX_MAX_KEY_LEN;
 @@ -540,20 +548,18 @@ rn_addmask_r(void *arg, struct radix_nod
  	 * Calculate index of mask, and check for normalcy.
  	 * First find the first byte with a 0 bit, then if there are
  	 * more bits left (remember we already trimmed the trailing 0's),
 -	 * the pattern must be one of those in normal_chars[], or we have
 +	 * the bits should be contiguous, otherwise we have got
  	 * a non-contiguous mask.
  	 */
 +#define	CONTIG(_c)	(((~(_c) + 1) & (_c)) == (unsigned char)(~(_c) + 1))
  	cplim = netmask + mlen;
  	isnormal = 1;
  	for (cp = netmask + skip; (cp < cplim) && *(u_char *)cp == 0xff;)
  		cp++;
  	if (cp != cplim) {
 -		static char normal_chars[] = {
 -			0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff};
 -
  		for (j = 0x80; (j & *cp) != 0; j >>= 1)
  			b++;
 -		if (*cp != normal_chars[b] || cp != (cplim - 1))
 +		if (!CONTIG(*cp) || cp != (cplim - 1))
  			isnormal = 0;
  	}
  	b += (cp - netmask) << 3;
 @@ -581,29 +587,26 @@ rn_addmask(void *n_arg, int search, int 
  }
  
  static int	/* XXX: arbitrary ordering for non-contiguous masks */
 -rn_lexobetter(m_arg, n_arg)
 -	void *m_arg, *n_arg;
 +rn_lexobetter(void *m_arg, void *n_arg)
  {
 -	register u_char *mp = m_arg, *np = n_arg, *lim;
 +	u_char *mp = m_arg, *np = n_arg, *lim;
  
  	if (LEN(mp) > LEN(np))
 -		return 1;  /* not really, but need to check longer one first */
 +		return (1);  /* not really, but need to check longer one first */
  	if (LEN(mp) == LEN(np))
  		for (lim = mp + LEN(mp); mp < lim;)
  			if (*mp++ > *np++)
 -				return 1;
 -	return 0;
 +				return (1);
 +	return (0);
  }
  
  static struct radix_mask *
 -rn_new_radix_mask(tt, next)
 -	register struct radix_node *tt;
 -	register struct radix_mask *next;
 +rn_new_radix_mask(struct radix_node *tt, struct radix_mask *next)
  {
 -	register struct radix_mask *m;
 +	struct radix_mask *m;
  
  	R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask));
 -	if (m == 0) {
 +	if (m == NULL) {
  		log(LOG_ERR, "Failed to allocate route mask\n");
  		return (0);
  	}
 @@ -616,17 +619,15 @@ rn_new_radix_mask(tt, next)
  		m->rm_mask = tt->rn_mask;
  	m->rm_mklist = next;
  	tt->rn_mklist = m;
 -	return m;
 +	return (m);
  }
  
  struct radix_node *
 -rn_addroute(v_arg, n_arg, head, treenodes)
 -	void *v_arg, *n_arg;
 -	struct radix_node_head *head;
 -	struct radix_node treenodes[2];
 +rn_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
 +    struct radix_node treenodes[2])
  {
  	caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg;
 -	register struct radix_node *t, *x = 0, *tt;
 +	struct radix_node *t, *x = 0, *tt;
  	struct radix_node *saved_tt, *top = head->rnh_treetop;
  	short b = 0, b_leaf = 0;
  	int keyduplicated;
 @@ -754,7 +755,7 @@ rn_addroute(v_arg, n_arg, head, treenode
  on2:
  	/* Add new route to highest possible ancestor's list */
  	if ((netmask == 0) || (b > t->rn_bit ))
 -		return tt; /* can't lift at all */
 +		return (tt); /* can't lift at all */
  	b_leaf = tt->rn_bit;
  	do {
  		x = t;
 @@ -778,29 +779,27 @@ on2:
  			    log(LOG_ERR,
  			        "Non-unique normal route, mask not entered\n");
  #endif
 -				return tt;
 +				return (tt);
  			}
  		} else
  			mmask = m->rm_mask;
  		if (mmask == netmask) {
  			m->rm_refs++;
  			tt->rn_mklist = m;
 -			return tt;
 +			return (tt);
  		}
  		if (rn_refines(netmask, mmask)
  		    || rn_lexobetter(netmask, mmask))
  			break;
  	}
  	*mp = rn_new_radix_mask(tt, *mp);
 -	return tt;
 +	return (tt);
  }
  
  struct radix_node *
 -rn_delete(v_arg, netmask_arg, head)
 -	void *v_arg, *netmask_arg;
 -	struct radix_node_head *head;
 +rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head)
  {
 -	register struct radix_node *t, *p, *x, *tt;
 +	struct radix_node *t, *p, *x, *tt;
  	struct radix_mask *m, *saved_m, **mp;
  	struct radix_node *dupedkey, *saved_tt, *top;
  	caddr_t v, netmask;
 @@ -834,7 +833,7 @@ rn_delete(v_arg, netmask_arg, head)
  	if (tt->rn_flags & RNF_NORMAL) {
  		if (m->rm_leaf != tt || m->rm_refs > 0) {
  			log(LOG_ERR, "rn_delete: inconsistent annotation\n");
 -			return 0;  /* dangling ref could cause disaster */
 +			return (0);  /* dangling ref could cause disaster */
  		}
  	} else {
  		if (m->rm_mask != tt->rn_mask) {
 @@ -986,17 +985,14 @@ out:
   * exit.
   */
  static int
 -rn_walktree_from(h, a, m, f, w)
 -	struct radix_node_head *h;
 -	void *a, *m;
 -	walktree_f_t *f;
 -	void *w;
 +rn_walktree_from(struct radix_node_head *h, void *a, void *m,
 +    walktree_f_t *f, void *w)
  {
  	int error;
  	struct radix_node *base, *next;
  	u_char *xa = (u_char *)a;
  	u_char *xm = (u_char *)m;
 -	register struct radix_node *rn, *last = 0 /* shut up gcc */;
 +	struct radix_node *rn, *last = NULL; /* shut up gcc */
  	int stopping = 0;
  	int lastb;
  
 @@ -1089,18 +1085,15 @@ rn_walktree_from(h, a, m, f, w)
  		}
  
  	}
 -	return 0;
 +	return (0);
  }
  
  static int
 -rn_walktree(h, f, w)
 -	struct radix_node_head *h;
 -	walktree_f_t *f;
 -	void *w;
 +rn_walktree(struct radix_node_head *h, walktree_f_t *f, void *w)
  {
  	int error;
  	struct radix_node *base, *next;
 -	register struct radix_node *rn = h->rnh_treetop;
 +	struct radix_node *rn = h->rnh_treetop;
  	/*
  	 * This gets complicated because we may delete the node
  	 * while applying the function f to it, so we need to calculate
 @@ -1145,8 +1138,8 @@ rn_walktree(h, f, w)
  static int
  rn_inithead_internal(void **head, int off)
  {
 -	register struct radix_node_head *rnh;
 -	register struct radix_node *t, *tt, *ttt;
 +	struct radix_node_head *rnh;
 +	struct radix_node *t, *tt, *ttt;
  	if (*head)
  		return (1);
  	R_Zalloc(rnh, struct radix_node_head *, sizeof (*rnh));
 
 Modified: stable/9/sys/net/radix.h
 ==============================================================================
 --- stable/9/sys/net/radix.h	Thu May  8 20:20:59 2014	(r265706)
 +++ stable/9/sys/net/radix.h	Thu May  8 20:24:13 2014	(r265707)
 @@ -119,9 +119,9 @@ struct radix_node_head {
  		(void *v, void *mask, struct radix_node_head *head);
  	struct	radix_node *(*rnh_delpkt)	/* remove based on packet hdr */
  		(void *v, void *mask, struct radix_node_head *head);
 -	struct	radix_node *(*rnh_matchaddr)	/* locate based on sockaddr */
 +	struct	radix_node *(*rnh_matchaddr)	/* longest match for sockaddr */
  		(void *v, struct radix_node_head *head);
 -	struct	radix_node *(*rnh_lookup)	/* locate based on sockaddr */
 +	struct	radix_node *(*rnh_lookup)	/*exact match for sockaddr*/
  		(void *v, void *mask, struct radix_node_head *head);
  	struct	radix_node *(*rnh_matchpkt)	/* locate based on packet hdr */
  		(void *v, struct radix_node_head *head);
 
 Modified: stable/9/sys/net/radix_mpath.c
 ==============================================================================
 --- stable/9/sys/net/radix_mpath.c	Thu May  8 20:20:59 2014	(r265706)
 +++ stable/9/sys/net/radix_mpath.c	Thu May  8 20:24:13 2014	(r265707)
 @@ -151,6 +151,7 @@ rt_mpath_deldup(struct rtentry *headrt, 
  
  /*
   * check if we have the same key/mask/gateway on the table already.
 + * Assume @rt rt_key host bits are cleared according to @netmask
   */
  int
  rt_mpath_conflict(struct radix_node_head *rnh, struct rtentry *rt,
 @@ -158,76 +159,13 @@ rt_mpath_conflict(struct radix_node_head
  {
  	struct radix_node *rn, *rn1;
  	struct rtentry *rt1;
 -	char *p, *q, *eq;
 -	int same, l, skip;
  
  	rn = (struct radix_node *)rt;
  	rn1 = rnh->rnh_lookup(rt_key(rt), netmask, rnh);
  	if (!rn1 || rn1->rn_flags & RNF_ROOT)
 -		return 0;
 -
 -	/*
 -	 * unlike other functions we have in this file, we have to check
 -	 * all key/mask/gateway as rnh_lookup can match less specific entry.
 -	 */
 -	rt1 = (struct rtentry *)rn1;
 -
 -	/* compare key. */
 -	if (rt_key(rt1)->sa_len != rt_key(rt)->sa_len ||
 -	    bcmp(rt_key(rt1), rt_key(rt), rt_key(rt1)->sa_len))
 -		goto different;
 -
 -	/* key was the same.  compare netmask.  hairy... */
 -	if (rt_mask(rt1) && netmask) {
 -		skip = rnh->rnh_treetop->rn_offset;
 -		if (rt_mask(rt1)->sa_len > netmask->sa_len) {
 -			/*
 -			 * as rt_mask(rt1) is made optimal by radix.c,
 -			 * there must be some 1-bits on rt_mask(rt1)
 -			 * after netmask->sa_len.  therefore, in
 -			 * this case, the entries are different.
 -			 */
 -			if (rt_mask(rt1)->sa_len > skip)
 -				goto different;
 -			else {
 -				/* no bits to compare, i.e. same*/
 -				goto maskmatched;
 -			}
 -		}
 -
 -		l = rt_mask(rt1)->sa_len;
 -		if (skip > l) {
 -			/* no bits to compare, i.e. same */
 -			goto maskmatched;
 -		}
 -		p = (char *)rt_mask(rt1);
 -		q = (char *)netmask;
 -		if (bcmp(p + skip, q + skip, l - skip))
 -			goto different;
 -		/*
 -		 * need to go through all the bit, as netmask is not
 -		 * optimal and can contain trailing 0s
 -		 */
 -		eq = (char *)netmask + netmask->sa_len;
 -		q += l;
 -		same = 1;
 -		while (eq > q)
 -			if (*q++) {
 -				same = 0;
 -				break;
 -			}
 -		if (!same)
 -			goto different;
 -	} else if (!rt_mask(rt1) && !netmask)
 -		; /* no mask to compare, i.e. same */
 -	else {
 -		/* one has mask and the other does not, different */
 -		goto different;
 -	}
 -
 -maskmatched:
 +		return (0);
  
 -	/* key/mask were the same.  compare gateway for all multipaths */
 +	/* key/mask are the same. compare gateway for all multipaths */
  	do {
  		rt1 = (struct rtentry *)rn1;
  
 @@ -248,11 +186,10 @@ maskmatched:
  		}
  
  		/* all key/mask/gateway are the same.  conflicting entry. */
 -		return EEXIST;
 +		return (EEXIST);
  	} while ((rn1 = rn_mpath_next(rn1)) != NULL);
  
 -different:
 -	return 0;
 +	return (0);
  }
  
  void
 
 Modified: stable/9/sys/net/route.c
 ==============================================================================
 --- stable/9/sys/net/route.c	Thu May  8 20:20:59 2014	(r265706)
 +++ stable/9/sys/net/route.c	Thu May  8 20:24:13 2014	(r265707)
 @@ -942,6 +942,57 @@ bad:
  	return (error);
  }
  
 +#if 0
 +int p_sockaddr(char *buf, int buflen, struct sockaddr *s);
 +int rt_print(char *buf, int buflen, struct rtentry *rt);
 +
 +int
 +p_sockaddr(char *buf, int buflen, struct sockaddr *s)
 +{
 +	void *paddr = NULL;
 +
 +	switch (s->sa_family) {
 +	case AF_INET:
 +		paddr = &((struct sockaddr_in *)s)->sin_addr;
 +		break;
 +	case AF_INET6:
 +		paddr = &((struct sockaddr_in6 *)s)->sin6_addr;
 +		break;
 +	}
 +
 +	if (paddr == NULL)
 +		return (0);
 +
 +	if (inet_ntop(s->sa_family, paddr, buf, buflen) == NULL)
 +		return (0);
 +	
 +	return (strlen(buf));
 +}
 +
 +int
 +rt_print(char *buf, int buflen, struct rtentry *rt)
 +{
 +	struct sockaddr *addr, *mask;
 +	int i = 0;
 +
 +	addr = rt_key(rt);
 +	mask = rt_mask(rt);
 +
 +	i = p_sockaddr(buf, buflen, addr);
 +	if (!(rt->rt_flags & RTF_HOST)) {
 +		buf[i++] = '/';
 +		i += p_sockaddr(buf + i, buflen - i, mask);
 +	}
 +
 +	if (rt->rt_flags & RTF_GATEWAY) {
 +		buf[i++] = '>';
 +		i += p_sockaddr(buf + i, buflen - i, rt->rt_gateway);
 +	}
 +
 +	return (i);
 +}
 +#endif
 +
  #ifdef RADIX_MPATH
  static int
  rn_mpath_update(int req, struct rt_addrinfo *info,
 @@ -955,10 +1006,11 @@ rn_mpath_update(int req, struct rt_addri
  	register struct radix_node *rn;
  	int error = 0;
  
 -	rn = rnh->rnh_matchaddr(dst, rnh);
 +	rn = rnh->rnh_lookup(dst, netmask, rnh);
  	if (rn == NULL)
  		return (ESRCH);
  	rto = rt = RNTORT(rn);
 +
  	rt = rt_mpath_matchgate(rt, gateway);
  	if (rt == NULL)
  		return (ESRCH);
 @@ -1538,8 +1590,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int
  			rn = rnh->rnh_lookup(dst, netmask, rnh);
  			error = (rn == NULL ||
  			    (rn->rn_flags & RNF_ROOT) ||
 -			    RNTORT(rn)->rt_ifa != ifa ||
 -			    !sa_equal((struct sockaddr *)rn->rn_key, dst));
 +			    RNTORT(rn)->rt_ifa != ifa);
  			RADIX_NODE_HEAD_RUNLOCK(rnh);
  			if (error) {
  				/* this is only an error if bad on ALL tables */
 
 Modified: stable/9/sys/net/rtsock.c
 ==============================================================================
 --- stable/9/sys/net/rtsock.c	Thu May  8 20:20:59 2014	(r265706)
 +++ stable/9/sys/net/rtsock.c	Thu May  8 20:24:13 2014	(r265707)
 @@ -704,10 +704,24 @@ route_output(struct mbuf *m, struct sock
  		    info.rti_info[RTAX_DST]->sa_family);
  		if (rnh == NULL)
  			senderr(EAFNOSUPPORT);
 +
  		RADIX_NODE_HEAD_RLOCK(rnh);
 -		rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST],
 -			info.rti_info[RTAX_NETMASK], rnh);
 -		if (rt == NULL) {	/* XXX looks bogus */
 +
 +		if (info.rti_info[RTAX_NETMASK] == NULL &&
 +		    rtm->rtm_type == RTM_GET) {
 +			/*
 +			 * Provide logest prefix match for
 +			 * address lookup (no mask).
 +			 * 'route -n get addr'
 +			 */
 +			rt = (struct rtentry *) rnh->rnh_matchaddr(
 +			    info.rti_info[RTAX_DST], rnh);
 +		} else
 +			rt = (struct rtentry *) rnh->rnh_lookup(
 +			    info.rti_info[RTAX_DST],
 +			    info.rti_info[RTAX_NETMASK], rnh);
 +
 +		if (rt == NULL) {
  			RADIX_NODE_HEAD_RUNLOCK(rnh);
  			senderr(ESRCH);
  		}
 @@ -764,25 +778,6 @@ route_output(struct mbuf *m, struct sock
  		RT_ADDREF(rt);
  		RADIX_NODE_HEAD_RUNLOCK(rnh);
  
 -		/* 
 -		 * Fix for PR: 82974
 -		 *
 -		 * RTM_CHANGE/LOCK need a perfect match, rn_lookup()
 -		 * returns a perfect match in case a netmask is
 -		 * specified.  For host routes only a longest prefix
 -		 * match is returned so it is necessary to compare the
 -		 * existence of the netmask.  If both have a netmask
 -		 * rnh_lookup() did a perfect match and if none of them
 -		 * have a netmask both are host routes which is also a
 -		 * perfect match.
 -		 */
 -
 -		if (rtm->rtm_type != RTM_GET && 
 -		    (!rt_mask(rt) != !info.rti_info[RTAX_NETMASK])) {
 -			RT_UNLOCK(rt);
 -			senderr(ESRCH);
 -		}
 -
  		switch(rtm->rtm_type) {
  
  		case RTM_GET:
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
