Skip to content

Commit

Permalink
[VLAN]: Allow VLAN interface on top of bridge interface
Browse files Browse the repository at this point in the history
When a VLAN interface is created on top of a bridge interface and 
netfilter is enabled to see the bridged packets, the packets can be 
corrupted when passing through the netfilter code. This is caused by the 
VLAN driver not setting the 'protocol' and 'nh' members of the sk_buff 
structure. In general, this is no problem as the VLAN interface is mostly 
connected to a physical ethernet interface which does not use the 
'protocol' and 'nh' members. For a bridge interface, however, these 
members do matter.

Signed-off-by: Jerome Borsboom <j.borsboom@erasmusmc.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jerome Borsboom authored and David S. Miller committed Apr 13, 2007
1 parent 09fe3ef commit 279e172
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
} else {
vhdr->h_vlan_encapsulated_proto = htons(len);
}

skb->protocol = htons(ETH_P_8021Q);
skb->nh.raw = skb->data;
}

/* Before delegating work to the lower layer, enter our MAC-address */
Expand Down

0 comments on commit 279e172

Please sign in to comment.