Bug 155757 - problems with setfib(1) behavior
Summary: problems with setfib(1) behavior
Status: Closed DUPLICATE of bug 187549
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alan Somers
Depends on:
Reported: 2011-03-21 17:40 UTC by Vincent Miszczak
Modified: 2014-10-21 14:40 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Miszczak 2011-03-21 17:40:07 UTC
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 up
#Delete automatically added route (btw is there any parameter to prevent this behavior?)
testQOS# route delete
delete net
#Populate FIB#1 context. We have net.add_addr_allfibs set to 0, so this is not done automatically
testQOS# setfib 1 route add -interface em4
add net gateway em4
#Try a ping to a host(it's alive) in FIB#1 context 
testQOS# setfib 1 ping
PING ( 56 data bytes
ping: sendto: Invalid argument

If I do the following : 
testQOS# ifconfig em4 up
testQOS# setfib 1 route add -interface em4
testQOS# setfib 1 ping
PING ( 56 data bytes
64 bytes from 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 up
# ping
PING ( 56 data bytes
ping: sendto: Invalid argument

#Doing the same thing in FIB#0 context
testQOS# setfib 0 sh
# ifconfig em4 up
# ping
PING ( 56 data bytes
64 bytes from 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 IPDIVERT
options DUMMYNET
options HZ=1000

Boot your machine

Run commands given in "description"
Comment 1 Alan Somers freebsd_committer 2014-09-18 22:46:45 UTC
vmiszczak, it looks like you encountered several bugs that I've recently fixed.  The net route appeared in the wrong fib due to PR 187549.  Ping failed, in the first case, probably due to PR 167947.  Please retest using CURRENT, stable/10 greater than 267193, stable/9 greater than 271825, or 10.1-BETA1.
Comment 2 Alan Somers freebsd_committer 2014-10-21 14:40:27 UTC
Timeout waiting for response from the submitter.  I'm pretty sure that this PR is a duplicate of both 187549 and 167947.

*** This bug has been marked as a duplicate of bug 187549 ***