Message ID | 20220417171027.3888810-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] tcp: fix signed/unsigned comparison | expand |
On Apr 17 2022, Eric Dumazet wrote: > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > index cf2dc19bb8c766c1d33406053fd61c0873f15489..0d88984e071531fb727bdee178b0c01fd087fe5f 100644 > --- a/net/ipv4/tcp_input.c > +++ b/net/ipv4/tcp_input.c > @@ -5959,7 +5959,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) > > step5: > reason = tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT); > - if (reason < 0) > + if ((int)reason < 0) > goto discard; > > tcp_rcv_rtt_measure_ts(sk, skb); Shouldn't reason be negated before passing it to tcp_drop_reason?
On Sun, Apr 17, 2022 at 11:24 AM Andreas Schwab <schwab@linux-m68k.org> wrote: > > On Apr 17 2022, Eric Dumazet wrote: > > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > > index cf2dc19bb8c766c1d33406053fd61c0873f15489..0d88984e071531fb727bdee178b0c01fd087fe5f 100644 > > --- a/net/ipv4/tcp_input.c > > +++ b/net/ipv4/tcp_input.c > > @@ -5959,7 +5959,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) > > > > step5: > > reason = tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT); > > - if (reason < 0) > > + if ((int)reason < 0) > > goto discard; > > > > tcp_rcv_rtt_measure_ts(sk, skb); > > Shouldn't reason be negated before passing it to tcp_drop_reason? Good catch, thanks !
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index cf2dc19bb8c766c1d33406053fd61c0873f15489..0d88984e071531fb727bdee178b0c01fd087fe5f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5959,7 +5959,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) step5: reason = tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT); - if (reason < 0) + if ((int)reason < 0) goto discard; tcp_rcv_rtt_measure_ts(sk, skb);