ETH_P_BATMAN is now defined in linux/if_ether.h. batctl does not need to use the private BATADV_ETH_P_BATMAN define. However, depending on the kernel-headers version installed on the system, this new constant may not be available, therefore a redefinition inside an ifndef check is needed.
Signed-off-by: Antonio Quartulli ordex@autistici.org --- packet.h | 2 -- tcpdump.c | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/packet.h b/packet.h index 1c5454d..cb6405b 100644 --- a/packet.h +++ b/packet.h @@ -20,8 +20,6 @@ #ifndef _NET_BATMAN_ADV_PACKET_H_ #define _NET_BATMAN_ADV_PACKET_H_
-#define BATADV_ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */ - enum batadv_packettype { BATADV_IV_OGM = 0x01, BATADV_ICMP = 0x02, diff --git a/tcpdump.c b/tcpdump.c index 84abd74..4424dfd 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -43,6 +43,9 @@ #include "bat-hosts.h" #include "functions.h"
+#ifndef ETH_P_BATMAN +#define ETH_P_BATMAN 0x4305 +#endif /* ETH_P_BATMAN */
#define LEN_CHECK(buff_len, check_len, desc) \ if ((size_t)(buff_len) < (check_len)) { \ @@ -587,7 +590,7 @@ static void parse_eth_hdr(unsigned char *packet_buff, ssize_t buff_len, int read if ((dump_level & DUMP_TYPE_NONBAT) || (time_printed)) dump_vlan(packet_buff, buff_len, read_opt, time_printed); break; - case BATADV_ETH_P_BATMAN: + case ETH_P_BATMAN: batman_ogm_packet = (struct batadv_ogm_packet *)(packet_buff + ETH_HLEN);
if ((read_opt & COMPAT_FILTER) &&