[PATCH 06/12] if_ipsec: Port and add to everything-buildset.

Christian Mauderer christian.mauderer at embedded-brains.de
Wed Aug 1 08:04:48 UTC 2018


This ports the kernel space parts for ipsec and adds them to the
everything-buildset.
---
 buildset/default.ini                         | 1 +
 buildset/everything.ini                      | 1 +
 freebsd/sys/net/if_ipsec.c                   | 4 ++++
 libbsd.py                                    | 2 ++
 rtemsbsd/include/rtems/bsd/local/opt_ipsec.h | 5 +++++
 5 files changed, 13 insertions(+)

diff --git a/buildset/default.ini b/buildset/default.ini
index a5cbdf9c..881cb048 100644
--- a/buildset/default.ini
+++ b/buildset/default.ini
@@ -50,6 +50,7 @@ net = on
 net80211 = off
 netinet = on
 netinet6 = on
+netipsec = off
 opencrypto = on
 pci = on
 pf = on
diff --git a/buildset/everything.ini b/buildset/everything.ini
index 0d9cc5fb..e5593f59 100644
--- a/buildset/everything.ini
+++ b/buildset/everything.ini
@@ -13,3 +13,4 @@ dev_wlan_rtwn = on
 net80211 = on
 user_space_wlanstats = on
 usr_sbin_wpa_supplicant = on
+netipsec = on
diff --git a/freebsd/sys/net/if_ipsec.c b/freebsd/sys/net/if_ipsec.c
index 76eb07d9..13d3f44b 100644
--- a/freebsd/sys/net/if_ipsec.c
+++ b/freebsd/sys/net/if_ipsec.c
@@ -174,7 +174,11 @@ ipsec_clone_create(struct if_clone *ifc, int unit, caddr_t params)
 	struct ifnet *ifp;
 
 	sc = malloc(sizeof(*sc), M_IPSEC, M_WAITOK | M_ZERO);
+#ifndef __rtems__
 	sc->fibnum = curthread->td_proc->p_fibnum;
+#else /* __rtems__ */
+	sc->fibnum = BSD_DEFAULT_FIB;
+#endif /* __rtems__ */
 	sc->ifp = ifp = if_alloc(IFT_TUNNEL);
 	IPSEC_LOCK_INIT(sc);
 	ifp->if_softc = sc;
diff --git a/libbsd.py b/libbsd.py
index 05e9dd51..b15779bb 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -1988,6 +1988,7 @@ class netipsec(builder.Module):
         mm = self.manager
         self.addKernelSpaceHeaderFiles(
             [
+                'sys/net/if_ipsec.h',
                 'sys/netipsec/ah.h',
                 'sys/netipsec/ah_var.h',
                 'sys/netipsec/esp.h',
@@ -2007,6 +2008,7 @@ class netipsec(builder.Module):
         )
         self.addKernelSpaceSourceFiles(
             [
+                'sys/net/if_ipsec.c',
                 'sys/netipsec/ipsec.c',
                 'sys/netipsec/ipsec_input.c',
                 'sys/netipsec/ipsec_mbuf.c',
diff --git a/rtemsbsd/include/rtems/bsd/local/opt_ipsec.h b/rtemsbsd/include/rtems/bsd/local/opt_ipsec.h
index e69de29b..ff8e715b 100644
--- a/rtemsbsd/include/rtems/bsd/local/opt_ipsec.h
+++ b/rtemsbsd/include/rtems/bsd/local/opt_ipsec.h
@@ -0,0 +1,5 @@
+#include <rtems/bsd/modules.h>
+#ifdef RTEMS_BSD_MODULE_NETIPSEC
+  #define IPSEC 1
+  #define TCP_SIGNATURE 1
+#endif
-- 
2.13.7




More information about the devel mailing list