* [PATCH 2.4.23-pre3] signed/unsigned mismatches in include/net/tcp.h
@ 2003-09-08 15:26 Rolf Eike Beer
0 siblings, 0 replies; only message in thread
From: Rolf Eike Beer @ 2003-09-08 15:26 UTC (permalink / raw)
To: linux-kernel
Hi,
the first one in tcp.h fixes a warning with gcc 3.3: we compare signed with
unsigned. rto is unsigned, so maybe we should cast the left side to u32.
Number 2 changes the type of mss from int to unsigned int. mss is only used to
compare with sbk->len, which is an unsigned. Both callers of this function
use unsigned variables at this point anyway (one is tcp_send_skb from #3).
Please review.
Eike
diff -Naur linux-2.4.23-pre3/include/net/tcp.h linux-2.4.23-pre3-caliban/include/net/tcp.h
--- linux-2.4.23-pre3/include/net/tcp.h 2003-09-05 15:04:50.000000000 +0200
+++ linux-2.4.23-pre3-caliban/include/net/tcp.h 2003-09-07 18:26:50.000000000 +0200
@@ -1123,7 +1123,7 @@
if (tp->packets_out > tp->snd_cwnd_used)
tp->snd_cwnd_used = tp->packets_out;
- if ((s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= tp->rto)
+ if ((u32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= tp->rto)
tcp_cwnd_application_limited(sk);
}
}
@@ -1166,7 +1166,7 @@
!after(tp->snd_sml, tp->snd_nxt);
}
-static __inline__ void tcp_minshall_update(struct tcp_opt *tp, int mss, struct sk_buff *skb)
+static __inline__ void tcp_minshall_update(struct tcp_opt *tp, unsigned int mss, struct sk_buff *skb)
{
if (skb->len < mss)
tp->snd_sml = TCP_SKB_CB(skb)->end_seq;
diff -Naur linux-2.4.23-pre3/net/ipv4/tcp_output.c linux-2.4.23-pre3-caliban/net/ipv4/tcp_output.c
--- linux-2.4.23-pre3/net/ipv4/tcp_output.c 2003-09-05 15:04:52.000000000 +0200
+++ linux-2.4.23-pre3-caliban/net/ipv4/tcp_output.c 2003-09-07 18:17:04.000000000 +0200
@@ -302,7 +302,7 @@
* NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames,
* otherwise socket can stall.
*/
-void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue, unsigned cur_mss)
+void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue, unsigned int cur_mss)
{
struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-09-08 15:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08 15:26 [PATCH 2.4.23-pre3] signed/unsigned mismatches in include/net/tcp.h Rolf Eike Beer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome