Bug 151186 - [patch] routed(8) turns RIP off if just one network card is present
Summary: [patch] routed(8) turns RIP off if just one network card is present
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-10-04 00:10 UTC by Tobias Herre
Modified: 2022-10-17 12:38 UTC (History)
0 users

See Also:


Attachments
file.diff (357 bytes, patch)
2010-10-04 00:10 UTC, Tobias Herre
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Herre 2010-10-04 00:10:04 UTC
route daemon (routed -q) turns RIP off if just one network adapter exists.

Fix: Workaraound: install and configure a second network adapter and bring it up.
Or apply the patch.


Patch attached with submission follows:
How-To-Repeat: Take two machines connect them via a switch.
First machine is called router, has gateway_enable="YES"
and shows the following interfaces

router# ifconfig
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
        ether 00:50:45:5d:9a:bc
        inet 192.168.1.158 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (100baseTX <full-duplex,flag0,flag1>)
        status: active
bge1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
        ether 00:50:45:5d:9a:bd
        inet 192.168.17.17 netmask 0xffffff00 broadcast 192.168.17.255
        media: Ethernet autoselect (none)
        status: no carrier
..


and the second machine called client:

client# ifconfig
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
    ether 00:50:45:5d:c6:ec
    inet 192.168.1.157 netmask 0xffffff00 broadcast 192.168.1.255
    media: Ethernet autoselect (100baseTX <full-duplex,flag0,flag1>)
    status: active
bge1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
    ether 00:50:45:5d:c6:ed
    media: Ethernet autoselect (none)
    status: no carrier
..

in this case the second machine (client) has two network adapters but  bge1 has no ip assigned and is down.


Now on the router start the route daemon:

router# /sbin/routed -s -d -t
-- 10:43:21 --
Tracing actions started
Add interface bge0 192.168.1.158  -->192.168.1.0 (mask 0xffffff00)
RCVBUF=61440
turn on RIP
Add interface bge1 192.168.17.17  -->192.168.17.0 (mask 0xffffff00)
Add interface lo0  127.0.0.1      -->127.0.0.1 (mask 0xffffffff) <LOOPBACK> <PASSIVE>
Add    127.0.0.1 (mask 0xffffffff)-->127.0.0.1 metric=0  lo0 <IF>
Add    192.168.17.0    -->192.168.17.17    metric=0  bge1 <IF>
Add    192.168.1.0     -->192.168.1.158    metric=0  bge0 <IF>
-- 10:43:21 --
ignore RTM_NEWMADDR for AF 173
ignore RTM_NEWMADDR for AF 173
ignore RTM_NEWMADDR without dst
ignore RTM_NEWMADDR without dst
-- 10:43:26 --
send all routes and inhibit dynamic updates for 4.884 sec


and on the client:

client# /sbin/routed -d -q -t
-- 10:45:36 --
Tracing actions started
Add interface bge0 192.168.1.157  -->192.168.1.0 (mask 0xffffff00)
RCVBUF=61440
turn on RIP
Add interface lo0  127.0.0.1      -->127.0.0.1 (mask 0xffffffff) <LOOPBACK> <PASSIVE>
Add    127.0.0.1 (mask 0xffffffff)-->127.0.0.1 metric=0  lo0 <IF>
Add    192.168.1.0     -->192.168.1.157    metric=0  bge0 <IF>
-- 10:45:36 --
ignore RTM_NEWMADDR for AF 172
-- 10:45:36 --
Add #1 192.168.1.0     -->192.168.1.158    metric=1  bge0 10:45:36
Add    192.168.17.0    -->192.168.1.158    metric=1  bge0 10:45:36
-- 10:45:37 --
turn on Router Discovery client using 192.168.1.158 via bge0
Add    0.0.0.0         -->192.168.1.158    metric=15 bge0 <RDISC>
turn off RIP
Del    192.168.17.0    -->192.168.1.158    metric=1  bge0 10:45:36


As not expected the route to net 192.168.17.0 is deleted immediately and
RIP is turned off.

Brining up the second interface on the client lets routed work as expected:

client# ifconfig bge1 192.168.18.18
client# ifconfig bge1 up
client# /sbin/routed -d -q -t
-- 10:51:12 --
Tracing actions started
Add interface bge0 192.168.1.157  -->192.168.1.0 (mask 0xffffff00)
RCVBUF=61440
turn on RIP
Add interface bge1 192.168.18.18  -->192.168.18.0 (mask 0xffffff00)
Add interface lo0  127.0.0.1      -->127.0.0.1 (mask 0xffffffff) <LOOPBACK> <PASSIVE>
Add    127.0.0.1 (mask 0xffffffff)-->127.0.0.1 metric=0  lo0 <IF>
Add    192.168.18.0    -->192.168.18.18    metric=0  bge1 <IF>
Add    192.168.1.0     -->192.168.1.157    metric=0  bge0 <IF>
-- 10:51:12 --
ignore RTM_NEWMADDR for AF 172
ignore RTM_NEWMADDR without dst
-- 10:51:12 --
Add #1 192.168.1.0     -->192.168.1.158    metric=1  bge0 10:51:12
Add    192.168.17.0    -->192.168.1.158    metric=1  bge0 10:51:12
-- 10:51:13 --
turn on Router Discovery client using 192.168.1.158 via bge0
Add    0.0.0.0         -->192.168.1.158    metric=15 bge0 <RDISC>
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:13 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:38:38 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>