diff -ruN lnlb.old/lnlb.c lnlb/lnlb.c --- lnlb.old/lnlb.c 2012-02-02 12:08:38.248091119 +0000 +++ lnlb/lnlb.c 2012-02-02 12:15:21.107823813 +0000 @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -84,6 +83,7 @@ MODULE_PARM_DESC(mode_unicast,"Select cluster MAC type: 1: Unicast / 0: Multicast."); static struct ethtool_ops lnlb_ethtool_ops; +static const struct net_device_ops lnlb_netdev_opts; /* List of allocated devices (nlb0,nbl1...) */ static LIST_HEAD(dev_list); static LIST_HEAD(dev_hook_list); @@ -210,6 +210,14 @@ .get_link = ei_get_link, }; +static const struct net_device_ops lnlb_netdev_opts = +{ + .ndo_open = net_open, + .ndo_stop = net_close, + .ndo_start_xmit = net_xmit, + .ndo_get_stats = net_stats, +}; + /*------------------------------------------------------------------------------------------------------------------------* Inline functions *------------------------------------------------------------------------------------------------------------------------*/ @@ -1280,7 +1288,6 @@ if(proc_file == NULL) return -ENOMEM; - proc_file->owner=THIS_MODULE; proc_file->read_proc = &proc_read_callback; proc_file->write_proc = &proc_write_callback; return 0; @@ -1952,7 +1959,7 @@ netfilter_hook=kmalloc(sizeof(struct nf_hook_ops),GFP_KERNEL); memset(netfilter_hook,0,sizeof(struct nf_hook_ops)); netfilter_hook->hook=netfilter_frame_hook; /*The callback function */ - netfilter_hook->hooknum = NF_IP_PRE_ROUTING; + netfilter_hook->hooknum = 0; /* NF_IP_PRE_ROUTING no longer defined for modules */ netfilter_hook->pf = PF_INET; netfilter_hook->owner = THIS_MODULE; netfilter_hook->priority = NF_IP_PRI_FIRST; //TODO: is this the right priority? @@ -2038,14 +2045,19 @@ return 1; } +static const struct net_device_ops lnlb_netdev_opts = +{ + .ndo_open = net_open, + .ndo_stop = net_close, + .ndo_start_xmit = net_xmit, + .ndo_get_stats = net_stats, +}; + /* This function is called back by the alloc_netdev function in instantiate_new_device function */ static void setup_dev_callback(struct net_device *iDev) { //SET_MODULE_OWNER(iDev); - iDev->open = net_open; - iDev->hard_start_xmit = net_xmit; - iDev->stop = net_close; - iDev->get_stats = net_stats; + iDev->netdev_ops = &lnlb_netdev_opts; iDev->ethtool_ops = &lnlb_ethtool_ops; iDev->destructor = free_netdev; } diff -ruN lnlb.old/lnlb_mod_tracking.c lnlb/lnlb_mod_tracking.c --- lnlb.old/lnlb_mod_tracking.c 2012-02-02 12:08:38.248091119 +0000 +++ lnlb/lnlb_mod_tracking.c 2012-02-02 12:13:24.458197648 +0000 @@ -638,7 +638,6 @@ if(proc_file == NULL) return -ENOMEM; - proc_file->owner=THIS_MODULE; proc_file->read_proc = proc_read_callback; proc_file->write_proc = NULL; return 0;