netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: kaber@trash.net, jengelh@medozas.de
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH] netfilter: fix mangle tables back
Date: Thu, 11 Feb 2010 18:12:36 +0200	[thread overview]
Message-ID: <20100211161235.GA4099@x200> (raw)

Calling POST_ROUTING hook with NULL input device is not going to work.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 net/ipv4/netfilter/iptable_mangle.c  |    2 +-
 net/ipv6/netfilter/ip6table_mangle.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -85,7 +85,7 @@ iptable_mangle_hook(unsigned int hook,
 		     const struct net_device *out,
 		     int (*okfn)(struct sk_buff *))
 {
-	if (hook == NF_INET_LOCAL_OUT)
+	if (hook == NF_INET_LOCAL_OUT || hook == NF_INET_POST_ROUTING)
 		return ipt_local_hook(hook, skb, in, out, okfn);
 
 	/* PREROUTING/INPUT/FORWARD: */
--- a/net/ipv6/netfilter/ip6table_mangle.c
+++ b/net/ipv6/netfilter/ip6table_mangle.c
@@ -79,7 +79,7 @@ ip6table_mangle_hook(unsigned int hook, struct sk_buff *skb,
 		     const struct net_device *in, const struct net_device *out,
 		     int (*okfn)(struct sk_buff *))
 {
-	if (hook == NF_INET_LOCAL_OUT)
+	if (hook == NF_INET_LOCAL_OUT || hook == NF_INET_POST_ROUTING)
 		return ip6t_local_out_hook(hook, skb, out, okfn);
 
 	/* INPUT/FORWARD */

             reply	other threads:[~2010-02-11 16:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-11 16:12 Alexey Dobriyan [this message]
2010-02-11 16:25 ` [PATCH] netfilter: fix mangle tables back Jan Engelhardt
2010-02-11 16:34   ` Patrick McHardy
2010-02-11 17:07     ` Jan Engelhardt
2010-02-11 17:13       ` Patrick McHardy
2010-02-11 17:15     ` Alexey Dobriyan
2010-02-11 17:24       ` Patrick McHardy
2010-02-11 17:27         ` Alexey Dobriyan
2010-02-11 17:42           ` 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=20100211161235.GA4099@x200 \
    --to=adobriyan@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).