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] batman-adv: use ETH_ALEN instead of hardcoded numeric constants
@ 2012-01-30 19:59 Antonio Quartulli
  2012-02-04 15:33 ` Sven Eckelmann
  0 siblings, 1 reply; 4+ messages in thread
From: Antonio Quartulli @ 2012-01-30 19:59 UTC (permalink / raw)
  To: b.a.t.m.a.n

In packet.h the numeric constant 6 is used instead of the more portable ETH_ALEN
define. This patch substitute any hardcoded value with such define.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 packet.h |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/packet.h b/packet.h
index 441f3db..3496d38 100644
--- a/packet.h
+++ b/packet.h
@@ -100,8 +100,8 @@ struct batman_ogm_packet {
 	struct batman_header header;
 	uint8_t  flags;    /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
 	uint32_t seqno;
-	uint8_t  orig[6];
-	uint8_t  prev_sender[6];
+	uint8_t  orig[ETH_ALEN];
+	uint8_t  prev_sender[ETH_ALEN];
 	uint8_t  gw_flags;  /* flags related to gateway class */
 	uint8_t  tq;
 	uint8_t  tt_num_changes;
@@ -114,8 +114,8 @@ struct batman_ogm_packet {
 struct icmp_packet {
 	struct batman_header header;
 	uint8_t  msg_type; /* see ICMP message types above */
-	uint8_t  dst[6];
-	uint8_t  orig[6];
+	uint8_t  dst[ETH_ALEN];
+	uint8_t  orig[ETH_ALEN];
 	uint16_t seqno;
 	uint8_t  uid;
 	uint8_t  reserved;
@@ -128,8 +128,8 @@ struct icmp_packet {
 struct icmp_packet_rr {
 	struct batman_header header;
 	uint8_t  msg_type; /* see ICMP message types above */
-	uint8_t  dst[6];
-	uint8_t  orig[6];
+	uint8_t  dst[ETH_ALEN];
+	uint8_t  orig[ETH_ALEN];
 	uint16_t seqno;
 	uint8_t  uid;
 	uint8_t  rr_cur;
@@ -139,16 +139,16 @@ struct icmp_packet_rr {
 struct unicast_packet {
 	struct batman_header header;
 	uint8_t  ttvn; /* destination translation table version number */
-	uint8_t  dest[6];
+	uint8_t  dest[ETH_ALEN];
 } __packed;
 
 struct unicast_frag_packet {
 	struct batman_header header;
 	uint8_t  ttvn; /* destination translation table version number */
-	uint8_t  dest[6];
+	uint8_t  dest[ETH_ALEN];
 	uint8_t  flags;
 	uint8_t  align;
-	uint8_t  orig[6];
+	uint8_t  orig[ETH_ALEN];
 	uint16_t seqno;
 } __packed;
 
@@ -156,7 +156,7 @@ struct bcast_packet {
 	struct batman_header header;
 	uint8_t  reserved;
 	uint32_t seqno;
-	uint8_t  orig[6];
+	uint8_t  orig[ETH_ALEN];
 } __packed;
 
 struct vis_packet {
@@ -165,9 +165,9 @@ struct vis_packet {
 	uint32_t seqno;		 /* sequence number */
 	uint8_t  entries;	 /* number of entries behind this struct */
 	uint8_t  reserved;
-	uint8_t  vis_orig[6];	 /* originator that announces its neighbors */
-	uint8_t  target_orig[6]; /* who should receive this packet */
-	uint8_t  sender_orig[6]; /* who sent or rebroadcasted this packet */
+	uint8_t  vis_orig[ETH_ALEN];	 /* originator that announces its neighbors */
+	uint8_t  target_orig[ETH_ALEN]; /* who should receive this packet */
+	uint8_t  sender_orig[ETH_ALEN]; /* who sent or rebroadcasted this packet */
 } __packed;
 
 struct tt_query_packet {
-- 
1.7.3.4


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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use ETH_ALEN instead of hardcoded numeric constants
  2012-01-30 19:59 [B.A.T.M.A.N.] [PATCH] batman-adv: use ETH_ALEN instead of hardcoded numeric constants Antonio Quartulli
@ 2012-02-04 15:33 ` Sven Eckelmann
  2012-02-04 15:53   ` Antonio Quartulli
  2012-02-05 17:58   ` Marek Lindner
  0 siblings, 2 replies; 4+ messages in thread
From: Sven Eckelmann @ 2012-02-04 15:33 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 3081 bytes --]

On Monday 30 January 2012 20:59:17 Antonio Quartulli wrote:
> In packet.h the numeric constant 6 is used instead of the more portable
> ETH_ALEN define. This patch substitute any hardcoded value with such
> define.

Acked-by: Sven Eckelmann <sven@narfation.org>

Can you please also look through batctl tcpdump.h?

Thanks,
	Sven

> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---
>  packet.h |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/packet.h b/packet.h
> index 441f3db..3496d38 100644
> --- a/packet.h
> +++ b/packet.h
> @@ -100,8 +100,8 @@ struct batman_ogm_packet {
>  	struct batman_header header;
>  	uint8_t  flags;    /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
>  	uint32_t seqno;
> -	uint8_t  orig[6];
> -	uint8_t  prev_sender[6];
> +	uint8_t  orig[ETH_ALEN];
> +	uint8_t  prev_sender[ETH_ALEN];
>  	uint8_t  gw_flags;  /* flags related to gateway class */
>  	uint8_t  tq;
>  	uint8_t  tt_num_changes;
> @@ -114,8 +114,8 @@ struct batman_ogm_packet {
>  struct icmp_packet {
>  	struct batman_header header;
>  	uint8_t  msg_type; /* see ICMP message types above */
> -	uint8_t  dst[6];
> -	uint8_t  orig[6];
> +	uint8_t  dst[ETH_ALEN];
> +	uint8_t  orig[ETH_ALEN];
>  	uint16_t seqno;
>  	uint8_t  uid;
>  	uint8_t  reserved;
> @@ -128,8 +128,8 @@ struct icmp_packet {
>  struct icmp_packet_rr {
>  	struct batman_header header;
>  	uint8_t  msg_type; /* see ICMP message types above */
> -	uint8_t  dst[6];
> -	uint8_t  orig[6];
> +	uint8_t  dst[ETH_ALEN];
> +	uint8_t  orig[ETH_ALEN];
>  	uint16_t seqno;
>  	uint8_t  uid;
>  	uint8_t  rr_cur;
> @@ -139,16 +139,16 @@ struct icmp_packet_rr {
>  struct unicast_packet {
>  	struct batman_header header;
>  	uint8_t  ttvn; /* destination translation table version number */
> -	uint8_t  dest[6];
> +	uint8_t  dest[ETH_ALEN];
>  } __packed;
> 
>  struct unicast_frag_packet {
>  	struct batman_header header;
>  	uint8_t  ttvn; /* destination translation table version number */
> -	uint8_t  dest[6];
> +	uint8_t  dest[ETH_ALEN];
>  	uint8_t  flags;
>  	uint8_t  align;
> -	uint8_t  orig[6];
> +	uint8_t  orig[ETH_ALEN];
>  	uint16_t seqno;
>  } __packed;
> 
> @@ -156,7 +156,7 @@ struct bcast_packet {
>  	struct batman_header header;
>  	uint8_t  reserved;
>  	uint32_t seqno;
> -	uint8_t  orig[6];
> +	uint8_t  orig[ETH_ALEN];
>  } __packed;
> 
>  struct vis_packet {
> @@ -165,9 +165,9 @@ struct vis_packet {
>  	uint32_t seqno;		 /* sequence number */
>  	uint8_t  entries;	 /* number of entries behind this struct */
>  	uint8_t  reserved;
> -	uint8_t  vis_orig[6];	 /* originator that announces its neighbors */
> -	uint8_t  target_orig[6]; /* who should receive this packet */
> -	uint8_t  sender_orig[6]; /* who sent or rebroadcasted this packet */
> +	uint8_t  vis_orig[ETH_ALEN];	 /* originator that announces its neighbors
> */ +	uint8_t  target_orig[ETH_ALEN]; /* who should receive this packet */
> +	uint8_t  sender_orig[ETH_ALEN]; /* who sent or rebroadcasted this packet
> */ } __packed;
> 
>  struct tt_query_packet {

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use ETH_ALEN instead of hardcoded numeric constants
  2012-02-04 15:33 ` Sven Eckelmann
@ 2012-02-04 15:53   ` Antonio Quartulli
  2012-02-05 17:58   ` Marek Lindner
  1 sibling, 0 replies; 4+ messages in thread
From: Antonio Quartulli @ 2012-02-04 15:53 UTC (permalink / raw)
  To: Sven Eckelmann; +Cc: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

On Sat, Feb 04, 2012 at 04:33:30PM +0100, Sven Eckelmann wrote:
> Can you please also look through batctl tcpdump.h?

Done, thank you for reporting!

Cheers,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use ETH_ALEN instead of hardcoded numeric constants
  2012-02-04 15:33 ` Sven Eckelmann
  2012-02-04 15:53   ` Antonio Quartulli
@ 2012-02-05 17:58   ` Marek Lindner
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2012-02-05 17:58 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Saturday, February 04, 2012 23:33:30 Sven Eckelmann wrote:
> On Monday 30 January 2012 20:59:17 Antonio Quartulli wrote:
> > In packet.h the numeric constant 6 is used instead of the more portable
> > ETH_ALEN define. This patch substitute any hardcoded value with such
> > define.
> 
> Acked-by: Sven Eckelmann <sven@narfation.org>

Applied in revision 24a6289.

Thanks,
Marek

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

end of thread, other threads:[~2012-02-05 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-30 19:59 [B.A.T.M.A.N.] [PATCH] batman-adv: use ETH_ALEN instead of hardcoded numeric constants Antonio Quartulli
2012-02-04 15:33 ` Sven Eckelmann
2012-02-04 15:53   ` Antonio Quartulli
2012-02-05 17:58   ` Marek Lindner

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