Displaying 2 results from an estimated 2 matches for "vlan_ethhdr".
2007 Apr 18
4
[Bridge] [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged {I, AR}P packets
...n;
- struct sk_buff *skb;
+ struct sk_buff *skb = *pskb;
struct nf_bridge_info *nf_bridge;
- if ((*pskb)->protocol != __constant_htons(ETH_P_IP))
- return NF_ACCEPT;
-
- if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
+ if (skb->protocol != __constant_htons(ETH_P_IP)) {
+ struct vlan_ethhdr *hdr = (struct vlan_ethhdr *)
+ ((*pskb)->mac.ethernet);
+
+ if (!IS_VLAN_IP)
+ return NF_ACCEPT;
+ if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
+ goto out;
+ skb_pull(*pskb, VLAN_HLEN);
+ (*pskb)->nh.raw += VLAN_HLEN;
+ } else if ((skb = skb_share_check(*pskb, GFP_AT...
2007 Apr 18
5
[Bridge] RFC: [PATCH] bridge vlan integration
...include <linux/netfilter_bridge.h>
+#include <asm/uaccess.h>
+#include "br_private.h"
+
+int br_vlan_input_frame(struct sk_buff *skb, struct net_bridge_port_vlan *vlan)
+{
+ if (skb->protocol != htons(ETH_P_8021Q)) {
+ skb->vlan = vlan->untagged;
+ } else {
+ struct vlan_ethhdr *vhdr = (struct vlan_ethhdr *)(skb->mac.raw);
+ unsigned short vlan_TCI = ntohs(vhdr->h_vlan_TCI);
+ unsigned short vid = (vlan_TCI & VLAN_VID_MASK);
+
+ skb->vlan = vid ? vid : vlan->untagged;
+ }
+
+ if (skb->vlan == 0)
+ goto err;
+
+ if (br_vlan_filter(skb, vlan))
+ goto...