All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "Gary W. Smith" <gary@primeexalia.com>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: Proposed netmap patch
Date: Sat, 16 Jul 2005 20:18:48 +0200	[thread overview]
Message-ID: <42D94F88.7040502@trash.net> (raw)
In-Reply-To: <57F9959B46E0FA4D8BA88AEDFBE582907446@pxtbenexd01.pxt.primeexalia.com>

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

Gary W. Smith schrieb:
> Signed-off-by: Gary Wayne Smith <gary.w.smith@primeexalia.com>

Applied, thanks. I've slightly modified it to break lines at 80
characters and changed the assertion to expect packets in LOCAL_OUT
as well.

Regards
Patrick

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1670 bytes --]

[NETFILTER]: Make NETMAP target usable in OUTPUT

Signed-off-by: Gary Wayne Smith <gary.w.smith@primeexalia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 420d86533d641723c1224eb6aed796fb5ea6c0d3
tree 4d03301180389c82220aba920703f68276f00d61
parent 01f7dc836da6aa4434d293671442bbc6d115d02f
author Patrick McHardy <kaber@trash.net> Sat, 16 Jul 2005 20:17:13
committer Gary Wayne Smith <gary.w.smith@primeexalia.com> Sat, 16 Jul 2005 20:17:13

 net/ipv4/netfilter/ipt_NETMAP.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_NETMAP.c b/net/ipv4/netfilter/ipt_NETMAP.c
--- a/net/ipv4/netfilter/ipt_NETMAP.c
+++ b/net/ipv4/netfilter/ipt_NETMAP.c
@@ -46,7 +46,8 @@ check(const char *tablename,
 		DEBUGP(MODULENAME":check: size %u.\n", targinfosize);
 		return 0;
 	}
-	if (hook_mask & ~((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_POST_ROUTING))) {
+	if (hook_mask & ~((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_POST_ROUTING) |
+	                  (1 << NF_IP_LOCAL_OUT))) {
 		DEBUGP(MODULENAME":check: bad hooks %x.\n", hook_mask);
 		return 0;
 	}
@@ -76,12 +77,13 @@ target(struct sk_buff **pskb,
 	struct ip_nat_range newrange;
 
 	IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING
-		     || hooknum == NF_IP_POST_ROUTING);
+		     || hooknum == NF_IP_POST_ROUTING
+		     || hooknum == NF_IP_LOCAL_OUT);
 	ct = ip_conntrack_get(*pskb, &ctinfo);
 
 	netmask = ~(mr->range[0].min_ip ^ mr->range[0].max_ip);
 
-	if (hooknum == NF_IP_PRE_ROUTING)
+	if (hooknum == NF_IP_PRE_ROUTING || hooknum == NF_IP_LOCAL_OUT)
 		new_ip = (*pskb)->nh.iph->daddr & ~netmask;
 	else
 		new_ip = (*pskb)->nh.iph->saddr & ~netmask;

  reply	other threads:[~2005-07-16 18:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-16 18:06 Proposed netmap patch Gary W. Smith
2005-07-16 18:18 ` Patrick McHardy [this message]
2005-08-12 14:11   ` Harald Welte
2005-08-12 14:23     ` Patrick McHardy
2005-08-12 14:44       ` Harald Welte
  -- strict thread matches above, loose matches on Subject: below --
2005-07-13 14:08 Gary W. Smith
2005-07-12 17:16 Gary W. Smith
2005-07-13 10:32 ` Jan Engelhardt
2005-07-13 10:49   ` Herve Eychenne
2005-07-16 16:16 ` 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=42D94F88.7040502@trash.net \
    --to=kaber@trash.net \
    --cc=gary@primeexalia.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.