summaryrefslogtreecommitdiff
path: root/sys/net/pfkeyv2.c
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2021-07-05 12:01:21 +0000
committertobhe <tobhe@cvs.openbsd.org>2021-07-05 12:01:21 +0000
commitae28cdc182dee1a511b5cf201b30ddb84f422f59 (patch)
treecf3ad820d8bbb81f642fde23e04883907e9eed6a /sys/net/pfkeyv2.c
parente705188ae4173be816a2cc1f3506d566d215a407 (diff)
Export tdb MTU to userland via SADB_GET. This helps debug path MTU
discovery issues with ESP in UDP. ok bluhm@ sthen@ mpi@
Diffstat (limited to 'sys/net/pfkeyv2.c')
-rw-r--r--sys/net/pfkeyv2.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index c7c09f6fec0..66ab56eb624 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.c,v 1.215 2021/05/30 21:01:27 bluhm Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.216 2021/07/05 12:01:20 tobhe Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -859,6 +859,9 @@ pfkeyv2_get(struct tdb *tdb, void **headers, void **buffer, int *lenp,
if (tdb->tdb_udpencap_port)
i += sizeof(struct sadb_x_udpencap);
+ if (tdb->tdb_mtu > 0)
+ i+= sizeof(struct sadb_x_mtu);
+
if (tdb->tdb_rdomain != tdb->tdb_rdomain_post)
i += sizeof(struct sadb_x_rdomain);
@@ -952,6 +955,11 @@ pfkeyv2_get(struct tdb *tdb, void **headers, void **buffer, int *lenp,
export_udpencap(&p, tdb);
}
+ if (tdb->tdb_mtu > 0) {
+ headers[SADB_X_EXT_MTU] = p;
+ export_mtu(&p, tdb);
+ }
+
/* Export rdomain switch, if present */
if (tdb->tdb_rdomain != tdb->tdb_rdomain_post) {
headers[SADB_X_EXT_RDOMAIN] = p;