From: Kristof Provost Date: Tue, 29 Jul 2025 12:55:29 +0200 Message-ID: In-Reply-To: <20250729093857.37832-1-kprovost@...2661...> References: <20250729093857.37832-1-kprovost@...2661...> MIME-Version: 1.0 Subject: Re: [Openvpn-devel] [PATCH 1/2] dco-freebsd: pass address scope to the kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable To: openvpn-devel This requires kernel side support: [https://reviews.freebsd.org/D51596](htt= ps://reviews.freebsd.org/D51596) =E2=80=94 Kristof On 29 Jul 2025, at 11:38, Kristof Provost wrote: > From: Kristof Provost > > To support link-local (IPv6) addresses we must pass the scope to the kern= el as > well. We should also extract it from the kernel notification for float ev= ents. > > Signed-off-by: Kristof Provost > --- > src/openvpn/dco_freebsd.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c > index 8add41af..306ecd31 100644 > --- a/src/openvpn/dco_freebsd.c > +++ b/src/openvpn/dco_freebsd.c > @@ -62,6 +62,7 @@ sockaddr_to_nvlist(const struct sockaddr *sa) > const struct sockaddr_in6 *in6 =3D (const struct sockaddr_in= 6 *)sa; > nvlist_add_binary(nvl, "address", &in6->sin6_addr, sizeof(in= 6->sin6_addr)); > nvlist_add_number(nvl, "port", in6->sin6_port); > + nvlist_add_number(nvl, "scopeid", in6->sin6_scope_id); > break; > } > > @@ -118,6 +119,11 @@ nvlist_to_sockaddr(const nvlist_t *nvl, struct socka= ddr_storage *ss) > assert(len =3D=3D sizeof(in6->sin6_addr)); > memcpy(&in6->sin6_addr, data, sizeof(in6->sin6_addr)); > in6->sin6_port =3D nvlist_get_number(nvl, "port"); > + > + if (nvlist_exists_number(nvl, "scopeid")) > + { > + in6->sin6_scope_id =3D nvlist_get_number(nvl, "scopeid"); > + } > break; > } > > --=20 > 2.50.1