Changeset 39479 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/linux
- Timestamp:
- Nov 30, 2011 5:07:23 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75134
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r39019 r39479 29 29 #include <linux/miscdevice.h> 30 30 #include <linux/ip.h> 31 #include <linux/if_vlan.h> 31 32 32 33 #include <VBox/log.h> … … 803 804 * Get rid of fragmented packets, they cause too much trouble. 804 805 */ 806 unsigned int uMacLen = pBuf->mac_len; 805 807 struct sk_buff *pCopy = skb_copy(pBuf, GFP_ATOMIC); 806 808 kfree_skb(pBuf); … … 811 813 } 812 814 pBuf = pCopy; 815 /* Somehow skb_copy ignores mac_len */ 816 pBuf->mac_len = uMacLen; 817 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) 818 /* Restore VLAN tag stripped by host hardware */ 819 if (vlan_tx_tag_present(pBuf) && skb_headroom(pBuf) >= VLAN_ETH_HLEN) 820 { 821 uint8_t *pMac = (uint8_t*)skb_mac_header(pBuf); 822 struct vlan_ethhdr *pVHdr = (struct vlan_ethhdr *)(pMac - VLAN_HLEN); 823 memmove(pVHdr, pMac, VLAN_ETH_ALEN * 2); 824 pVHdr->h_vlan_proto = RT_H2N_U16(ETH_P_8021Q); 825 pVHdr->h_vlan_TCI = RT_H2N_U16(vlan_tx_tag_get(pBuf)); 826 pBuf->mac_header -= VLAN_HLEN; 827 pBuf->mac_len += VLAN_HLEN; 828 } 829 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */ 830 813 831 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) 814 832 Log3(("vboxNetFltLinuxPacketHandler: skb copy len=%u data_len=%u truesize=%u next=%p nr_frags=%u gso_size=%u gso_seqs=%u gso_type=%x frag_list=%p pkt_type=%x\n", … … 1204 1222 /* 1205 1223 * The packet came from wire, ethernet header was removed by device driver. 1206 * Restore it .1224 * Restore it using mac_len field. This takes into account VLAN headers too. 1207 1225 */ 1208 skb_push(pBuf, ETH_HLEN);1226 skb_push(pBuf, pBuf->mac_len); 1209 1227 } 1210 1228
Note:
See TracChangeset
for help on using the changeset viewer.