From 49c3446ebafdd48918f44cdf7bcc9ba2bac55e35 Mon Sep 17 00:00:00 2001 From: tobhe Date: Mon, 5 Jul 2021 12:03:42 +0000 Subject: [PATCH] Print SA MTU if included in pfkey message. ok bluhm@ sthen@ mpi@ --- sbin/ipsecctl/pfkdump.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sbin/ipsecctl/pfkdump.c b/sbin/ipsecctl/pfkdump.c index 4d7d3da7797..cc13c327c5c 100644 --- a/sbin/ipsecctl/pfkdump.c +++ b/sbin/ipsecctl/pfkdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkdump.c,v 1.52 2020/11/05 19:28:27 phessler Exp $ */ +/* $OpenBSD: pfkdump.c,v 1.53 2021/07/05 12:03:42 tobhe Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. @@ -57,6 +57,7 @@ static void print_ident(struct sadb_ext *, struct sadb_msg *, int); static void print_udpenc(struct sadb_ext *, struct sadb_msg *, int); static void print_tag(struct sadb_ext *, struct sadb_msg *, int); static void print_rdomain(struct sadb_ext *, struct sadb_msg *, int); +static void print_mtu(struct sadb_ext *, struct sadb_msg *, int); static void print_tap(struct sadb_ext *, struct sadb_msg *, int); static void print_satype(struct sadb_ext *, struct sadb_msg *, int); static void print_counter(struct sadb_ext *, struct sadb_msg *, int); @@ -108,6 +109,7 @@ struct idname ext_types[] = { { SADB_X_EXT_LIFETIME_LASTUSE, "lifetime_lastuse", print_life }, { SADB_X_EXT_TAG, "tag", print_tag }, { SADB_X_EXT_RDOMAIN, "rdomain", print_rdomain }, + { SADB_X_EXT_MTU, "mtu", print_mtu }, { SADB_X_EXT_TAP, "tap", print_tap }, { SADB_X_EXT_SATYPE2, "satype2", print_satype }, { SADB_X_EXT_COUNTER, "counter", print_counter }, @@ -410,6 +412,14 @@ print_tag(struct sadb_ext *ext, struct sadb_msg *msg, int opts) printf("%s", p); } +static void +print_mtu(struct sadb_ext *ext, struct sadb_msg *msg, int opts) +{ + struct sadb_x_mtu *smtu = (struct sadb_x_mtu *)ext; + + printf("mtu %u", smtu->sadb_x_mtu_mtu); +} + static void print_tap(struct sadb_ext *ext, struct sadb_msg *msg, int opts) { -- 2.20.1