aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan_dev.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-06-13 15:07:37 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-11 01:15:02 -0400
commita4bf3af4ac46802436d352ef409cee4fe80445b3 (patch)
treee03e7ceb21ff17d886485c9b137f8a47c1b58c56 /net/8021q/vlan_dev.c
parentb020cb488586f982f40eb257a32e92a4de710d65 (diff)
[VLAN]: Introduce symbolic constants for flag values
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r--net/8021q/vlan_dev.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 4f6ede752a37..95afe387b952 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -73,7 +73,7 @@ int vlan_dev_rebuild_header(struct sk_buff *skb)
73 73
74static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb) 74static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
75{ 75{
76 if (VLAN_DEV_INFO(skb->dev)->flags & 1) { 76 if (VLAN_DEV_INFO(skb->dev)->flags & VLAN_FLAG_REORDER_HDR) {
77 if (skb_shared(skb) || skb_cloned(skb)) { 77 if (skb_shared(skb) || skb_cloned(skb)) {
78 struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); 78 struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
79 kfree_skb(skb); 79 kfree_skb(skb);
@@ -350,7 +350,8 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
350 * header shuffling in the hard_start_xmit. Users can turn off this 350 * header shuffling in the hard_start_xmit. Users can turn off this
351 * REORDER behaviour with the vconfig tool. 351 * REORDER behaviour with the vconfig tool.
352 */ 352 */
353 build_vlan_header = ((VLAN_DEV_INFO(dev)->flags & 1) == 0); 353 if (!(VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR))
354 build_vlan_header = 1;
354 355
355 if (build_vlan_header) { 356 if (build_vlan_header) {
356 vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN); 357 vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN);
@@ -584,16 +585,16 @@ int vlan_dev_set_egress_priority(const struct net_device *dev,
584 return 0; 585 return 0;
585} 586}
586 587
587/* Flags are defined in the vlan_dev_info class in include/linux/if_vlan.h file. */ 588/* Flags are defined in the vlan_flags enum in include/linux/if_vlan.h file. */
588int vlan_dev_set_vlan_flag(const struct net_device *dev, 589int vlan_dev_set_vlan_flag(const struct net_device *dev,
589 u32 flag, short flag_val) 590 u32 flag, short flag_val)
590{ 591{
591 /* verify flag is supported */ 592 /* verify flag is supported */
592 if (flag == 1) { 593 if (flag == VLAN_FLAG_REORDER_HDR) {
593 if (flag_val) { 594 if (flag_val) {
594 VLAN_DEV_INFO(dev)->flags |= 1; 595 VLAN_DEV_INFO(dev)->flags |= VLAN_FLAG_REORDER_HDR;
595 } else { 596 } else {
596 VLAN_DEV_INFO(dev)->flags &= ~1; 597 VLAN_DEV_INFO(dev)->flags &= ~VLAN_FLAG_REORDER_HDR;
597 } 598 }
598 return 0; 599 return 0;
599 } 600 }