Skip to content

Commit 5ce234a

Browse files
author
Paolo Abeni
committed
Merge tag 'ipsec-2026-01-14' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec
Steffen Klassert says: ==================== pull request (net): ipsec 2026-01-14 1) Fix inner mode lookup in tunnel mode GSO segmentation. The protocol was taken from the wrong field. 2) Set ipv4 no_pmtu_disc flag only on output SAs. The insertation of input SAs can fail if no_pmtu_disc is set. Please pull or let me know if there are problems. ipsec-2026-01-14 * tag 'ipsec-2026-01-14' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec: xfrm: set ipv4 no_pmtu_disc flag only on output sa when direction is set xfrm: Fix inner mode lookup in tunnel mode GSO segmentation ==================== Link: https://patch.msgid.link/20260114121817.1106134-1-steffen.klassert@secunet.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents 4156c37 + c196def commit 5ce234a

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

net/ipv4/esp4_offload.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ static struct sk_buff *xfrm4_tunnel_gso_segment(struct xfrm_state *x,
122122
struct sk_buff *skb,
123123
netdev_features_t features)
124124
{
125-
const struct xfrm_mode *inner_mode = xfrm_ip2inner_mode(x,
126-
XFRM_MODE_SKB_CB(skb)->protocol);
125+
struct xfrm_offload *xo = xfrm_offload(skb);
126+
const struct xfrm_mode *inner_mode = xfrm_ip2inner_mode(x, xo->proto);
127127
__be16 type = inner_mode->family == AF_INET6 ? htons(ETH_P_IPV6)
128128
: htons(ETH_P_IP);
129129

net/ipv6/esp6_offload.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ static struct sk_buff *xfrm6_tunnel_gso_segment(struct xfrm_state *x,
158158
struct sk_buff *skb,
159159
netdev_features_t features)
160160
{
161-
const struct xfrm_mode *inner_mode = xfrm_ip2inner_mode(x,
162-
XFRM_MODE_SKB_CB(skb)->protocol);
161+
struct xfrm_offload *xo = xfrm_offload(skb);
162+
const struct xfrm_mode *inner_mode = xfrm_ip2inner_mode(x, xo->proto);
163163
__be16 type = inner_mode->family == AF_INET ? htons(ETH_P_IP)
164164
: htons(ETH_P_IPV6);
165165

net/xfrm/xfrm_state.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3151,6 +3151,7 @@ int __xfrm_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
31513151
int err;
31523152

31533153
if (family == AF_INET &&
3154+
(!x->dir || x->dir == XFRM_SA_DIR_OUT) &&
31543155
READ_ONCE(xs_net(x)->ipv4.sysctl_ip_no_pmtu_disc))
31553156
x->props.flags |= XFRM_STATE_NOPMTUDISC;
31563157

0 commit comments

Comments
 (0)