Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. diff -ruN lnlb.old/lnlb.c lnlb/lnlb.c
  2. --- lnlb.old/lnlb.c 2012-02-02 12:08:38.248091119 +0000
  3. +++ lnlb/lnlb.c 2012-02-02 12:15:21.107823813 +0000
  4. @@ -45,7 +45,6 @@
  5. #include <linux/udp.h>
  6. #include <linux/if_arp.h>
  7. #include <linux/if_ether.h>
  8. -#include <linux/netfilter.h>
  9. #include <linux/netfilter_ipv4.h>
  10. #include <linux/netfilter_arp.h>
  11. #include <linux/crc32.h>
  12. @@ -84,6 +83,7 @@
  13. MODULE_PARM_DESC(mode_unicast,"Select cluster MAC type: 1: Unicast / 0: Multicast.");
  14.  
  15. static struct ethtool_ops lnlb_ethtool_ops;
  16. +static const struct net_device_ops lnlb_netdev_opts;
  17. /* List of allocated devices (nlb0,nbl1...) */
  18. static LIST_HEAD(dev_list);
  19. static LIST_HEAD(dev_hook_list);
  20. @@ -210,6 +210,14 @@
  21. .get_link = ei_get_link,
  22. };
  23.  
  24. +static const struct net_device_ops lnlb_netdev_opts =
  25. +{
  26. + .ndo_open = net_open,
  27. + .ndo_stop = net_close,
  28. + .ndo_start_xmit = net_xmit,
  29. + .ndo_get_stats = net_stats,
  30. +};
  31. +
  32. /*------------------------------------------------------------------------------------------------------------------------*
  33. Inline functions
  34. *------------------------------------------------------------------------------------------------------------------------*/
  35. @@ -1280,7 +1288,6 @@
  36. if(proc_file == NULL)
  37. return -ENOMEM;
  38.  
  39. - proc_file->owner=THIS_MODULE;
  40. proc_file->read_proc = &proc_read_callback;
  41. proc_file->write_proc = &proc_write_callback;
  42. return 0;
  43. @@ -1952,7 +1959,7 @@
  44. netfilter_hook=kmalloc(sizeof(struct nf_hook_ops),GFP_KERNEL);
  45. memset(netfilter_hook,0,sizeof(struct nf_hook_ops));
  46. netfilter_hook->hook=netfilter_frame_hook; /*The callback function */
  47. - netfilter_hook->hooknum = NF_IP_PRE_ROUTING;
  48. + netfilter_hook->hooknum = 0; /* NF_IP_PRE_ROUTING no longer defined for modules */
  49. netfilter_hook->pf = PF_INET;
  50. netfilter_hook->owner = THIS_MODULE;
  51. netfilter_hook->priority = NF_IP_PRI_FIRST; //TODO: is this the right priority?
  52. @@ -2038,14 +2045,19 @@
  53. return 1;
  54. }
  55.  
  56. +static const struct net_device_ops lnlb_netdev_opts =
  57. +{
  58. + .ndo_open = net_open,
  59. + .ndo_stop = net_close,
  60. + .ndo_start_xmit = net_xmit,
  61. + .ndo_get_stats = net_stats,
  62. +};
  63. +
  64. /* This function is called back by the alloc_netdev function in instantiate_new_device function */
  65. static void setup_dev_callback(struct net_device *iDev)
  66. {
  67. //SET_MODULE_OWNER(iDev);
  68. - iDev->open = net_open;
  69. - iDev->hard_start_xmit = net_xmit;
  70. - iDev->stop = net_close;
  71. - iDev->get_stats = net_stats;
  72. + iDev->netdev_ops = &lnlb_netdev_opts;
  73. iDev->ethtool_ops = &lnlb_ethtool_ops;
  74. iDev->destructor = free_netdev;
  75. }
  76. diff -ruN lnlb.old/lnlb_mod_tracking.c lnlb/lnlb_mod_tracking.c
  77. --- lnlb.old/lnlb_mod_tracking.c 2012-02-02 12:08:38.248091119 +0000
  78. +++ lnlb/lnlb_mod_tracking.c 2012-02-02 12:13:24.458197648 +0000
  79. @@ -638,7 +638,6 @@
  80. if(proc_file == NULL)
  81. return -ENOMEM;
  82.  
  83. - proc_file->owner=THIS_MODULE;
  84. proc_file->read_proc = proc_read_callback;
  85. proc_file->write_proc = NULL;
  86. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement