Skip to contentSkip to conversation

batman-adv: use VLAN_VID_MASK when printing the vid

PATCH Applied Antonio Quartulli 2 participants 4 messages May 9, 2013 – May 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 batman-adv: use VLAN_VID_MASK when printing the vid

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

---
 main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
main.h +1 -1
index d575436..8bcffa5 100644
@@ -175,7 +175,7 @@ enum batadv_vlan_flags {
 /* 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)
+			       (int)(vid & VLAN_VID_MASK) : -1)
 
 extern char batadv_routing_algo[];
 extern struct list_head batadv_hardif_list;
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH v2 2/2 batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK

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")

---
 bridge_loop_avoidance.c | 2 +-
 main.h                  | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
bridge_loop_avoidance.c +1 -1
index e95cf4b..e9d8e0b 100644
@@ -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);
main.h +0 -2
index 8bcffa5..834b1a0 100644
@@ -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 & VLAN_VID_MASK) : -1)
 
Signature · 1 line
1.8.1.5
#2 lore raw

Re: [B.A.T.M.A.N.] [PATCHv2 next 2/2] batman-adv: use VLAN_VID_MASK instead of BATADV_VID_MASK

Quoted 11 lines · On Friday, May 10, 2013 00:48:17 Antonio Quartulli wrote:

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")

---
 bridge_loop_avoidance.c | 2 +-
 main.h                  | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Applied in revision 64fc7ed.

Thanks,
Marek