From owner-freebsd-bugs Tue Jun 5 9:40: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B3EF637B408 for ; Tue, 5 Jun 2001 09:40:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f55Ge0200857; Tue, 5 Jun 2001 09:40:00 -0700 (PDT) (envelope-from gnats) Received: from goliath.siemens.de (goliath.siemens.de [194.138.37.131]) by hub.freebsd.org (Postfix) with ESMTP id 7F72B37B406 for ; Tue, 5 Jun 2001 09:30:16 -0700 (PDT) (envelope-from andre.albsmeier@mchp.siemens.de) Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.11.1/8.11.1) with ESMTP id f55GUE409146 for ; Tue, 5 Jun 2001 18:30:14 +0200 (MET DST) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mail3.siemens.de (8.11.1/8.11.1) with ESMTP id f55GUEV10711203 for ; Tue, 5 Jun 2001 18:30:14 +0200 (MEST) Received: (from localhost) by curry.mchp.siemens.de (8.11.3/8.11.3) id f55GUEu36178 for FreeBSD-gnats-submit@freebsd.org; Tue, 5 Jun 2001 18:30:14 +0200 (CEST) Message-Id: <200106051630.f55GUEt76616@curry.mchp.siemens.de> Date: Tue, 5 Jun 2001 18:30:14 +0200 (CEST) From: Andre Albsmeier To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/27890: FreeBSD not always seems to take the best route Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 27890 >Category: kern >Synopsis: FreeBSD not always seems to take the best route >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 05 09:40:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 4.3-STABLE i386 >Organization: >Environment: System: 4.3-STABLE #67: Fri Jun 1 12:49:52 CEST 2001 >Description: I have observed this behaviour for a long time now but finally had time to dig into it... I reference syslogd as an example here but I think the problem lies in the network code of the kernel... Simple network: - two routers (1 and 2) - host C with IP 192.168.1.3 - host S with IP 192.168.2.1 All machines are FreeBSD 4.3-STABLE. Router 1 routes pkts between the Internet and 192.168.1.0 Router 2 routes pkts between 192.168.1.0 and 192.168.2.0 +-----+ +-----+ default | | 192.168.1.0 | | 192.168.2.0 -----------| 1 |--------+--------| 2 |--------+-------- more hosts | | | | | | +-----+ | +-----+ | | | +-----+ +-----+ | | | | 192.168.1.3 | C | | S | 192.168.2.1 | | | | +-----+ +-----+ Relevant parts of netstat -rn on C during normal operation: ------------------------------------------------------------- Destination Gateway Flags Netif Expire default 192.168.1.1 UGSc fxp0 127.0.0.1 127.0.0.1 UH lo0 192.168.1 link#1 UC fxp0 => 192.168.1.1 0:e0:18:90:91:bb UHLW fxp0 1182 192.168.1.2 0:e0:18:90:94:c8 UHLW fxp0 1058 192.168.1.3 0:e0:18:90:45:dc UHLW lo0 192.168.1.255 ff:ff:ff:ff:ff:ff UHLWb fxp0 192.168.2 192.168.1.2 UGc fxp0 The syslogd on host C is configured to log messages to syslogd running on host S. This works perfectly, all messages appear on host S. Now we delete the route to net 192.168.2.0 on host C (this can appear automatically if router 2 and/or its routed go down for a while). If syslogd now wants to send a message to S, the kernel uses the default route which is obvious because the route to net 192.168.2.0 is gone. We can see the packets go into router 1. I consider this as the correct behaviour as well. Now we bring back the route to net 192.168.2.0 again on host C exactly as it was before (e.g. by restarting router 2 and/or its routed). We can verify this with netstat -rn on C. We can also ping host S or telnet to it or do other stuff which all work perfectly. The problem is that each time when syslogd on C wants to send a packet to S, the kernel still uses 1 as router even though it should send them through 2. After HUPing or restarting syslogd on C (which means that the UDP socket is closed and opened again) things are back to normal. It seems that as long as packets can be send somewhere, the kernel doesn't bother if there is a better route to the destination until the socket is closed and opened again. >How-To-Repeat: See above. >Fix: Unknown. I am happy to test suggestions, of course. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message