static void __exit log_tg_exit(void) { unregister_pernet_subsys(&log_net_ops); nf_log_unregister(&ipt_log_logger); #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) nf_log_unregister(&ip6t_log_logger); #endif xt_unregister_targets(log_tg_regs, ARRAY_SIZE(log_tg_regs)); }
//----------------------------------------------------------------------------- static void __exit gtpusp_tg_exit(void) //----------------------------------------------------------------------------- { int err; int loop = 0; if (_gtpusp_sock.thread==NULL) { pr_info(MODULE_NAME": no kernel thread to kill\n"); } else { if (_gtpusp_sock.running > 0) { _gtpusp_sock.thread_stop_requested = 1; pr_info(MODULE_NAME": exit kernel thread requested\n"); do { pr_info(MODULE_NAME": waking up thread with datagram\n"); msleep(5); pr_info(MODULE_NAME": waiting for thread...\n"); loop++; } while ((_gtpusp_sock.running > 0) && (loop < 20)); if (_gtpusp_sock.running > 0) { pr_info(MODULE_NAME": stopping kernel thread\n"); err = kthread_stop(_gtpusp_sock.thread); if(!err) { pr_info(MODULE_NAME": Successfully killed kernel thread!\n"); } else { pr_info(MODULE_NAME": Unsuccessfully killed kernel thread!\n"); } } else { pr_info(MODULE_NAME": Found thread exited by itself\n"); } } } /* free allocated resources before exit */ if (_gtpusp_sock.sock != NULL) { sock_release(_gtpusp_sock.sock); _gtpusp_sock.sock = NULL; } xt_unregister_targets(gtpusp_tg_reg, ARRAY_SIZE(gtpusp_tg_reg)); pr_info(MODULE_NAME": Unloading module\n"); }
static void netmap_tg_exit(void) { xt_unregister_targets(netmap_tg_reg, ARRAY_SIZE(netmap_tg_reg)); }
static void __exit xt_set_fini(void) { xt_unregister_matches(set_matches, ARRAY_SIZE(set_matches)); xt_unregister_targets(set_targets, ARRAY_SIZE(set_targets)); }
static void __exit hl_tg_exit(void) { xt_unregister_targets(hl_tg_reg, ARRAY_SIZE(hl_tg_reg)); }
static void __exit redirect_tg_exit(void) { xt_unregister_targets(redirect_tg_reg, ARRAY_SIZE(redirect_tg_reg)); }
static void __exit tcpoptstrip_tg_exit(void) { xt_unregister_targets(tcpoptstrip_tg_reg, ARRAY_SIZE(tcpoptstrip_tg_reg)); }
static void __exit tproxy_tg_exit(void) { xt_unregister_targets(tproxy_tg_reg, ARRAY_SIZE(tproxy_tg_reg)); }
static void __exit nflog_tg_exit(void) { xt_unregister_targets(nflog_tg_reg, ARRAY_SIZE(nflog_tg_reg)); }
static void __exit ip6t_npt_exit(void) { xt_unregister_targets(ip6t_npt_target_reg, ARRAY_SIZE(ip6t_npt_target_reg)); }
static void __exit audit_tg_exit(void) { xt_unregister_targets(audit_tg_reg, ARRAY_SIZE(audit_tg_reg)); }
static void __exit xt_ct_tg_exit(void) { xt_unregister_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg)); xt_unregister_target(¬rack_tg_reg); }
static void __exit xt_nfqueue_fini(void) { xt_unregister_targets(xt_nfqueue_target, ARRAY_SIZE(xt_nfqueue_target)); }
static void __exit echo_tg_exit(void) { return xt_unregister_targets(echo_tg_reg, ARRAY_SIZE(echo_tg_reg)); }
static void __exit connsecmark_tg_exit(void) { xt_unregister_targets(connsecmark_tg_reg, ARRAY_SIZE(connsecmark_tg_reg)); }
static void __exit udpencap_tg_exit(void) { xt_unregister_targets(udpencap_tg_reg, ARRAY_SIZE(udpencap_tg_reg)); }
static void __exit xt_secmark_fini(void) { xt_unregister_targets(xt_secmark_target, ARRAY_SIZE(xt_secmark_target)); }
static void __exit xt_mpls_fini(void) { xt_unregister_targets(xt_mpls_target, ARRAY_SIZE(xt_mpls_target)); }
static void __exit fini(void) { xt_unregister_targets(xt_imq_reg, ARRAY_SIZE(xt_imq_reg)); }
static void __exit classify_tg_exit(void) { xt_unregister_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg)); }