Skip to content

Commit 5c26159

Browse files
zx2c4ummakynes
authored andcommitted
ipvs: use explicitly signed chars
The `char` type with no explicit sign is sometimes signed and sometimes unsigned. This code will break on platforms such as arm, where char is unsigned. So mark it here as explicitly signed, so that the todrop_counter decrement and subsequent comparison is correct. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 26b5934 commit 5c26159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/netfilter/ipvs/ip_vs_conn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,8 +1265,8 @@ static inline int todrop_entry(struct ip_vs_conn *cp)
12651265
* The drop rate array needs tuning for real environments.
12661266
* Called from timer bh only => no locking
12671267
*/
1268-
static const char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
1269-
static char todrop_counter[9] = {0};
1268+
static const signed char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
1269+
static signed char todrop_counter[9] = {0};
12701270
int i;
12711271

12721272
/* if the conn entry hasn't lasted for 60 seconds, don't drop it.

0 commit comments

Comments
 (0)