[Bug 278232] Jail IPv4 source address selection inside a jail not working

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 07 Apr 2024 12:56:34 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278232

            Bug ID: 278232
           Summary: Jail IPv4 source address selection inside a jail not
                    working
           Product: Base System
           Version: 14.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: dinoex@FreeBSD.org

Jail IPv4 source address selection inside a jail not working
after upgrade from FreeBSD-13.2 to FreeBSD-14.0.

There seems something wrong about source address selection on plain jails.

igb0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP>
metric 0 mtu 1500
       
options=48104b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,LRO,VLAN_HWFILTER,HWSTATS,MEXTPG>
        ether ac:1f:6b:47:83:8a
        inet 194.XXX.XXX.43 netmask 0xffffffff broadcast 194.XXX.XXX.43
        inet 192.168.22.43 netmask 0xffffffff broadcast 192.168.22.43
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

/etc/jail.conf:

service {
        ip4.addr = 194.XXX.XXX.43, 192.168.22.43;
        ip4.saddrsel;
        interface = "igb0";
        exec.fib = 0;
        devfs_ruleset = 9;
        allow.sysvipc;
        allow.raw_sockets;
}

works:
# ping -S 192.168.22.43 192.168.22.16

working with FreeBSD-13.2
# ping 192.168.22.16

failed with FreeBSD-14.0
# ping 192.168.22.16

using tcpdump on the host I see:
with FreeBSD-13.2, the ping uses source "192.168.22.43"
with FreeBSD-14.0, the ping uses source "194.XXX.XXX.43"

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