lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 15 Sep 2023 20:15:17 -0400
From: Christian Hopps <chopps@...pps.org>
To: devel@...ux-ipsec.org
Cc: Steffen Klassert <steffen.klassert@...unet.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        netdev@...r.kernel.org,
        Christian Hopps <chopps@...n.net>,
        Christian Hopps <chopps@...pps.org>
Subject: [PATCH ipsec-next] xfrm: add comments in the xfrm mtu calc function

Document the [p]mtu values used by, and calculated for xfrms.

Signed-off-by: Christian Hopps <chopps@...pps.org>
---
 net/xfrm/xfrm_policy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 5c61ec04b839..2480717654b6 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -3858,15 +3858,19 @@ static void xfrm_init_pmtu(struct xfrm_dst **bundle, int nr)
 		u32 pmtu, route_mtu_cached;
 		struct dst_entry *dst;

+		/* Get the xfrm's dst [p]mtu (i.e., the xfrm's intf/route). */
 		dst = &xdst->u.dst;
 		pmtu = dst_mtu(xfrm_dst_child(dst));
 		xdst->child_mtu_cached = pmtu;

+		/* Subtract the xfrm mode overhead. */
 		pmtu = xfrm_state_mtu(dst->xfrm, pmtu);

+		/* Get the inner traffic route's MTU. */
 		route_mtu_cached = dst_mtu(xdst->route);
 		xdst->route_mtu_cached = route_mtu_cached;

+		/* Update the xfrm's dst MTU to the minimum of these. */
 		if (pmtu > route_mtu_cached)
 			pmtu = route_mtu_cached;

--
2.41.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ