public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batctl: use ETH_P_BATMAN
@ 2012-11-26  9:50 Antonio Quartulli
  2012-11-30  9:42 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-11-26  9:50 UTC (permalink / raw)
  To: b.a.t.m.a.n

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) &&
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-30  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-26  9:50 [B.A.T.M.A.N.] [PATCH] batctl: use ETH_P_BATMAN Antonio Quartulli
2012-11-30  9:42 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox