packages/net/dcwifi/macremapper/patches/01_fix_nf_hooks.patch
Carey Sonsino 9129b75fff dcwifi: Add Dual Channel Wi-Fi component packages
dcstad: Dual Channel Wi-Fi Station Daemon
dcwapd: Dual Channel Wi-Fi Access Point Daemon
libdcwproto: Dual Channel Wi-Fi Protocol Library
libdcwsocket: Dual Channel Wi-Fi Socket Library
macremapper: MAC Address Remapper Linux Kernel Module
mrmctl: Userland tool to get/set remap rules

Signed-off-by: Carey Sonsino <careys@edgewaterwireless.com>
Signed-off-by: Carey Sonsino <csonsino@gmail.com>

Much help from @neheb
2019-10-02 13:34:11 +00:00

27 lines
794 B
Diff

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