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 next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK
@ 2013-05-09 14:28 Antonio Quartulli
  2013-05-09 14:28 ` [B.A.T.M.A.N.] [PATCH next 2/2] batman-adv: use VLAN_VID_MASK when printing the vid Antonio Quartulli
  2013-05-09 16:09 ` [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK Marek Lindner
  0 siblings, 2 replies; 4+ messages in thread
From: Antonio Quartulli @ 2013-05-09 14:28 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

VLAN_VID_MASK is already diefined in linux/if_vlan.h and
therefore does not need to be privately re-defined

Introduced in 0b1da1765fdb00ca5d53bc95c9abc70dfc9aae5b
("batman-adv: change VID semantic in the BLA code")

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 bridge_loop_avoidance.c | 2 +-
 main.h                  | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index e95cf4b..e9d8e0b 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -344,7 +344,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
 
 	if (vid & BATADV_VLAN_HAS_TAG)
 		skb = vlan_insert_tag(skb, htons(ETH_P_8021Q),
-				      vid & BATADV_VID_MASK);
+				      vid & VLAN_VID_MASK);
 
 	skb_reset_mac_header(skb);
 	skb->protocol = eth_type_trans(skb, soft_iface);
diff --git a/main.h b/main.h
index d575436..68c7ee0 100644
--- a/main.h
+++ b/main.h
@@ -172,8 +172,6 @@ enum batadv_vlan_flags {
 	BATADV_VLAN_HAS_TAG	= BIT(15),
 };
 
-/* mask needed to extract the vlan ID (12bits) from a 16bits variable */
-#define BATADV_VID_MASK	0x0FFF
 #define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \
 			       (int)(vid & BATADV_VID_MASK) : -1)
 
-- 
1.8.1.5


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

* [B.A.T.M.A.N.] [PATCH next 2/2] batman-adv: use VLAN_VID_MASK when printing the vid
  2013-05-09 14:28 [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK Antonio Quartulli
@ 2013-05-09 14:28 ` Antonio Quartulli
  2013-05-09 16:09 ` [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK Marek Lindner
  1 sibling, 0 replies; 4+ messages in thread
From: Antonio Quartulli @ 2013-05-09 14:28 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

Introduced in 454b849c7de18a7b44eecebe889f5f3149d24780
("batman-adv: print the VID properly")

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main.h b/main.h
index 68c7ee0..834b1a0 100644
--- a/main.h
+++ b/main.h
@@ -173,7 +173,7 @@ enum batadv_vlan_flags {
 };
 
 #define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \
-			       (int)(vid & BATADV_VID_MASK) : -1)
+			       (int)(vid & VLAN_VID_MASK) : -1)
 
 extern char batadv_routing_algo[];
 extern struct list_head batadv_hardif_list;
-- 
1.8.1.5


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

* Re: [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK
  2013-05-09 14:28 [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK Antonio Quartulli
  2013-05-09 14:28 ` [B.A.T.M.A.N.] [PATCH next 2/2] batman-adv: use VLAN_VID_MASK when printing the vid Antonio Quartulli
@ 2013-05-09 16:09 ` Marek Lindner
  2013-05-09 16:45   ` Antonio Quartulli
  1 sibling, 1 reply; 4+ messages in thread
From: Marek Lindner @ 2013-05-09 16:09 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Thursday, May 09, 2013 22:28:06 Antonio Quartulli wrote:
> --- a/main.h
> +++ b/main.h
> @@ -172,8 +172,6 @@ enum batadv_vlan_flags {
>         BATADV_VLAN_HAS_TAG     = BIT(15),
>  };
>  
> -/* mask needed to extract the vlan ID (12bits) from a 16bits variable */
> -#define BATADV_VID_MASK        0x0FFF
>  #define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \
>                                (int)(vid & BATADV_VID_MASK) : -1)

The last user should remove the define otherwise the code won't compile.

Cheers,
Marek

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

* Re: [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK
  2013-05-09 16:09 ` [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK Marek Lindner
@ 2013-05-09 16:45   ` Antonio Quartulli
  0 siblings, 0 replies; 4+ messages in thread
From: Antonio Quartulli @ 2013-05-09 16:45 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

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

On Fri, May 10, 2013 at 12:09:11AM +0800, Marek Lindner wrote:
> On Thursday, May 09, 2013 22:28:06 Antonio Quartulli wrote:
> > --- a/main.h
> > +++ b/main.h
> > @@ -172,8 +172,6 @@ enum batadv_vlan_flags {
> >         BATADV_VLAN_HAS_TAG     = BIT(15),
> >  };
> >  
> > -/* mask needed to extract the vlan ID (12bits) from a 16bits variable */
> > -#define BATADV_VID_MASK        0x0FFF
> >  #define BATADV_PRINT_VID(vid) (vid & BATADV_VLAN_HAS_TAG ? \
> >                                (int)(vid & BATADV_VID_MASK) : -1)
> 
> The last user should remove the define otherwise the code won't compile.

oh, ok, will send v2 with the patches in the other order.

Cheers,

-- 
Antonio Quartulli

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

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

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

end of thread, other threads:[~2013-05-09 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 14:28 [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK Antonio Quartulli
2013-05-09 14:28 ` [B.A.T.M.A.N.] [PATCH next 2/2] batman-adv: use VLAN_VID_MASK when printing the vid Antonio Quartulli
2013-05-09 16:09 ` [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK Marek Lindner
2013-05-09 16:45   ` Antonio Quartulli

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