From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 22 11:38:03 2010 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5CBD1065693 for ; Wed, 22 Sep 2010 11:38:03 +0000 (UTC) (envelope-from tobias.herre@srh-hochschule-berlin.de) Received: from mail.otauni.de (mail.otauni.de [213.23.120.75]) by mx1.freebsd.org (Postfix) with ESMTP id 733D58FC14 for ; Wed, 22 Sep 2010 11:38:03 +0000 (UTC) Received: from [192.168.190.77] (unknown [192.168.190.77]) by mail.otauni.de (Postfix) with ESMTPA id 2E7B7347966 for ; Wed, 22 Sep 2010 11:21:34 +0000 (UTC) Message-ID: <4C99E6B2.6070202@srh-hochschule-berlin.de> Date: Wed, 22 Sep 2010 13:21:22 +0200 From: Tobias Herre User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: freebsd-bugs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: routed -q needs at least two working interfaces 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: Wed, 22 Sep 2010 11:38:03 -0000 Hello, I have two machines connected to the same switch. First machine is called router, has gateway_enable="YES" and shows the following interfaces router# ifconfig bge0: flags=8843 metric 0 mtu 1500 options=8009b ether 00:50:45:5d:9a:bc inet 192.168.1.158 netmask 0xffffff00 broadcast 192.168.1.255 media: Ethernet autoselect (100baseTX ) status: active bge1: flags=8843 metric 0 mtu 1500 options=8009b 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 metric 0 mtu 1500 options=8009b ether 00:50:45:5d:c6:ec inet 192.168.1.157 netmask 0xffffff00 broadcast 192.168.1.255 media: Ethernet autoselect (100baseTX ) status: active bge1: flags=8843 metric 0 mtu 1500 options=8009b ether 00:50:45:5d:c6:ed media: Ethernet autoselect (none) status: no carrier ... Now on the router I 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) Add 127.0.0.1 (mask 0xffffffff)-->127.0.0.1 metric=0 lo0 Add 192.168.17.0 -->192.168.17.17 metric=0 bge1 Add 192.168.1.0 -->192.168.1.158 metric=0 bge0 -- 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) Add 127.0.0.1 (mask 0xffffffff)-->127.0.0.1 metric=0 lo0 Add 192.168.1.0 -->192.168.1.157 metric=0 bge0 -- 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 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. 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) Add 127.0.0.1 (mask 0xffffffff)-->127.0.0.1 metric=0 lo0 Add 192.168.18.0 -->192.168.18.18 metric=0 bge1 Add 192.168.1.0 -->192.168.1.157 metric=0 bge0 -- 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 it seems to be impossible to get routed working on a machine with just one network adapter. I have testet this on FreeBSD 8.1 Stable. I have seen the same problem on FreeBSD 7.0 and on FreeBSD 5.5 maybe it exists on FreeBSD 6 too. the following patch solves the problem. regards Tobias Herre --- /usr/src/sbin/routed/rdisc.orig 2010-09-22 11:02:00.040741231 +0000 +++ /usr/src/sbin/routed/rdisc.c 2010-09-22 11:02:10.671926200 +0000 @@ -557,7 +557,7 @@ } /* turn RIP on or off */ - if (!rdisc_ok || rip_interfaces > 1) { + if (!rdisc_ok || rip_interfaces >= 1) { rip_on(0); } else { rip_off();