aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/route.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index ff622069fcef..90ba8358a892 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -904,22 +904,29 @@ out: kfree_skb(skb);
904 return 0; 904 return 0;
905} 905}
906 906
907static u32 __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu) 907static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
908{ 908{
909 struct dst_entry *dst = &rt->dst;
909 struct fib_result res; 910 struct fib_result res;
910 911
911 if (mtu < ip_rt_min_pmtu) 912 if (mtu < ip_rt_min_pmtu)
912 mtu = ip_rt_min_pmtu; 913 mtu = ip_rt_min_pmtu;
913 914
915 if (!rt->rt_pmtu) {
916 dst->obsolete = DST_OBSOLETE_KILL;
917 } else {
918 rt->rt_pmtu = mtu;
919 dst->expires = max(1UL, jiffies + ip_rt_mtu_expires);
920 }
921
914 rcu_read_lock(); 922 rcu_read_lock();
915 if (fib_lookup(dev_net(rt->dst.dev), fl4, &res) == 0) { 923 if (fib_lookup(dev_net(dst->dev), fl4, &res) == 0) {
916 struct fib_nh *nh = &FIB_RES_NH(res); 924 struct fib_nh *nh = &FIB_RES_NH(res);
917 925
918 update_or_create_fnhe(nh, fl4->daddr, 0, mtu, 926 update_or_create_fnhe(nh, fl4->daddr, 0, mtu,
919 jiffies + ip_rt_mtu_expires); 927 jiffies + ip_rt_mtu_expires);
920 } 928 }
921 rcu_read_unlock(); 929 rcu_read_unlock();
922 return mtu;
923} 930}
924 931
925static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, 932static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
@@ -929,14 +936,7 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
929 struct flowi4 fl4; 936 struct flowi4 fl4;
930 937
931 ip_rt_build_flow_key(&fl4, sk, skb); 938 ip_rt_build_flow_key(&fl4, sk, skb);
932 mtu = __ip_rt_update_pmtu(rt, &fl4, mtu); 939 __ip_rt_update_pmtu(rt, &fl4, mtu);
933
934 if (!rt->rt_pmtu) {
935 dst->obsolete = DST_OBSOLETE_KILL;
936 } else {
937 rt->rt_pmtu = mtu;
938 rt->dst.expires = max(1UL, jiffies + ip_rt_mtu_expires);
939 }
940} 940}
941 941
942void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, 942void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu,