NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/58016: wg-userspace(8) requires explicit route setup
The following reply was made to PR bin/58016; it has been noted by GNATS.
From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/58016: wg-userspace(8) requires explicit route setup
Date: Sun, 10 Mar 2024 08:44:50 -0000 (UTC)
riastradh%NetBSD.org@localhost (Taylor R Campbell) writes:
>(Still unclear on why, in the default IFF_POINTOPOINT setting of
>tun(4), an explicit route is needed only for IPv4 while the system
>automagically adds the necessary route for IPv6.)
That is 4.4BSD-Lite2:
if (ifp->if_flags & IFF_BROADCAST) {
ia->ia_broadaddr.sin_addr.s_addr =
htonl(ia->ia_subnet | ~ia->ia_subnetmask);
ia->ia_netbroadcast.s_addr =
htonl(ia->ia_net | ~ ia->ia_netmask);
} else if (ifp->if_flags & IFF_LOOPBACK) {
ia->ia_ifa.ifa_dstaddr = ia->ia_ifa.ifa_addr;
flags |= RTF_HOST;
} else if (ifp->if_flags & IFF_POINTOPOINT) {
if (ia->ia_dstaddr.sin_family != AF_INET)
return (0);
flags |= RTF_HOST;
}
if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, flags)) == 0)
ia->ia_flags |= IFA_ROUTE;
For POINTOPOINT interfaces, there is a host route to the peer,
and any network mask is ignored.
The notion of having multiple destinations on a POINTOPOINT
interface is also a strange one. The original use was for
a synchronous serial line, not a multi-target tunnel.
Home |
Main Index |
Thread Index |
Old Index