/* * Subject to the GPL, version 2. */ #include "xmalloc.h" struct panic_handler { void *arg; pid_t pid; bool is_enabled; void (*on_panic)(void *arg); struct panic_handler *next; }; static struct panic_handler *panic_handlers; void panic_handler_add(void (*on_panic)(void *arg), void *arg) { struct panic_handler *handler = xmallocz(sizeof(*handler)); handler->arg = arg; handler->pid = getpid(); handler->is_enabled = true; handler->on_panic = on_panic; handler->next = panic_handlers; panic_handlers = handler; }; void call_panic_handlers(void) { struct panic_handler *it; pid_t pid = getpid(); for (it = panic_handlers; it; it = it->next) { if (it->pid == pid && it->is_enabled) { it->is_enabled = false; it->on_panic(it->arg); } } } > index : net-next.git
net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiping Zhang <liping.zhang@spreadtrum.com>2016-09-11 22:05:27 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2016-09-12 19:54:46 +0200
commit6bd14303a908833e10ac731a3308eba938305269 (patch)
tree1ae4490c611c28f034b15451c577843f0384e7c3
parent23d07508d25cea9984ee068538b4e86932b015c2 (diff)
netfilter: nf_queue: get rid of dependency on IP6_NF_IPTABLES
hash_v6 is used by both nftables and ip6tables, so depend on IP6_NF_IPTABLES is not properly. Actually, it only parses ipv6hdr and computes a hash value, so even if IPV6 is disabled, there's no side effect too, remove it. Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat