inet: constify ip_dont_fragment() arguments
[firefly-linux-kernel-4.4.55.git] / include / net / ip.h
index 9b9ca283939964ca12adc2f8b9e1e50b6af71e36..525dc07789269d0683650476363821f676785f8c 100644 (file)
@@ -282,10 +282,12 @@ int ip_decrease_ttl(struct iphdr *iph)
 }
 
 static inline
-int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
+int ip_dont_fragment(const struct sock *sk, const struct dst_entry *dst)
 {
-       return  inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
-               (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
+       u8 pmtudisc = READ_ONCE(inet_sk(sk)->pmtudisc);
+
+       return  pmtudisc == IP_PMTUDISC_DO ||
+               (pmtudisc == IP_PMTUDISC_WANT &&
                 !(dst_metric_locked(dst, RTAX_MTU)));
 }