From owner-freebsd-net@freebsd.org Sat May 28 07:19:28 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF8BB4D7E1 for ; Sat, 28 May 2016 07:19:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 5F8541D4E for ; Sat, 28 May 2016 07:19:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: by mailman.ysv.freebsd.org (Postfix) id 5B0D3B4D7E0; Sat, 28 May 2016 07:19:28 +0000 (UTC) Delivered-To: net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 586EDB4D7DE for ; Sat, 28 May 2016 07:19:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 14C511D4D for ; Sat, 28 May 2016 07:19:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 6085C427114 for ; Sat, 28 May 2016 17:19:18 +1000 (AEST) Date: Sat, 28 May 2016 17:19:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: net@freebsd.org Subject: ifconfig creates a bogus(?) route Message-ID: <20160528154122.C1843@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=n-5BTmeRK2mygF_K7vIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 07:19:28 -0000 Sometime between r191220 and r201220, ifconfig started creating a bogus(?) static route. The following is under r248255 with "ifconfig em0 inet 192.168.2.8" (where 192.168.2.8 is for the local host and I don't bother typing the netmsk) done before bringing up lo0: Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire 192.168.2.0/24 link#1 U 0 0 em0 192.168.2.8 link#1 UHS 0 0 lo0 The bogus(?) route points to itself (route get shows this more clearly), and doesn't work. I know little about routiing, but can fix things like this manually. Simply "route delete" on the bogus(?) route works in this case. An alias for lo0 also works. Netif is lo0 although lo0 is not up yet. Normally lo0 is brought up before em0. This makes no obvious difference, but then bringing up lo0 again removes the bogus(?) route. The order em0, lo0, lo0 doesn't remove the bogus(?) route. After the bogus(?) route is removed, netstat -r[n] stops showing any route except in old versions of FreeBSD it does show it as something like "192.168.2.8 UHLW 0 em0 " after using it. (I use many different kernel versions and only a 1 userland version except for utilities like netstat whose ABI keeps breaking, and haven't found newer version of netstat and/or flags on it to show all the details.) Similary for other local machines. After the bogus(?) route is removed, route get 192.168.2.8 shows a working route even before it is used. The main differences are that the destination changes from 192.168.2.8 (self) to 192.168.2.0 (link) and the interface changes from em0 to if0. That actually seems more bogus -- it will have to be translated back to the "bogus(?) route to work. How is this supposed to work? freefall seems to have the bogus(?) route, but it works. Routing utilities seem to be broken on ref11-i386 (route can't even find localhost). Bruce