batctl: use ETH_ALEN instead of hardcoded numeric constants

Message ID 1328370732-25571-1-git-send-email-ordex@autistici.org (mailing list archive)
State Accepted, archived
Commit 64ab6b50819d247c46876596e412d1bc83a9543e
Headers

Commit Message

Antonio Quartulli Feb. 4, 2012, 3:52 p.m. UTC
  In tcpdump.h the numeric constants 6 is usedinstead of the more portable (and
readable) define ETH_ALEN. This patch substitute any hardcoded value with such
define.

Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 tcpdump.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
  

Comments

Marek Lindner Feb. 5, 2012, 4:58 p.m. UTC | #1
On Saturday, February 04, 2012 23:52:12 Antonio Quartulli wrote:
> In tcpdump.h the numeric constants 6 is usedinstead of the more portable
> (and readable) define ETH_ALEN. This patch substitute any hardcoded value
> with such define.

Applied in revision 64ab6b5.

Thanks,
Marek
  

Patch

diff --git a/tcpdump.h b/tcpdump.h
index 2a2cc0a..96989b4 100644
--- a/tcpdump.h
+++ b/tcpdump.h
@@ -21,6 +21,7 @@ 
 
 
 #include <netpacket/packet.h>
+#include <net/ethernet.h>
 #include "list-batman.h"
 
 #ifndef ARPHRD_IEEE80211_PRISM
@@ -65,11 +66,11 @@  struct vlanhdr {
 struct ieee80211_hdr {
 	u_int16_t frame_control;
 	u_int16_t duration_id;
-	u_int8_t addr1[6];
-	u_int8_t addr2[6];
-	u_int8_t addr3[6];
+	u_int8_t addr1[ETH_ALEN];
+	u_int8_t addr2[ETH_ALEN];
+	u_int8_t addr3[ETH_ALEN];
 	u_int16_t seq_ctrl;
-	u_int8_t addr4[6];
+	u_int8_t addr4[ETH_ALEN];
 } __attribute__ ((packed));
 
 struct radiotap_header {