Making backup GRE link and getting destination IP address from another link (OSPF, bird2, frr). # ifconfig gre3 gre3: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500 options=80000<LINKSTATE> tunnel inet 10.8.98.3 --> 10.8.98.1 groups: gre nd6 options=9<PERFORMNUD,IFDISABLED> # route get 10.8.34.65/30 route to: 10.8.34.65 destination: 10.8.34.64 mask: 255.255.255.252 gateway: 10.8.34.2 fib: 0 interface: ipsec0 flags: <UP,GATEWAY,DONE,PROTO1> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 # route get 10.8.34.66 route to: 10.8.34.66 destination: 10.8.34.66 gateway: 10.8.34.2 fib: 0 interface: ipsec0 flags: <UP,GATEWAY,HOST,DONE,PROTO1> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 # ifconfig gre3 10.8.34.65/30 10.8.34.66 ifconfig: ioctl (SIOCAIFADDR): File exists It works properly here # route delete 10.8.34.66 && ifconfig gre3 10.8.34.65/30 10.8.34.66 && echo ok delete host 10.8.34.66 ok and here, when another IP from /30 is used #ifconfig gre3 10.8.34.65/30 10.8.34.67 && echo ok ok # uname -a | blur FreeBSD ... 13.2-RELEASE-p10 FreeBSD 13.2-RELEASE-p10 GENERIC amd64 Expecting local assignments should have more priority. Didn't tried with another FreeBSD release, but 13.2 is affected.
A shorter way to reproduce it: # route add -net 192.0.2.0/24 -interface vtnet0 add net 192.0.2.0: gateway vtnet0 # ifconfig epair create epair0a # ifconfig epair0a inet 192.0.2.1/24 ifconfig: ioctl (SIOCAIFADDR): File exists I'm also not used to first having to delete the route in order to assign an address that's already in the routing table.
Please see https://reviews.freebsd.org/D47534 that should fix this one.
(In reply to Alexander V. Chernikov from comment #2) Amazing!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1da4954c92ea7585b352ba830d3ee64ca69ada52 commit 1da4954c92ea7585b352ba830d3ee64ca69ada52 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2024-11-12 23:36:50 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2024-11-12 23:36:50 +0000 Fix failure to add an interface prefix route when route with the same prefix is already presented in the routing table. PR: 277125 Reported by: Oleksandr Ignatyev <alex@i.org.ua> Reviewed by: ae, jlduran Tested by: jlduran Differential Revision: https://reviews.freebsd.org/D47534 MFC after: 2 weeks sys/net/route/route_ctl.c | 13 ++++++++----- sys/net/route/route_ctl.h | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d62b2d8f3a4711724d984102daa0bd0a5351f8b9 commit d62b2d8f3a4711724d984102daa0bd0a5351f8b9 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2024-11-12 23:36:50 +0000 Commit: Eugene Grosbein <eugen@FreeBSD.org> CommitDate: 2025-01-11 12:25:16 +0000 Fix failure to add an interface prefix route when route with the same prefix is already presented in the routing table. PR: 277125 Reported by: Oleksandr Ignatyev <alex@i.org.ua> Reviewed by: ae, jlduran Tested by: jlduran Differential Revision: https://reviews.freebsd.org/D47534 (cherry picked from commit 1da4954c92ea7585b352ba830d3ee64ca69ada52) sys/net/route/route_ctl.c | 13 ++++++++----- sys/net/route/route_ctl.h | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f57df4589d3cd91dac88b2c9edb80ad0eb50979c commit f57df4589d3cd91dac88b2c9edb80ad0eb50979c Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2024-11-12 23:36:50 +0000 Commit: Eugene Grosbein <eugen@FreeBSD.org> CommitDate: 2025-01-11 12:34:48 +0000 Fix failure to add an interface prefix route when route with the same prefix is already presented in the routing table. PR: 277125 Reported by: Oleksandr Ignatyev <alex@i.org.ua> Reviewed by: ae, jlduran Tested by: jlduran Differential Revision: https://reviews.freebsd.org/D47534 (cherry picked from commit 1da4954c92ea7585b352ba830d3ee64ca69ada52) sys/net/route/route_ctl.c | 13 ++++++++----- sys/net/route/route_ctl.h | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-)