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

            Bug ID: 282982
           Summary: ping fails silently, using 0.0.0.0 as source address,
                    when routing goes over a link with no ipv4 address
           Product: Base System
           Version: 14.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: b...@freebsd.org
          Reporter: quentin.theba...@defenso.fr

== Setup ==
Uses RFC7404-like addressing (link-local addresses on VNET jail epairs).

Host
- lo0 alias 192.168.2.1
- epair0a alias fe80::1
- route add 192.168.2.2 -6 fe80::1%epair0a

Jail
- VNET enabled
- lo0 alias 192.168.2.2
- epair0b alias fe80::2
- route add default -6 fe80::2%epair0b

== Test ==
>From host:
# ping 192.168.2.2
-> fails silently, ICMP packets can be seen with 0.0.0.0 source address
# ping -S 192.168.2.1 192.168.2.2
-> succeeds

>From jail:
# ping 192.168.2.1
-> fails with error "no route to host"
# ping -S 192.168.2.2 192.168.2.1
-> succeeds

== Expected output ==
In the first case, ping should tell the user it was not able to find an
appropriate source address and stop.

In the second case, the error message could be made more explicit.

== Cause ==
Unless specified with -S, ping leaves the source address undefined
(INADDR_ANY). From my understanding, the kernel will attempt to use the first
interface address as a source
(https://cgit.freebsd.org/src/tree/sys/netinet/ip_output.c#n640). But if there
is no ipv4 set, it will leave the source as 0.0.0.0.

== Affected systems ==

Encountered on 14.1-RELEASE. Most likely affects other releases and CURRENT
too.

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

Reply via email to