From 0accf5554adfa8ff02c02d58042253bfa597bfa2 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Sat, 22 Oct 2022 23:25:41 +0000 Subject: 15114 IP_DONTFRAG more like IP please frag Reviewed by: Dan McDonald Reviewed by: Ryan Zezeski Approved by: Richard Lowe --- usr/src/uts/common/inet/ip/ip.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/inet/ip/ip.c b/usr/src/uts/common/inet/ip/ip.c index 0f6ac91ce6..6063fa01d2 100644 --- a/usr/src/uts/common/inet/ip/ip.c +++ b/usr/src/uts/common/inet/ip/ip.c @@ -26,6 +26,7 @@ * Copyright (c) 2016 by Delphix. All rights reserved. * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. * Copyright 2021 Joyent, Inc. + * Copyright 2022 Oxide Computer Company */ #include @@ -3750,10 +3751,17 @@ ip_get_pmtu(ip_xmit_attr_t *ixa) pmtu = IP_MAXPACKET; /* - * Decide whether whether IPv4 sets DF - * For IPv6 "no DF" means to use the 1280 mtu - */ - if (ixa->ixa_flags & IXAF_PMTU_DISCOVERY) { + * We need to determine if it is acceptable to set DF for IPv4 or not + * and for IPv6 if we need to use the minimum MTU. If a connection has + * opted into path MTU discovery, then we can use 'DF' in IPv4 and do + * not have to constrain ourselves to the IPv6 minimum MTU. There is a + * second consideration here: IXAF_DONTFRAG. This is set as a result of + * someone setting the IP_DONTFRAG or IPV6_DONTFRAG socket option. In + * such a case, it is acceptable to set DF for IPv4 and to use a larger + * MTU. Note, the actual MTU is constrained by the ill_t later on in + * this function. + */ + if (ixa->ixa_flags & (IXAF_PMTU_DISCOVERY | IXAF_DONTFRAG)) { ixa->ixa_flags |= IXAF_PMTU_IPV4_DF; } else { ixa->ixa_flags &= ~IXAF_PMTU_IPV4_DF; -- cgit v1.2.3