diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip.h | 4 | ||||
-rw-r--r-- | include/net/sch_generic.h | 5 | ||||
-rw-r--r-- | include/net/sock.h | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index 39db596eb89f..9896f46cbbf1 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -362,7 +362,7 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst, !forwarding) return dst_mtu(dst); - return min(dst->dev->mtu, IP_MAX_MTU); + return min(READ_ONCE(dst->dev->mtu), IP_MAX_MTU); } static inline unsigned int ip_skb_dst_mtu(struct sock *sk, @@ -374,7 +374,7 @@ static inline unsigned int ip_skb_dst_mtu(struct sock *sk, return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding); } - return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU); + return min(READ_ONCE(skb_dst(skb)->dev->mtu), IP_MAX_MTU); } u32 ip_idents_reserve(u32 hash, int segs); diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 107c52432245..1688f0f6c7ba 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -808,8 +808,11 @@ static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new, old = *pold; *pold = new; if (old != NULL) { - qdisc_tree_reduce_backlog(old, old->q.qlen, old->qstats.backlog); + unsigned int qlen = old->q.qlen; + unsigned int backlog = old->qstats.backlog; + qdisc_reset(old); + qdisc_tree_reduce_backlog(old, qlen, backlog); } sch_tree_unlock(sch); diff --git a/include/net/sock.h b/include/net/sock.h index fe1a0bc25cd3..1c2912d433e8 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -509,9 +509,7 @@ int sk_set_peek_off(struct sock *sk, int val); static inline int sk_peek_offset(struct sock *sk, int flags) { if (unlikely(flags & MSG_PEEK)) { - s32 off = READ_ONCE(sk->sk_peek_off); - if (off >= 0) - return off; + return READ_ONCE(sk->sk_peek_off); } return 0; |