fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / 8021q / vlan_dev.c
index 49c4874..425912a 100644 (file)
@@ -62,7 +62,7 @@ int vlan_dev_rebuild_header(struct sk_buff *skb)
        default:
                printk(VLAN_DBG
                       "%s: unable to resolve type %X addresses.\n", 
-                      dev->name, (int)veth->h_vlan_encapsulated_proto);
+                      dev->name, ntohs(veth->h_vlan_encapsulated_proto));
         
                memcpy(veth->h_source, dev->dev_addr, ETH_ALEN);
                break;
@@ -113,14 +113,14 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
  *
  */
 int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
-                  struct packet_type* ptype)
+                  struct packet_type* ptype, struct net_device *orig_dev)
 {
        unsigned char *rawp = NULL;
        struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
        unsigned short vid;
        struct net_device_stats *stats;
        unsigned short vlan_TCI;
-       unsigned short proto;
+       __be16 proto;
 
        /* vlan_TCI = ntohs(get_unaligned(&vhdr->h_vlan_TCI)); */
        vlan_TCI = ntohs(vhdr->h_vlan_TCI);
@@ -163,7 +163,8 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
        stats->rx_packets++;
        stats->rx_bytes += skb->len;
 
-       skb_pull(skb, VLAN_HLEN); /* take off the VLAN header (4 bytes currently) */
+       /* Take off the VLAN header (4 bytes currently) */
+       skb_pull_rcsum(skb, VLAN_HLEN);
 
        /* Ok, lets check to make sure the device (dev) we
         * came in on is what this VLAN is attached to.
@@ -211,7 +212,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
                 * This allows the VLAN to have a different MAC than the underlying
                 * device, and still route correctly.
                 */
-               if (memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN) == 0) {
+               if (!compare_ether_addr(eth_hdr(skb)->h_dest, skb->dev->dev_addr)) {
                        /* It is for our (changed) MAC-address! */
                        skb->pkt_type = PACKET_HOST;
                }
@@ -379,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 */