You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
794 B

  1. --- a/kernelmod/main.c
  2. +++ b/kernelmod/main.c
  3. @@ -91,8 +91,11 @@ modinit( void ) {
  4. rv = mrm_rcdb_init();
  5. if (rv != 0) return rv;
  6. -
  7. +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)
  8. nf_register_hook(&_hops);
  9. +#else
  10. + nf_register_net_hook(&init_net, &_hops);
  11. +#endif
  12. mrm_init_ctlfile(); /* XXX not checking for failure! */
  13. printk(KERN_INFO "MRM The MAC Address Re-Mapper is now in the kernel\n");
  14. @@ -103,7 +106,11 @@ modinit( void ) {
  15. static void __exit
  16. modexit( void ) {
  17. mrm_destroy_ctlfile();
  18. +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)
  19. nf_unregister_hook(&_hops);
  20. +#else
  21. + nf_unregister_net_hook(&init_net, &_hops);
  22. +#endif
  23. mrm_rcdb_destroy(); /* imperative that this happens last */
  24. printk(KERN_INFO "MRM The MAC Address Re-Mapper gone bye-bye\n");
  25. }