[Openvpn-devel] pass vpn addresses to the kernel

Message ID 20220413115811.22534-2-kprovost@netgate.com
State Not Applicable
Headers show
Series [Openvpn-devel] pass vpn addresses to the kernel | expand

Commit Message

Kristof Provost via Openvpn-devel April 13, 2022, 1:58 a.m. UTC
From: Kristof Provost <kp@FreeBSD.org>

---
 src/openvpn/dco_freebsd.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch

diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c
index 3f8b39e0..8c300639 100644
--- a/src/openvpn/dco_freebsd.c
+++ b/src/openvpn/dco_freebsd.c
@@ -91,6 +91,17 @@  dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd,
         nvlist_add_nvlist(nvl, "remote", sockaddr_to_nvlist(remoteaddr));
     }
 
+    if (remote_in4)
+    {
+        nvlist_add_binary(nvl, "vpn_ipv4", &remote_in4->s_addr,
+            sizeof(remote_in4->s_addr));
+    }
+
+    if (remote_in6)
+    {
+        nvlist_add_binary(nvl, "vpn_ipv6", remote_in6, sizeof(*remote_in6));
+    }
+
     nvlist_add_number(nvl, "fd", sd);
     nvlist_add_number(nvl, "peerid", peerid);