[Bug 296631] inet: can't assign local side of PtP address as other interface address

[email protected] Thu, 09 Jul 2026 00:42:17 +0000
Newsgroups gmane.os.freebsd.devel.net
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296631

            Bug ID: 296631
           Summary: inet: can't assign local side of PtP address as other
                    interface address
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

using 16.0-CURRENT from ~29 May.

after assigning an IP address as the local side of a point-to-point address,
the local side of the address cannot be assigned to another interface:

[18!] tansy ~# ifconfig tun create
tun0
[19!] tansy ~# ifconfig tun0 inet 10.0.0.1/32 10.0.0.2
[20!] tansy ~# ifconfig lo0 inet 10.0.0.1/32
ifconfig: ioctl (SIOCAIFADDR): File exists
[1? 21!] tansy ~#

however, this does work if the addresses are assigned the other way around:

[25!] tansy ~# ifconfig lo0 inet 10.0.0.1/32
[26!] tansy ~# ifconfig tun create
tun0
[27!] tansy ~# ifconfig tun0 inet 10.0.0.1/32 10.0.0.2
[28!] tansy ~#

i think this must be a bug, because either the address can be assigned to both
tun0 and lo0 or it can't; it shouldn't matter in what order the assignment is
done.

personally, i think this should always be allowed, since it permits configuring
a local loopback address as the local side of a tunnel interface, which is
useful in certain situations involving unnumbered tunnels.

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