diff options
Diffstat (limited to 'include/net/ip.h')
-rw-r--r-- | include/net/ip.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index 9b9ca2839399..91a6b2c88341 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -100,7 +100,7 @@ int igmp_mc_init(void); | |||
100 | * Functions provided by ip.c | 100 | * Functions provided by ip.c |
101 | */ | 101 | */ |
102 | 102 | ||
103 | int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, | 103 | int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk, |
104 | __be32 saddr, __be32 daddr, | 104 | __be32 saddr, __be32 daddr, |
105 | struct ip_options_rcu *opt); | 105 | struct ip_options_rcu *opt); |
106 | int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | 106 | int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, |
@@ -282,10 +282,12 @@ int ip_decrease_ttl(struct iphdr *iph) | |||
282 | } | 282 | } |
283 | 283 | ||
284 | static inline | 284 | static inline |
285 | int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) | 285 | int ip_dont_fragment(const struct sock *sk, const struct dst_entry *dst) |
286 | { | 286 | { |
287 | return inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO || | 287 | u8 pmtudisc = READ_ONCE(inet_sk(sk)->pmtudisc); |
288 | (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT && | 288 | |
289 | return pmtudisc == IP_PMTUDISC_DO || | ||
290 | (pmtudisc == IP_PMTUDISC_WANT && | ||
289 | !(dst_metric_locked(dst, RTAX_MTU))); | 291 | !(dst_metric_locked(dst, RTAX_MTU))); |
290 | } | 292 | } |
291 | 293 | ||