예제 #1
0
static int __init imq_init_hooks(void)
{
	int ret;

	nf_register_queue_imq_handler(&imq_nfqh);

	ret = nf_register_hooks(imq_ops, ARRAY_SIZE(imq_ops));
	if (ret < 0)
		nf_unregister_queue_imq_handler();

	return ret;
}
예제 #2
0
static int __init imq_init_hooks(void)
{
	int err;

	nf_register_queue_imq_handler(&nfqh);

	err = nf_register_hook(&imq_ingress_ipv4);
	if (err)
		goto err1;

	err = nf_register_hook(&imq_egress_ipv4);
	if (err)
		goto err2;

#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
	err = nf_register_hook(&imq_ingress_ipv6);
	if (err)
		goto err3;

	err = nf_register_hook(&imq_egress_ipv6);
	if (err)
		goto err4;
#endif

	return 0;

#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
err4:
	nf_unregister_hook(&imq_ingress_ipv6);
err3:
	nf_unregister_hook(&imq_egress_ipv4);
#endif
err2:
	nf_unregister_hook(&imq_ingress_ipv4);
err1:
	nf_unregister_queue_imq_handler();
	return err;
}