From owner-freebsd-net@freebsd.org Sat Feb 24 15:53:17 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CBFEF2A079 for ; Sat, 24 Feb 2018 15:53:17 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03F4A69E81 for ; Sat, 24 Feb 2018 15:53:16 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id 8BDEC3AF; Sat, 24 Feb 2018 16:53:15 +0100 (CET) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id Pnc9KYG8lbJt; Sat, 24 Feb 2018 16:53:14 +0100 (CET) Received: from mail.local.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id 89BCD37B; Sat, 24 Feb 2018 16:53:14 +0100 (CET) Received: from bsdmhs.longwitz (unknown [192.168.99.6]) by mail.local.incore (Postfix) with ESMTP id 58714508A1; Sat, 24 Feb 2018 16:53:14 +0100 (CET) Message-ID: <5A918A69.6040801@incore.de> Date: Sat, 24 Feb 2018 16:53:13 +0100 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Eugene Grosbein CC: freebsd-net@freebsd.org Subject: Re: loopback routes pinned by commit r326012 for FreeBSD 10 cannot be deleted References: <5A9075CB.10408@incore.de> <5A90E679.3030106@grosbein.net> <5A915C9D.7020000@incore.de> <5A9162C9.5050206@grosbein.net> <5A9166F4.1080100@grosbein.net> In-Reply-To: <5A9166F4.1080100@grosbein.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 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, 24 Feb 2018 15:53:17 -0000 > I mean, route(8). Please try this patch that restores its ability to manually remove such routes. > > Index: sbin/route/route.c > =================================================================== > --- sbin/route/route.c (revision 329903) > +++ sbin/route/route.c (working copy) > @@ -1535,8 +1535,10 @@ rtmsg(int cmd, int flags, int fib) > so[RTAX_IFP].ss_len = sizeof(struct sockaddr_dl); > rtm_addrs |= RTA_IFP; > } > - } else > + } else { > cmd = RTM_DELETE; > + flags |= RTF_PINNED; > + } > #define rtm m_rtmsg.m_rtm > rtm.rtm_type = cmd; > rtm.rtm_flags = flags; > OK, that works: netstat -rn --> Internet: Destination Gateway Flags Netif Expire default 192.168.0.250 UGS em0 10.1.2.0/24 link#2 U em1 10.1.2.3 link#2 UHS lo0 127.0.0.1 link#13 UH lo0 192.168.0.0/24 link#1 U em0 192.168.0.114 link#1 UHS lo0 route delete 10.1.2.3 --> delete host 10.1.2.3 fib 0 netstat -rn --> Internet: Destination Gateway Flags Netif Expire default 192.168.0.250 UGS em0 10.1.2.0/24 link#2 U em1 127.0.0.1 link#13 UH lo0 192.168.0.0/24 link#1 U em0 192.168.0.114 link#1 UHS lo0 Andreas Longwitz