aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2011-06-15 03:41:36 -0400
committerSven Eckelmann <sven@narfation.org>2011-06-20 05:23:36 -0400
commitb2c44a53836559b5e2823aa215c979c33bc9e2db (patch)
tree4373f6917c6c28b9caab3050e74571afc69bcbde /net/batman-adv
parentdb69ecfcb0d4df4d6449172186a8dd20836275ed (diff)
batman-adv: count_real_packets() in batman-adv assumes char is signed
count_real_packets() in batman-adv assumes char is signed, and returns -1 through it: net/batman-adv/routing.c: In function 'receive_bat_packet': net/batman-adv/routing.c:739: warning: comparison is always false due to limited range of data type Use int instead. Signed-off-by: David Howells <dhowells@redhat.com> [sven@narfation.org: Rebase on top of current version] Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bitarray.c4
-rw-r--r--net/batman-adv/bitarray.h4
-rw-r--r--net/batman-adv/routing.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c
index 700ee4f7a945..3659a258ef49 100644
--- a/net/batman-adv/bitarray.c
+++ b/net/batman-adv/bitarray.c
@@ -26,8 +26,8 @@
26 26
27/* returns true if the corresponding bit in the given seq_bits indicates true 27/* returns true if the corresponding bit in the given seq_bits indicates true
28 * and curr_seqno is within range of last_seqno */ 28 * and curr_seqno is within range of last_seqno */
29uint8_t get_bit_status(const unsigned long *seq_bits, uint32_t last_seqno, 29int get_bit_status(const unsigned long *seq_bits, uint32_t last_seqno,
30 uint32_t curr_seqno) 30 uint32_t curr_seqno)
31{ 31{
32 int32_t diff, word_offset, word_num; 32 int32_t diff, word_offset, word_num;
33 33
diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h
index e32eb2ddd2d2..277c037456e9 100644
--- a/net/batman-adv/bitarray.h
+++ b/net/batman-adv/bitarray.h
@@ -26,8 +26,8 @@
26 26
27/* returns true if the corresponding bit in the given seq_bits indicates true 27/* returns true if the corresponding bit in the given seq_bits indicates true
28 * and curr_seqno is within range of last_seqno */ 28 * and curr_seqno is within range of last_seqno */
29uint8_t get_bit_status(const unsigned long *seq_bits, uint32_t last_seqno, 29int get_bit_status(const unsigned long *seq_bits, uint32_t last_seqno,
30 uint32_t curr_seqno); 30 uint32_t curr_seqno);
31 31
32/* turn corresponding bit on, so we can remember that we got the packet */ 32/* turn corresponding bit on, so we can remember that we got the packet */
33void bit_mark(unsigned long *seq_bits, int32_t n); 33void bit_mark(unsigned long *seq_bits, int32_t n);
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 934f1f2f86c6..d5ce644f8720 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -361,7 +361,7 @@ static void update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
361 const struct batman_packet *batman_packet, 361 const struct batman_packet *batman_packet,
362 struct hard_iface *if_incoming, 362 struct hard_iface *if_incoming,
363 const unsigned char *tt_buff, int tt_buff_len, 363 const unsigned char *tt_buff, int tt_buff_len,
364 char is_duplicate) 364 int is_duplicate)
365{ 365{
366 struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL; 366 struct neigh_node *neigh_node = NULL, *tmp_neigh_node = NULL;
367 struct neigh_node *router = NULL; 367 struct neigh_node *router = NULL;
@@ -528,7 +528,7 @@ static int window_protected(struct bat_priv *bat_priv,
528 * -1 the packet is old and has been received while the seqno window 528 * -1 the packet is old and has been received while the seqno window
529 * was protected. Caller should drop it. 529 * was protected. Caller should drop it.
530 */ 530 */
531static char count_real_packets(const struct ethhdr *ethhdr, 531static int count_real_packets(const struct ethhdr *ethhdr,
532 const struct batman_packet *batman_packet, 532 const struct batman_packet *batman_packet,
533 const struct hard_iface *if_incoming) 533 const struct hard_iface *if_incoming)
534{ 534{
@@ -536,7 +536,7 @@ static char count_real_packets(const struct ethhdr *ethhdr,
536 struct orig_node *orig_node; 536 struct orig_node *orig_node;
537 struct neigh_node *tmp_neigh_node; 537 struct neigh_node *tmp_neigh_node;
538 struct hlist_node *node; 538 struct hlist_node *node;
539 char is_duplicate = 0; 539 int is_duplicate = 0;
540 int32_t seq_diff; 540 int32_t seq_diff;
541 int need_update = 0; 541 int need_update = 0;
542 int set_mark, ret = -1; 542 int set_mark, ret = -1;
@@ -605,7 +605,7 @@ void receive_bat_packet(const struct ethhdr *ethhdr,
605 char has_directlink_flag; 605 char has_directlink_flag;
606 char is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0; 606 char is_my_addr = 0, is_my_orig = 0, is_my_oldorig = 0;
607 char is_broadcast = 0, is_bidirectional, is_single_hop_neigh; 607 char is_broadcast = 0, is_bidirectional, is_single_hop_neigh;
608 char is_duplicate; 608 int is_duplicate;
609 uint32_t if_incoming_seqno; 609 uint32_t if_incoming_seqno;
610 610
611 /* Silently drop when the batman packet is actually not a 611 /* Silently drop when the batman packet is actually not a