/* externally defined structs */
struct vlan_group;
struct net_device;
-struct sk_buff;
struct packet_type;
struct vlan_collection;
struct vlan_dev_info;
unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */
};
+#include <linux/skbuff.h>
+
+static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
+{
+ return (struct vlan_ethhdr *)skb->mac.raw;
+}
+
struct vlan_hdr {
unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */
unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */
skb->real_dev = skb->dev;
skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
if (skb->dev == NULL) {
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
/* Not NET_RX_DROP, this is not being dropped
* due to congestion.
* This allows the VLAN to have a different MAC than the underlying
* device, and still route correctly.
*/
- if (!memcmp(skb->mac.ethernet->h_dest, skb->dev->dev_addr, ETH_ALEN))
+ if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN))
skb->pkt_type = PACKET_HOST;
break;
};