diff options
author | Patrick McHardy <kaber@trash.net> | 2007-06-19 01:30:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-06-19 01:30:15 -0400 |
commit | 281216177a407f78cfd650ee4391afc487577193 (patch) | |
tree | 47325468a011757f3c4169e83d3172b744b5c9e5 /net | |
parent | fa490cfd15d7ce0900097cc4e60cfd7a76381138 (diff) |
[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 <pupilla@hotmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/xfrm/xfrm_state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 85f3f43a6cca..dfacb9c2a6e3 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1729,7 +1729,7 @@ int xfrm_state_mtu(struct xfrm_state *x, int mtu) | |||
1729 | x->type && x->type->get_mtu) | 1729 | x->type && x->type->get_mtu) |
1730 | res = x->type->get_mtu(x, mtu); | 1730 | res = x->type->get_mtu(x, mtu); |
1731 | else | 1731 | else |
1732 | res = mtu; | 1732 | res = mtu - x->props.header_len; |
1733 | spin_unlock_bh(&x->lock); | 1733 | spin_unlock_bh(&x->lock); |
1734 | return res; | 1734 | return res; |
1735 | } | 1735 | } |