diff -urN work.orig/vmnet-only/filter.c work/vmnet-only/filter.c --- work.orig/vmnet-only/filter.c 2012-01-07 11:28:49.740305660 -0500 +++ work/vmnet-only/filter.c 2012-01-07 11:31:19.256253304 -0500 @@ -27,6 +27,7 @@ #include "compat_mutex.h" #include "compat_semaphore.h" #include +#include /* * All this makes sense only if NETFILTER support is configured in our kernel. */ diff -urN work.orig/vmnet-only/kmap_skb.h work/vmnet-only/kmap_skb.h --- work.orig/vmnet-only/kmap_skb.h 1969-12-31 19:00:00.000000000 -0500 +++ work/vmnet-only/kmap_skb.h 2012-01-07 11:31:24.855363690 -0500 @@ -0,0 +1,19 @@ +#include + +static inline void *kmap_skb_frag(const skb_frag_t *frag) +{ +#ifdef CONFIG_HIGHMEM + BUG_ON(in_irq()); + + local_bh_disable(); +#endif + return kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ); +} + +static inline void kunmap_skb_frag(void *vaddr) +{ + kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ); +#ifdef CONFIG_HIGHMEM + local_bh_enable(); +#endif +} diff -urN work.orig/vmnet-only/netif.c work/vmnet-only/netif.c --- work.orig/vmnet-only/netif.c 2011-09-23 22:44:33.000000000 -0400 +++ work/vmnet-only/netif.c 2012-01-07 11:31:40.831678614 -0500 @@ -131,7 +131,11 @@ .ndo_stop = VNetNetifClose, .ndo_get_stats = VNetNetifGetStats, .ndo_set_mac_address = VNetNetifSetMAC, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) + .ndo_set_rx_mode = VNetNetifSetMulticast, +#else .ndo_set_multicast_list = VNetNetifSetMulticast, +#endif /* * We cannot stuck... If someone will report problems under * low memory conditions or some such, we should enable it. diff -urN work.orig/vmnet-only/userif.c work/vmnet-only/userif.c --- work.orig/vmnet-only/userif.c 2011-09-23 22:44:33.000000000 -0400 +++ work/vmnet-only/userif.c 2012-01-07 11:31:32.463513659 -0500 @@ -33,7 +33,9 @@ #include #include "compat_sock.h" +#ifndef __KERNEL_SYSCALLS__ #define __KERNEL_SYSCALLS__ +#endif #include #include @@ -53,6 +55,8 @@ #include "vmnetInt.h" #include "vm_atomic.h" +#include "kmap_skb.h" + typedef struct VNetUserIFStats { unsigned read; unsigned written; @@ -570,12 +574,20 @@ frag++) { if (frag->size > 0) { unsigned int tmpCsum; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) + void *vaddr; + vaddr = kmap_skb_frag(frag); +#else const void *vaddr; - - vaddr = kmap(frag->page); + vaddr = kmap(frag->page); +#endif tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset, curr, frag->size, 0, &err); - kunmap(frag->page); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0) + kunmap_skb_frag(vaddr); +#else + kunmap(frag->page); +#endif if (err) { return err; }