aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_output.c
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2013-08-12 22:35:58 -0400
committerSteffen Klassert <steffen.klassert@secunet.com>2013-08-14 07:09:07 -0400
commit0ea9d5e3e0e03a63b11392f5613378977dae7eca (patch)
treea363333080f9f8647f3f80dc7e736a308c36b7cb /net/ipv6/xfrm6_output.c
parent628e341f319f1a64a4639088faba952e4ec8f0a8 (diff)
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 <steffen.klassert@secunet.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6/xfrm6_output.c')
-rw-r--r--net/ipv6/xfrm6_output.c5
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)
138{ 138{
139 struct dst_entry *dst = skb_dst(skb); 139 struct dst_entry *dst = skb_dst(skb);
140 struct xfrm_state *x = dst->xfrm; 140 struct xfrm_state *x = dst->xfrm;
141 int mtu = ip6_skb_dst_mtu(skb); 141 int mtu = xfrm_skb_dst_mtu(skb);
142
143 if (mtu < IPV6_MIN_MTU)
144 mtu = IPV6_MIN_MTU;
142 145
143 if (skb->len > mtu && xfrm6_local_dontfrag(skb)) { 146 if (skb->len > mtu && xfrm6_local_dontfrag(skb)) {
144 xfrm6_local_rxpmtu(skb, mtu); 147 xfrm6_local_rxpmtu(skb, mtu);