https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285422
Bug ID: 285422
Summary: IPv4 source address selection is broken (with
loopbacks)
Product: Base System
Version: 15.0-CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: kern
Assignee: [email protected]
Reporter: [email protected]
scenario:
# ifconfig lo0 inet 1.1.1.1/32 alias
# route add -inet default fe80::1%igc0
# ping 2.2.2.2
because "igc0" does not have an IPv4 address, FreeBSD will choose "0.0.0.0" as
the source address, and of course, ping will not work.
this behaviour is wrong: if no IPv4 address is configured on the outgoing
interface, it should pick an IPv4 address from a loopback interface, or some
other interface, to be the source address.
i believe this is a bug, because a) every other operating system (Linux, Cisco
IOS, etc.) works the way i described, and b) this is the standard behaviour you
would want on any router.
a workaround is to configure 1.1.1.1/32 on every interface before adding any
routes via those interfaces, but this is clearly absurd and shouldn't be
required.
tested with src ~22b0052fdd95f2b4b2a4fc004c4d2a1e310e1195 on amd64:
FreeBSD nl-myb-1.le-fay.org 15.0-CURRENT FreeBSD 15.0-CURRENT #11
lf/main-n269119-e33cc38666c3: Wed Mar 5 02:46:51 GMT 2025
[email protected]:/build/obj/freebsd/build/src/freebsd/lf/main/amd64.amd64/sys/LF-PF
amd64
--
You are receiving this mail because:
You are the assignee for the bug.