diff options
| author | Hannes Frederic Sowa <[email protected]> | 2013-08-13 02:35:58 +0000 |
|---|---|---|
| committer | Steffen Klassert <[email protected]> | 2013-08-14 11:09:07 +0000 |
| commit | 0ea9d5e3e0e03a63b11392f5613378977dae7eca (patch) | |
| tree | a363333080f9f8647f3f80dc7e736a308c36b7cb /net/ipv6/xfrm6_output.c | |
| parent | xfrm: make local error reporting more robust (diff) | |
| download | kernel-0ea9d5e3e0e03a63b11392f5613378977dae7eca.tar.gz kernel-0ea9d5e3e0e03a63b11392f5613378977dae7eca.zip | |
xfrm: introduce helper for safe determination of mtu
skb->sk socket can be of AF_INET or AF_INET6 address family. Thus we
always have to make sure we a referring to the correct interpretation
of skb->sk.
We only depend on header defines to query the mtu, so we don't introduce
a new dependency to ipv6 by this change.
Cc: Steffen Klassert <[email protected]>
Signed-off-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
Diffstat (limited to 'net/ipv6/xfrm6_output.c')
| -rw-r--r-- | net/ipv6/xfrm6_output.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index b64fff30eb06..3ac5ab264fed 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c @@ -138,7 +138,10 @@ static int __xfrm6_output(struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); struct xfrm_state *x = dst->xfrm; - int mtu = ip6_skb_dst_mtu(skb); + int mtu = xfrm_skb_dst_mtu(skb); + + if (mtu < IPV6_MIN_MTU) + mtu = IPV6_MIN_MTU; if (skb->len > mtu && xfrm6_local_dontfrag(skb)) { xfrm6_local_rxpmtu(skb, mtu); |
