Date: Sat, 24 Feb 2018 20:21:56 +0700 From: Eugene Grosbein <eugen@grosbein.net> To: Andreas Longwitz <longwitz@incore.de> Cc: freebsd-net@freebsd.org Subject: Re: loopback routes pinned by commit r326012 for FreeBSD 10 cannot be deleted Message-ID: <5A9166F4.1080100@grosbein.net> In-Reply-To: <5A9162C9.5050206@grosbein.net> References: <5A9075CB.10408@incore.de> <5A90E679.3030106@grosbein.net> <5A915C9D.7020000@incore.de> <5A9162C9.5050206@grosbein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
24.02.2018 20:04, Eugene Grosbein wrote:
>> But deleting the loopback route manually does not work anymore, is this
>> intended behaviour ?
>>
>> I would like to control the routing table as much as possible.
>
> This is side effect of loopback routes being intentionally protected with RTF_PINNED flag
> in recent FreeBSD versions so that link routes can override ones installed by routing daemons.
>
> Perhaps, ifconfig(8) utility should be extended to use RTF_PINNED to be able to modify such routes.
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5A9166F4.1080100>
