All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rennie deGraaf <degraaf@cpsc.ucalgary.ca>
To: netfilter-devel@lists.netfilter.org
Subject: Bug (minor) in ip_tables.c?
Date: Thu, 10 Aug 2006 19:54:23 -0600	[thread overview]
Message-ID: <44DBE34F.8080902@cpsc.ucalgary.ca> (raw)

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

In init() in ip_tables.c, if nf_register_sockopt() fails, then the
function returns failure without unregistering the targets and matches
that it provides.  To correct this, init() should be changed to
something like this:

static int __init ip_tables_init(void)
{
	int ret;

	xt_proto_init(AF_INET);

	/* Noone else will be downing sem now, so we won't sleep */
	xt_register_target(&ipt_standard_target);
	xt_register_target(&ipt_error_target);
	xt_register_match(&icmp_matchstruct);

	/* Register setsockopt */
	ret = nf_register_sockopt(&ipt_sockopts);
	if (ret < 0) {
		duprintf("Unable to register sockopts.\n");
                goto failure_sockopt;
	}

	printk("ip_tables: (C) 2000-2006 Netfilter Core Team\n");
	return 0;

failure_sockopt:
	xt_unregister_match(AF_INET, &icmp_matchstruct);
	xt_unregister_target(AF_INET, &ipt_error_target);
	xt_unregister_target(AF_INET, &ipt_standard_target);
	xt_proto_fini(AF_INET);

        return ret;
}


Rennie deGraaf


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2006-08-11  1:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-11  1:54 Rennie deGraaf [this message]
2006-08-11 16:09 ` Bug (minor) in ip_tables.c? Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44DBE34F.8080902@cpsc.ucalgary.ca \
    --to=degraaf@cpsc.ucalgary.ca \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.