Ticket #4236: vboxnetflt.diff
| File vboxnetflt.diff, 1.6 KB (added by , 15 years ago) |
|---|
-
linux/VBoxNetFlt-linux.c
27 27 #include <linux/netdevice.h> 28 28 #include <linux/etherdevice.h> 29 29 #include <linux/rtnetlink.h> 30 #include <linux/ip.h> 30 31 31 32 #define LOG_GROUP LOG_GROUP_NET_FLT_DRV 32 33 #include <VBox/log.h> … … 774 775 else 775 776 { 776 777 if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING) 778 { 779 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) 780 /* 781 * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9 782 * and 2.6.18 kernels), they pass wrong 'h' pointer down. We take IP 783 * header length from the header itself and reconstruct 'h' pointer 784 * to TCP (or whatever) header. 785 */ 786 unsigned char *tmp = pBuf->h.raw; 787 if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP)) 788 pBuf->h.raw = pBuf->nh.raw + pBuf->nh.iph->ihl * 4; 789 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */ 777 790 if (VBOX_SKB_CHECKSUM_HELP(pBuf)) 778 791 { 779 792 LogRel(("VBoxNetFlt: Failed to compute checksum, dropping the packet.\n")); 780 793 dev_kfree_skb(pBuf); 781 794 return; 782 795 } 796 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) 797 /* Restore the original (wrong) pointer. */ 798 pBuf->h.raw = tmp; 799 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */ 800 } 783 801 vboxNetFltLinuxForwardSegment(pThis, pBuf, fSrc); 784 802 } 785 803 /*

