[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>
This commit is contained in:
Patrick McHardy 2007-06-18 22:30:15 -07:00 коммит произвёл David S. Miller
Родитель fa490cfd15
Коммит 281216177a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;
}