summaryrefslogtreecommitdiff
path: root/include/uapi/linux/xfrm.h
diff options
context:
space:
mode:
authorEyal Birger <eyal.birger@gmail.com>2024-05-27 20:29:14 -0700
committerSteffen Klassert <steffen.klassert@secunet.com>2024-06-26 13:22:42 +0200
commitf531d13bdfe3f4f084aaa8acae2cb0f02295f5ae (patch)
tree4a90306144790ba365971577562c3f74a4eac04e /include/uapi/linux/xfrm.h
parent5233a55a5254ea38dcdd8d836a0f9ee886c3df51 (diff)
downloadlwn-f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae.tar.gz
lwn-f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae.zip
xfrm: support sending NAT keepalives in ESP in UDP states
Add the ability to send out RFC-3948 NAT keepalives from the xfrm stack. To use, Userspace sets an XFRM_NAT_KEEPALIVE_INTERVAL integer property when creating XFRM outbound states which denotes the number of seconds between keepalive messages. Keepalive messages are sent from a per net delayed work which iterates over the xfrm states. The logic is guarded by the xfrm state spinlock due to the xfrm state walk iterator. Possible future enhancements: - Adding counters to keep track of sent keepalives. - deduplicate NAT keepalives between states sharing the same nat keepalive parameters. - provisioning hardware offloads for devices capable of implementing this. - revise xfrm state list to use an rcu list in order to avoid running this under spinlock. Suggested-by: Paul Wouters <paul.wouters@aiven.io> Tested-by: Paul Wouters <paul.wouters@aiven.io> Tested-by: Antony Antony <antony.antony@secunet.com> Signed-off-by: Eyal Birger <eyal.birger@gmail.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include/uapi/linux/xfrm.h')
-rw-r--r--include/uapi/linux/xfrm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/xfrm.h b/include/uapi/linux/xfrm.h
index d950d02ab791..f28701500714 100644
--- a/include/uapi/linux/xfrm.h
+++ b/include/uapi/linux/xfrm.h
@@ -321,6 +321,7 @@ enum xfrm_attr_type_t {
XFRMA_IF_ID, /* __u32 */
XFRMA_MTIMER_THRESH, /* __u32 in seconds for input SA */
XFRMA_SA_DIR, /* __u8 */
+ XFRMA_NAT_KEEPALIVE_INTERVAL, /* __u32 in seconds for NAT keepalive */
__XFRMA_MAX
#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */