1 http://ilapstech.blogspot.com/2009/09/cisco-vpn-client-on-karmic-koala.html
3 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c: In function ‘interceptor_init’:
4 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c:132: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
5 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c:133: error: ‘struct net_device’ has no member named ‘get_stats’
6 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c:134: error: ‘struct net_device’ has no member named ‘do_ioctl’
7 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c: In function ‘add_netdev’:
8 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c:271: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
9 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c:272: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
10 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c: In function ‘remove_netdev’:
11 /opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.c:294: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
12 make[2]: *** [/opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori/interceptor.o] Error 1
13 make[1]: *** [_module_/opt/Devel/CiscoVPNClient/4.8.02/vpnclient.ori] Error 2
14 make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-9-generic'
15 make: *** [default] Error 2
16 Failed to make module "cisco_ipsec.ko".
18 Oooops, so it's failed. I tried to find any solution on the Net but I
19 couldn't get any. I looked at the source code and seemed that the Linux
20 kernel 2.6.31 replaced the old net_device structure with a new one and is
21 using that new structure for the net_device operations. This structure
22 called net_device_ops (const struct net_device_ops *netdev_ops).
24 I think this new netdevice feature is available from the 2.6.29 kernel and
25 it was coexisted with the old method too. I got some info about this on the
26 following link: http://cateee.net/lkddb/web-lkddb/COMPAT_NET_DEV_OPS.html
28 Unfortunately, this option is disappeared from the 2.6.31 so there was no
29 option anymore to get the vpnclient to work with a COMPAT_NET_DEV_OPS=y
32 --- vpnclient.ori/interceptor.c 2009-05-21 01:16:34.000000000 +1200
33 +++ vpnclient/interceptor.c 2009-09-06 22:02:39.000000000 +1200
38 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
39 +static struct net_device_ops interceptor_netdev_ops = {
40 + .ndo_start_xmit = interceptor_tx,
41 + .ndo_do_ioctl = interceptor_ioctl,
42 + .ndo_get_stats = interceptor_stats,
46 static struct notifier_block interceptor_notifier = {
47 .notifier_call = handle_netdev_event,
53 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
54 + dev->netdev_ops = &interceptor_netdev_ops;
56 dev->hard_start_xmit = interceptor_tx;
57 dev->get_stats = interceptor_stats;
58 dev->do_ioctl = interceptor_ioctl;
61 dev->mtu = ETH_DATA_LEN-MTU_REDUCTION;
62 kernel_memcpy(dev->dev_addr, interceptor_eth_addr,ETH_ALEN);
67 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
68 + struct net_device_ops * tmp_ops;
71 if (!supported_device(dev))
74 Bindings[i].original_mtu = dev->mtu;
76 /*replace the original send function with our send function */
77 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
78 + Bindings[i].InjectSend = dev->netdev_ops->ndo_start_xmit;
79 + tmp_ops = (struct net_device_ops *) dev->netdev_ops;
80 + tmp_ops->ndo_start_xmit = replacement_dev_xmit;
82 Bindings[i].InjectSend = dev->hard_start_xmit;
83 dev->hard_start_xmit = replacement_dev_xmit;
86 /*copy in the ip packet handler function and packet type struct */
87 Bindings[i].InjectReceive = original_ip_handler.orig_handler_func;
92 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
93 + struct net_device_ops * tmp_ops;
96 b = getbindingbydev(dev);
101 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
102 + tmp_ops = (struct net_device_ops *) dev->netdev_ops;
103 + tmp_ops->ndo_start_xmit = b->InjectSend;
105 dev->hard_start_xmit = b->InjectSend;
107 kernel_memset(b, 0, sizeof(BINDING));