loopback routes pinned by commit r326012 for FreeBSD 10 cannot be deleted

Andreas Longwitz longwitz at incore.de
Fri Feb 23 20:20:03 UTC 2018


When an IP address is being added to an interface, the kernel installs
loopback route:

After "ifconfig fxp0 inet 10.0.0.100 netmask 255.255.255.0" the command
"netstat -rn" gives

Internet:
Destination        Gateway            Flags    Refs      Use  Netif
default            192.168.14.242     UGS         1    91639   msk0
10.0.0.0/24        link#8             U           0        6   fxp0
10.0.0.100         link#8             UHS         0        0    lo0
127.0.0.1          link#21            UH          0     6366    lo0

After "ifconfig fxp0 delete" in FreeBSD 10 before r326012 the kernel
deletes the loopback route and output of "netstat -rn" gives

Internet:
Destination        Gateway            Flags    Refs      Use  Netif
default            192.168.14.242     UGS         1    91639   msk0
127.0.0.1          link#21            UH          0     6366    lo0

After r326012 we see

Internet:
Destination        Gateway            Flags    Refs      Use  Netif
default            192.168.14.242     UGS         1    91639   msk0
10.0.0.100         link#8             UHS         0        0    lo0
127.0.0.1          link#21            UH          0     6366    lo0

Also the loopback route can not be deleted manually:

route delete 10.0.0.100 -->
route: writing to routing socket: Address already in use
delete host 10.0.0.100 fib 0: gateway uses the same route


-- 
Andreas Longwitz



More information about the freebsd-net mailing list