diff -uBbr vpnclient.orig/interceptor.c vpnclient/interceptor.c --- vpnclient.orig/interceptor.c 2009-10-07 20:22:56.000000000 +0200 +++ vpnclient/interceptor.c 2009-10-07 20:28:48.000000000 +0200 @@ -120,6 +120,14 @@ .notifier_call = handle_netdev_event, }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) +static const struct net_device_ops vpn_netdev_ops = { + .ndo_start_xmit = interceptor_tx, + .ndo_get_stats = interceptor_stats, + .ndo_do_ioctl = interceptor_ioctl, +}; +#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) static int #else @@ -128,10 +136,13 @@ interceptor_init(struct net_device *dev) { ether_setup(dev); - + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) + dev->netdev_ops = &vpn_netdev_ops; + #else dev->hard_start_xmit = interceptor_tx; dev->get_stats = interceptor_stats; dev->do_ioctl = interceptor_ioctl; + #endif dev->mtu = ETH_DATA_LEN-MTU_REDUCTION; kernel_memcpy(dev->dev_addr, interceptor_eth_addr,ETH_ALEN); @@ -268,8 +279,13 @@ Bindings[i].original_mtu = dev->mtu; /*replace the original send function with our send function */ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) + Bindings[i].InjectSend = dev->netdev_ops->ndo_start_xmit; + dev->netdev_ops->ndo_start_xmit = replacement_dev_xmit; + #else Bindings[i].InjectSend = dev->hard_start_xmit; dev->hard_start_xmit = replacement_dev_xmit; + #endif /*copy in the ip packet handler function and packet type struct */ Bindings[i].InjectReceive = original_ip_handler.orig_handler_func; @@ -291,7 +307,11 @@ if (b) { rc = 0; + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) + dev->netdev_ops->ndo_start_xmit = b->InjectSend; + #else dev->hard_start_xmit = b->InjectSend; + #endif kernel_memset(b, 0, sizeof(BINDING)); } else