aboutsummaryrefslogtreecommitdiff
path: root/sys/netipsec/ipsec.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2024-12-29 07:12:26 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-01-13 19:29:32 +0000
commit0ff2d00d2aa37cd883ffd8c7363dddef9cba267e (patch)
treef2907311f4ad3bf405f3549722286463ab6b760a /sys/netipsec/ipsec.h
parentb0e020764aae970545357b0f146dcba7b4b55864 (diff)
ipsec: allow it to work with unmapped mbufs
Only map mbuf when a policy is looked up and indicates that IPSEC needs to transform the packet. If IPSEC is inline offloaded, it is up to the interface driver to request remap if needed. Fetch the IP header using m_copydata() instead of using mtod() to select policy/SA. Reviewed by: markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D48265
Diffstat (limited to 'sys/netipsec/ipsec.h')
-rw-r--r--sys/netipsec/ipsec.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h
index 8f3e8f02d88b..f8c5b10e7bd6 100644
--- a/sys/netipsec/ipsec.h
+++ b/sys/netipsec/ipsec.h
@@ -325,6 +325,7 @@ VNET_DECLARE(int, natt_cksum_policy);
#endif
struct inpcb;
+struct ip;
struct m_tag;
struct secasvar;
struct sockopt;
@@ -336,7 +337,7 @@ int ipsec_if_input(struct mbuf *, struct secasvar *, uint32_t);
struct ipsecrequest *ipsec_newisr(void);
void ipsec_delisr(struct ipsecrequest *);
struct secpolicy *ipsec4_checkpolicy(const struct mbuf *, struct inpcb *,
- int *, int);
+ struct ip *, int *, int);
u_int ipsec_get_reqlevel(struct secpolicy *, u_int);
@@ -351,12 +352,13 @@ size_t ipsec_hdrsiz_internal(struct secpolicy *);
void ipsec_setspidx_inpcb(struct inpcb *, struct secpolicyindex *, u_int);
-void ipsec4_setsockaddrs(const struct mbuf *, union sockaddr_union *,
- union sockaddr_union *);
+void ipsec4_setsockaddrs(const struct mbuf *, const struct ip *,
+ union sockaddr_union *, union sockaddr_union *);
int ipsec4_common_input_cb(struct mbuf *, struct secasvar *, int, int);
-int ipsec4_check_pmtu(struct ifnet *, struct mbuf *, struct secpolicy *, int);
-int ipsec4_process_packet(struct ifnet *, struct mbuf *, struct secpolicy *,
- struct inpcb *, u_long);
+int ipsec4_check_pmtu(struct ifnet *, struct mbuf *, struct ip *ip1,
+ struct secpolicy *, int);
+int ipsec4_process_packet(struct ifnet *, struct mbuf *, struct ip *ip1,
+ struct secpolicy *, struct inpcb *, u_long);
int ipsec_process_done(struct mbuf *, struct secpolicy *, struct secasvar *,
u_int);