[Bug 253620] Calling route delete with an invalid gateway deletes the route

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 18 14:13:49 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253620

            Bug ID: 253620
           Summary: Calling route delete with an invalid gateway deletes
                    the route
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: lgupta at blackberry.com

I would have expected to see an ESRCH if the provided gateway does not match
the destination specified. See log below.

root at lgbsd:~/Desktop # netstat -r
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.180.2      UGS         em0
localhost          link#2             UH          lo0
192.168.180.0/24   link#1             U           em0
192.168.180.128    link#1             UHS         lo0

Internet6:
Destination        Gateway            Flags     Netif Expire
::/96              localhost          UGRS        lo0
localhost          link#2             UH          lo0
::ffff:0.0.0.0/96  localhost          UGRS        lo0
fe80::/10          localhost          UGRS        lo0
fe80::%lo0/64      link#2             U           lo0
fe80::1%lo0        link#2             UHS         lo0
ff02::/16          localhost          UGRS        lo0

root at lgbsd:~/Desktop # route delete -net default 10.11.12.13
delete net default: gateway 10.11.12.13

root at lgbsd:~/Desktop # netstat -r
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
localhost          link#2             UH          lo0
192.168.180.0/24   link#1             U           em0
192.168.180.128    link#1             UHS         lo0

Internet6:
Destination        Gateway            Flags     Netif Expire
::/96              localhost          UGRS        lo0
localhost          link#2             UH          lo0
::ffff:0.0.0.0/96  localhost          UGRS        lo0
fe80::/10          localhost          UGRS        lo0
fe80::%lo0/64      link#2             U           lo0
fe80::1%lo0        link#2             UHS         lo0
ff02::/16          localhost          UGRS        lo0


I can then also delete the destination subnet route and that causes all traffic
to fail.

root at lgbsd:~/Desktop # route delete -net 192.168.180.0/24 10.11.12.13
delete net 192.168.180.0: gateway 10.11.12.13

root at lgbsd:~/Desktop # ping 192.168.180.1
PING 192.168.180.1 (192.168.180.1): 56 data bytes
ping: sendto: No route to host

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list