]> Pileus Git - ~andy/linux/commitdiff
xfrm: revert ipv4 mtu determination to dst_mtu
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Mon, 26 Aug 2013 10:31:19 +0000 (12:31 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 26 Aug 2013 10:40:53 +0000 (12:40 +0200)
In commit 0ea9d5e3e0e03a63b11392f5613378977dae7eca ("xfrm: introduce
helper for safe determination of mtu") I switched the determination of
ipv4 mtus from dst_mtu to ip_skb_dst_mtu. This was an error because in
case of IP_PMTUDISC_PROBE we fall back to the interface mtu, which is
never correct for ipv4 ipsec.

This patch partly reverts 0ea9d5e3e0e03a63b11392f5613378977dae7eca
("xfrm: introduce helper for safe determination of mtu").

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>
include/net/xfrm.h
net/ipv4/xfrm4_output.c
net/ipv6/xfrm6_output.c

index ac5b02515355eb172b01c378eece62012e008b93..e823786e7c66a6763e1cfa29bfcc76a3b4f7f6ba 100644 (file)
@@ -20,7 +20,6 @@
 #include <net/route.h>
 #include <net/ipv6.h>
 #include <net/ip6_fib.h>
-#include <net/ip6_route.h>
 #include <net/flow.h>
 
 #include <linux/interrupt.h>
@@ -1724,15 +1723,4 @@ static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m)
        return ret;
 }
 
-static inline int xfrm_skb_dst_mtu(struct sk_buff *skb)
-{
-       struct sock *sk = skb->sk;
-
-       if (sk && skb->protocol == htons(ETH_P_IPV6))
-               return ip6_skb_dst_mtu(skb);
-       else if (sk && skb->protocol == htons(ETH_P_IP))
-               return ip_skb_dst_mtu(skb);
-       return dst_mtu(skb_dst(skb));
-}
-
 #endif /* _NET_XFRM_H */
index 80baf4a3b1b5cae54aa4827fe33ab733c12ed171..baa0f63731fdff4edf1790884869023730c9c946 100644 (file)
@@ -28,7 +28,7 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
        if (!(ip_hdr(skb)->frag_off & htons(IP_DF)) || skb->local_df)
                goto out;
 
-       mtu = xfrm_skb_dst_mtu(skb);
+       mtu = dst_mtu(skb_dst(skb));
        if (skb->len > mtu) {
                if (skb->sk)
                        xfrm_local_error(skb, mtu);
index e092e306882dd88116a8734ab4e8d5236529aaa2..6cd625e3770611e546628d126602bcde9e0d2b4a 100644 (file)
@@ -140,10 +140,12 @@ static int __xfrm6_output(struct sk_buff *skb)
 {
        struct dst_entry *dst = skb_dst(skb);
        struct xfrm_state *x = dst->xfrm;
-       int mtu = xfrm_skb_dst_mtu(skb);
+       int mtu;
 
-       if (mtu < IPV6_MIN_MTU)
-               mtu = IPV6_MIN_MTU;
+       if (skb->protocol == htons(ETH_P_IPV6))
+               mtu = ip6_skb_dst_mtu(skb);
+       else
+               mtu = dst_mtu(skb_dst(skb));
 
        if (skb->len > mtu && xfrm6_local_dontfrag(skb)) {
                xfrm6_local_rxpmtu(skb, mtu);