Skip to contentSkip to conversation

: Fix MTU calculation for non-ESP SAs

XFRM Patrick McHardy 2 participants 3 messages Jun 18, 2007 – Jun 19, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

[XFRM]: Fix MTU calculation for non-ESP SAs

My IPsec MTU optimization patch introduced a regression in MTU calculation for non-ESP SAs, the SA's header_len needs to be subtracted from the MTU if the transform doesn't provide a ->get_mtu() function.

Reported-and-tested-by Marco Berizzi <[email protected]>

---
commit b31d763b8a6b9a6eba5b5805f81ae605ebeab475
tree 6beec3612b419286bf9d7c7b98551ee30172da01
parent 188e1f81ba31af1b65a2f3611df4c670b092bbac
author Patrick McHardy <[email protected]> Mon, 18 Jun 2007 17:57:09 +0200 committer Patrick McHardy <[email protected]> Mon, 18 Jun 2007 17:57:09 +0200

 net/xfrm/xfrm_state.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/xfrm/xfrm_state.c +1 -1
index 85f3f43..dfacb9c 100644
@@ -1729,7 +1729,7 @@ int xfrm_state_mtu(struct xfrm_state *x, int mtu)
 	    x->type && x->type->get_mtu)
 		res = x->type->get_mtu(x, mtu);
 	else
-		res = mtu;
+		res = mtu - x->props.header_len;
 	spin_unlock_bh(&x->lock);
 	return res;
 }
maintainer
#1 lore raw

From: Patrick McHardy <[email protected]>
Date: Mon, 18 Jun 2007 18:09:11 +0200

Quoted 9 lines

[XFRM]: Fix MTU calculation for non-ESP SAs

My IPsec MTU optimization patch introduced a regression in MTU calculation for non-ESP SAs, the SA's header_len needs to be subtracted from the MTU if the transform doesn't provide a ->get_mtu() function.

Reported-and-tested-by Marco Berizzi <[email protected]>

Patch applied, thanks a lot Patrick.

We only need this for 2.6.22 right?

#2 lore raw
Quoted 6 lines · David Miller

From: Patrick McHardy <[email protected]>
Date: Mon, 18 Jun 2007 18:09:11 +0200

Quoted 2 lines

[XFRM]: Fix MTU calculation for non-ESP SAs

Quoted 8 lines
Quoted 4 lines

My IPsec MTU optimization patch introduced a regression in MTU calculation for non-ESP SAs, the SA's header_len needs to be subtracted from the MTU if the transform doesn't provide a ->get_mtu() function.

Patch applied, thanks a lot Patrick.

We only need this for 2.6.22 right?

Yes, the patch that broke this went into the first 2.6.22-rc.