mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 00:54:09 +08:00
inet: constify ip_dont_fragment() arguments
ip_dont_fragment() can accept const socket and dst Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
30d50c61df
commit
4e3f5d727d
@ -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)));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user