Author: marek Date: 2010-07-25 04:53:39 +0200 (Sun, 25 Jul 2010) New Revision: 1750
Modified: trunk/batctl/tcpdump.c Log: batctl: tcpdump - print encapsulated payload even if DUMP_TYPE_NONBAT is not set
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
Modified: trunk/batctl/tcpdump.c =================================================================== --- trunk/batctl/tcpdump.c 2010-07-25 02:34:38 UTC (rev 1749) +++ trunk/batctl/tcpdump.c 2010-07-25 02:53:39 UTC (rev 1750) @@ -376,7 +376,7 @@ struct unicast_frag_packet *unicast_frag_packet;
LEN_CHECK((size_t)buff_len - ETH_HLEN, sizeof(struct unicast_frag_packet), "BAT FRAG"); - LEN_CHECK((size_t)buff_len - ETH_HLEN - sizeof(struct unicast_frag_packet), ETH_HLEN, "BAT FRAG (unpacked)"); + LEN_CHECK((size_t)buff_len - ETH_HLEN - sizeof(struct unicast_frag_packet), (size_t)ETH_HLEN, "BAT FRAG (unpacked)");
ether_header = (struct ether_header *)packet_buff; unicast_frag_packet = (struct unicast_frag_packet *)(packet_buff + ETH_HLEN); @@ -385,7 +385,7 @@ time_printed = print_time();
printf("BAT %s > ", - get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt)); + get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->orig, read_opt));
printf("%s: FRAG, seq %hu, ttl %hu, flags [%c], ", get_name_by_macaddr((struct ether_addr *)unicast_frag_packet->dest, read_opt), @@ -409,15 +409,15 @@
switch (ntohs(eth_hdr->ether_type)) { case ETH_P_ARP: - if (dump_level & DUMP_TYPE_NONBAT) + if ((dump_level & DUMP_TYPE_NONBAT) || (time_printed)) dump_arp(packet_buff + ETH_HLEN, buff_len - ETH_HLEN, time_printed); break; case ETH_P_IP: - if (dump_level & DUMP_TYPE_NONBAT) + if ((dump_level & DUMP_TYPE_NONBAT) || (time_printed)) dump_ip(packet_buff + ETH_HLEN, buff_len - ETH_HLEN, time_printed); break; case ETH_P_8021Q: - if (dump_level & DUMP_TYPE_NONBAT) + if ((dump_level & DUMP_TYPE_NONBAT) || (time_printed)) dump_vlan(packet_buff, buff_len, read_opt, time_printed); break; case ETH_P_BATMAN: