Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58907
b: refs/heads/master
c: a4bf3af
h: refs/heads/master
i:
  58905: 8867f2b
  58903: f15ed61
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jul 11, 2007
1 parent 3cecfaf commit 2774b45
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b020cb488586f982f40eb257a32e92a4de710d65
refs/heads/master: a4bf3af4ac46802436d352ef409cee4fe80445b3
4 changes: 4 additions & 0 deletions trunk/include/linux/if_vlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ enum vlan_ioctl_cmds {
GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
};

enum vlan_flags {
VLAN_FLAG_REORDER_HDR = 0x1,
};

enum vlan_name_types {
VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ static int register_vlan_device(struct net_device *real_dev,
VLAN_DEV_INFO(new_dev)->vlan_id = VLAN_ID; /* 1 through VLAN_VID_MASK */
VLAN_DEV_INFO(new_dev)->real_dev = real_dev;
VLAN_DEV_INFO(new_dev)->dent = NULL;
VLAN_DEV_INFO(new_dev)->flags = 1;
VLAN_DEV_INFO(new_dev)->flags = VLAN_FLAG_REORDER_HDR;

err = register_vlan_dev(new_dev);
if (err < 0)
Expand Down
13 changes: 7 additions & 6 deletions trunk/net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int vlan_dev_rebuild_header(struct sk_buff *skb)

static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
{
if (VLAN_DEV_INFO(skb->dev)->flags & 1) {
if (VLAN_DEV_INFO(skb->dev)->flags & VLAN_FLAG_REORDER_HDR) {
if (skb_shared(skb) || skb_cloned(skb)) {
struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
kfree_skb(skb);
Expand Down Expand Up @@ -350,7 +350,8 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
* header shuffling in the hard_start_xmit. Users can turn off this
* REORDER behaviour with the vconfig tool.
*/
build_vlan_header = ((VLAN_DEV_INFO(dev)->flags & 1) == 0);
if (!(VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR))
build_vlan_header = 1;

if (build_vlan_header) {
vhdr = (struct vlan_hdr *) skb_push(skb, VLAN_HLEN);
Expand Down Expand Up @@ -584,16 +585,16 @@ int vlan_dev_set_egress_priority(const struct net_device *dev,
return 0;
}

/* Flags are defined in the vlan_dev_info class in include/linux/if_vlan.h file. */
/* Flags are defined in the vlan_flags enum in include/linux/if_vlan.h file. */
int vlan_dev_set_vlan_flag(const struct net_device *dev,
u32 flag, short flag_val)
{
/* verify flag is supported */
if (flag == 1) {
if (flag == VLAN_FLAG_REORDER_HDR) {
if (flag_val) {
VLAN_DEV_INFO(dev)->flags |= 1;
VLAN_DEV_INFO(dev)->flags |= VLAN_FLAG_REORDER_HDR;
} else {
VLAN_DEV_INFO(dev)->flags &= ~1;
VLAN_DEV_INFO(dev)->flags &= ~VLAN_FLAG_REORDER_HDR;
}
return 0;
}
Expand Down

0 comments on commit 2774b45

Please sign in to comment.