From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 21 17:40:08 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B27D106567D for ; Mon, 21 Mar 2011 17:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D136E8FC24 for ; Mon, 21 Mar 2011 17:40:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2LHe7GZ046463 for ; Mon, 21 Mar 2011 17:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2LHe7hC046457; Mon, 21 Mar 2011 17:40:07 GMT (envelope-from gnats) Resent-Date: Mon, 21 Mar 2011 17:40:07 GMT Resent-Message-Id: <201103211740.p2LHe7hC046457@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vincent Miszczak Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7481065673 for ; Mon, 21 Mar 2011 17:37:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 910F88FC13 for ; Mon, 21 Mar 2011 17:37:38 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p2LHbc8e007115 for ; Mon, 21 Mar 2011 17:37:38 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p2LHbcYX007114; Mon, 21 Mar 2011 17:37:38 GMT (envelope-from nobody) Message-Id: <201103211737.p2LHbcYX007114@red.freebsd.org> Date: Mon, 21 Mar 2011 17:37:38 GMT From: Vincent Miszczak To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/155757: setfib behavior X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2011 17:40:08 -0000 >Number: 155757 >Category: kern >Synopsis: setfib behavior >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 21 17:40:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Vincent Miszczak >Release: 8.2 >Organization: Ankama >Environment: FreeBSD testQOS.ankama.lan 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Mon Mar 21 11:30:16 UTC 2011 root@testQOS.ankama.lan:/usr/src/sys/amd64/compile/QOSRouter amd64 >Description: Hi guys, I'm using the very undocumented command setfib to play with several routing tables for test purposes before production release. This command has at least 2 problems : The kernel I'm running have the followings running settings : net.my_fibnum: 0 net.add_addr_allfibs: 0 net.fibs: 2 I'm currently testing very simple things : I boot my machine, and I enter those commands : #Configure interface em4 testQOS# ifconfig em4 10.10.10.0/24 up #Delete automatically added route (btw is there any parameter to prevent this behavior?) testQOS# route delete 10.10.10.0/24 delete net 10.10.10.0 #Populate FIB#1 context. We have net.add_addr_allfibs set to 0, so this is not done automatically testQOS# setfib 1 route add 10.10.10.0/24 -interface em4 add net 10.10.10.0: gateway em4 #Try a ping to a host(it's alive) in FIB#1 context testQOS# setfib 1 ping 10.10.10.11 PING 10.10.10.11 (10.10.10.11): 56 data bytes ping: sendto: Invalid argument If I do the following : testQOS# ifconfig em4 10.10.10.0/24 up testQOS# setfib 1 route add 10.10.10.0/24 -interface em4 testQOS# setfib 1 ping 10.10.10.11 PING 10.10.10.11 (10.10.10.11): 56 data bytes 64 bytes from 10.10.10.11: icmp_seq=0 ttl=64 time=1.561 ms The only difference is that I'm not deleting the route from FIB#0 context. Second problem : #Configuring an interface from FIB#1 context then trying to ping testQOS# setfib 1 sh # ifconfig em4 10.10.10.72/24 up # ping 10.10.10.11 PING 10.10.10.11 (10.10.10.11): 56 data bytes ping: sendto: Invalid argument #Doing the same thing in FIB#0 context testQOS# setfib 0 sh # ifconfig em4 10.10.10.72/24 up # ping 10.10.10.11 PING 10.10.10.11 (10.10.10.11): 56 data bytes 64 bytes from 10.10.10.11: icmp_seq=0 ttl=64 time=1.481 ms So it seems FIB#1 context depends on FIB#0 context. Maybe I've missed something, but it seems to be a bug. Thank you >How-To-Repeat: Install a FreeBSD 8.2 AMD64, compile kernel with options : options IPFIREWALL options IPFIREWALL_FORWARD options IPFIREWALL_DEFAULT_TO_ACCEPT options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT=250 options IPDIVERT options DUMMYNET options HZ=1000 options ROUTETABLES=2 Boot your machine Run commands given in "description" >Fix: >Release-Note: >Audit-Trail: >Unformatted: