From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 2/8] netfilter: ipv6: add IPSKB_REROUTED exclusion to NF_HOOK/POSTROUTING invocation
Date: Tue, 13 Apr 2010 15:33:23 +0200 [thread overview]
Message-ID: <4BC472A3.90107@trash.net> (raw)
In-Reply-To: <1271162268-28131-3-git-send-email-jengelh@medozas.de>
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
Jan Engelhardt wrote:
> Similar to how IPv4's ip_output.c works, have ip6_output also check
> the IPSKB_REROUTED flag. It will be set from xt_TEE for cloned packets
> since Xtables can currently only deal with a single packet in flight
> at a time.
>
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> Acked-by: David S. Miller <davem@davemloft.net>
> ---
> net/ipv6/ip6_output.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index f314ba4..7e10f62 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -172,8 +172,9 @@ int ip6_output(struct sk_buff *skb)
> return 0;
> }
>
> - return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL, dev,
> - ip6_finish_output);
> + return NF_HOOK_COND(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL, dev,
> + ip6_finish_output,
> + !(IP6CB(skb)->flags & IPSKB_REROUTED));
This needs to use an IP6SKB value to avoid clashes. I've fixed it up
as follows:
I'll also fix up the TEE patch to use the proper value for IPv6.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1505 bytes --]
commit 9c6eb28aca52d562f3ffbaebaa56385df9972a43
Author: Jan Engelhardt <jengelh@medozas.de>
Date: Tue Apr 13 15:32:16 2010 +0200
netfilter: ipv6: add IPSKB_REROUTED exclusion to NF_HOOK/POSTROUTING invocation
Similar to how IPv4's ip_output.c works, have ip6_output also check
the IPSKB_REROUTED flag. It will be set from xt_TEE for cloned packets
since Xtables can currently only deal with a single packet in flight
at a time.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Acked-by: David S. Miller <davem@davemloft.net>
[Patrick: changed to use an IP6SKB value instead of IPSKB]
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e0cc9a7..7bdf6ff 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -250,6 +250,7 @@ struct inet6_skb_parm {
#define IP6SKB_XFRM_TRANSFORMED 1
#define IP6SKB_FORWARDED 2
+#define IP6SKB_REROUTED 4
};
#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 236ac78..c10a38a 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -172,8 +172,9 @@ int ip6_output(struct sk_buff *skb)
return 0;
}
- return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL, dev,
- ip6_finish_output);
+ return NF_HOOK_COND(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL, dev,
+ ip6_finish_output,
+ !(IP6CB(skb)->flags & IP6SKB_REROUTED));
}
/*
next prev parent reply other threads:[~2010-04-13 13:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-13 12:37 nf-next: reentrancy, new modules Jan Engelhardt
2010-04-13 12:37 ` [PATCH 1/8] netfilter: ipv6: move POSTROUTING invocation before fragmentation Jan Engelhardt
2010-04-13 13:30 ` Patrick McHardy
2010-04-13 12:37 ` [PATCH 2/8] netfilter: ipv6: add IPSKB_REROUTED exclusion to NF_HOOK/POSTROUTING invocation Jan Engelhardt
2010-04-13 13:33 ` Patrick McHardy [this message]
2010-04-13 13:34 ` Jan Engelhardt
2010-04-13 13:36 ` Patrick McHardy
2010-04-13 12:37 ` [PATCH 3/8] netfilter: xtables: inclusion of xt_TEE Jan Engelhardt
2010-04-13 13:37 ` Patrick McHardy
2010-04-13 13:45 ` Patrick McHardy
2010-04-13 16:09 ` Jan Engelhardt
2010-04-13 16:17 ` Jan Engelhardt
2010-04-13 16:33 ` Patrick McHardy
2010-04-13 16:32 ` Patrick McHardy
2010-04-13 17:28 ` Jan Engelhardt
2010-04-13 17:31 ` Patrick McHardy
2010-04-13 12:37 ` [PATCH 4/8] netfilter: xtables2: make ip_tables reentrant Jan Engelhardt
2010-04-13 12:37 ` [PATCH 5/8] netfilter: xt_TEE: have cloned packet travel through Xtables too Jan Engelhardt
2010-04-13 12:37 ` [PATCH 6/8] netfilter: xtables: remove old comments about reentrancy Jan Engelhardt
2010-04-13 12:37 ` [PATCH 7/8] netfilter: xtables: inclusion of xt_SYSRQ Jan Engelhardt
2010-04-13 12:37 ` [PATCH 8/8] netfilter: xtables: inclusion of xt_condition Jan Engelhardt
2010-04-13 13:26 ` nf-next: reentrancy, new modules 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=4BC472A3.90107@trash.net \
--to=kaber@trash.net \
--cc=jengelh@medozas.de \
--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 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.