The following commit has been merged in the next branch: commit da7a796e1fd46247fe3c8c657e94e59447c83c73 Author: Sven Eckelmann sven.eckelmann@gmx.de Date: Thu Nov 4 14:03:39 2010 +0100
batctl: Correct format strings for 8 bit ttl
Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de
diff --git a/tcpdump.c b/tcpdump.c index 92a5262..da7e368 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -334,7 +334,7 @@ static void dump_batman_ucast(unsigned char *packet_buff, ssize_t buff_len, int printf("BAT %s > ", get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt));
- printf("%s: UCAST, ttl %hu, ", + printf("%s: UCAST, ttl %hhu, ", get_name_by_macaddr((struct ether_addr *)unicast_packet->dest, read_opt), unicast_packet->ttl);
@@ -387,7 +387,7 @@ static void dump_batman_frag(unsigned char *packet_buff, ssize_t buff_len, int r printf("BAT %s > ", get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->orig, read_opt));
- printf("%s: FRAG, seq %hu, ttl %hu, flags [%c], ", + printf("%s: FRAG, seq %hu, ttl %hhu, flags [%c], ", get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->dest, read_opt), ntohs(unicast_frag_packet->seqno), unicast_frag_packet->ttl, (unicast_frag_packet->flags & UNI_FRAG_HEAD ? 'H' : '.')); diff --git a/traceroute.c b/traceroute.c index dc97a01..0dc796a 100644 --- a/traceroute.c +++ b/traceroute.c @@ -199,9 +199,9 @@ int traceroute(char *mesh_iface, int argc, char **argv) }
if (!bat_host) - printf("%2hu: %s", icmp_packet_out.ttl, (return_mac ? return_mac : "*")); + printf("%2hhu: %s", icmp_packet_out.ttl, (return_mac ? return_mac : "*")); else - printf("%2hu: %s (%s)", icmp_packet_out.ttl, bat_host->name, return_mac); + printf("%2hhu: %s (%s)", icmp_packet_out.ttl, bat_host->name, return_mac);
for (i = 0; i < NUM_PACKETS; i++) { if (time_delta[i])