All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@eurodev.net>
To: Marcus Sundberg <marcus@ingate.com>
Cc: Harald Welte <laforge@netfilter.org>,
	Netfilter Development Mailinglist
	<netfilter-devel@lists.netfilter.org>
Subject: Re: [PATCH] ctnetlink: Fix NAT info setting.
Date: Thu, 01 Dec 2005 14:22:45 +0100	[thread overview]
Message-ID: <438EF925.4050802@eurodev.net> (raw)
In-Reply-To: <438EEF0E.60206@ingate.com>

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

Marcus Sundberg wrote:
> [NETFILTER] ctnetlink: Fix NAT info setting.
> 
> ip_nat_initialized() takes enum ip_nat_manip_type as it's second
> argument, not a hook number. The current code was not only ugly,
> but also broken as IP_NAT_MANIP_SRC != NF_IP_POST_ROUTING.

Thanks for the bugfix but I don't like it, it's a bit bloated. Harald,
please submit the patch attached. It uses HOOK2MANIP macro instead.

-- 
Pablo

[-- Attachment #2: x.patch --]
[-- Type: text/plain, Size: 864 bytes --]

[NETFILTER] ip_nat_initialized takes wrong parameter

ip_nat_initialized() takes enum ip_nat_manip_type as it's second
argument, not a hook number.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Index: netfilter-2.6.14.git/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
--- netfilter-2.6.14.git.orig/net/ipv4/netfilter/ip_conntrack_netlink.c	2005-12-01 14:15:09.000000000 +0100
+++ netfilter-2.6.14.git/net/ipv4/netfilter/ip_conntrack_netlink.c	2005-12-01 14:16:44.000000000 +0100
@@ -876,7 +876,7 @@ ctnetlink_change_status(struct ip_conntr
 		DEBUGP("NAT status: %lu\n", 
 		       status & (IPS_NAT_MASK | IPS_NAT_DONE_MASK));
 		
-		if (ip_nat_initialized(ct, hooknum))
+		if (ip_nat_initialized(ct, HOOK2MANIP(hooknum)))
 			return -EEXIST;
 		ip_nat_setup_info(ct, &range, hooknum);
 

  reply	other threads:[~2005-12-01 13:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01 12:39 [PATCH] ctnetlink: Fix NAT info setting Marcus Sundberg
2005-12-01 13:22 ` Pablo Neira Ayuso [this message]
2005-12-01 13:38   ` Marcus Sundberg
2005-12-04 15:36   ` 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=438EF925.4050802@eurodev.net \
    --to=pablo@eurodev.net \
    --cc=laforge@netfilter.org \
    --cc=marcus@ingate.com \
    --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.