On Wednesday 20 August 2014 17:04:57 Antonio Quartulli wrote:
@@ -494,14 +632,32 @@ static void dump_batman_iv_ogm(unsigned char *packet_buff, ssize_t buff_len, int printf("BAT %s: ", get_name_by_macaddr((struct ether_addr *)batman_ogm_packet->orig, read_opt));
printf("OGM IV via neigh %s, seq %u, tq %3d, ttl %2d, v %d, flags
[%c%c%c], length %zu\n", + tvlv_len = ntohs(batman_ogm_packet->tvlv_len);
printf("OGM IV via neigh %s, seq %u, tq %3d, ttl %2d, v %d, flags
[%c%c%c], length %zu, tvlv_len %zu\n", get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt), ntohl(batman_ogm_packet->seqno), batman_ogm_packet->tq, batman_ogm_packet->ttl, batman_ogm_packet->version, (batman_ogm_packet->flags & BATADV_NOT_BEST_NEXT_HOP ? 'N' : '.'), (batman_ogm_packet->flags & BATADV_DIRECTLINK ? 'D' : '.'), (batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP ? 'F' : '.'),
(size_t)buff_len - sizeof(struct ether_header));
check_len, tvlv_len);
check_len -= sizeof(struct batadv_ogm_packet);
LEN_CHECK(check_len, tvlv_len, "BAT OGM TVLV (containers)");
CC tcpdump.o tcpdump.c: In function ‘dump_batman_iv_ogm’: tcpdump.c:59:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if ((size_t)(buff_len) < (check_len)) { \ ^ tcpdump.c:646:2: note: in expansion of macro ‘LEN_CHECK’ LEN_CHECK(check_len, tvlv_len, "BAT OGM TVLV (containers)"); ^
Cheers, Marek