From: Patrick McHardy <kaber@trash.net>
To: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>,
Linux Netdev List <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: RFC: consistent disable_xfrm behaviour
Date: Mon, 04 Dec 2006 18:03:11 +0100 [thread overview]
Message-ID: <457454CF.7040308@trash.net> (raw)
In-Reply-To: <20061204165253.GA11905@ms2.inr.ac.ru>
[-- Attachment #1: Type: text/plain, Size: 694 bytes --]
Alexey Kuznetsov wrote:
> Hello!
>
>
>>Alexey, do you remember what the original intent of this was?
>
>
> disable_policy was supposed to skip policy checks on input.
> It makes sense only on input device.
>
> disable_xfrm was supposed to skip transformations on output.
> It makes sense only on output device.
>
> If it does not work, it was done wrong. :-)
>
> As I see it, root of the problem is that DST_NOXFRM flag
> is calculated using wrong device. out_dev should be used
> in __mkroute_input(). It looks as a cut-n-paste error, the code
> was taken from output path, where it is correct.
Thanks, thats exactly what I suspected :)
Here's the patch again properly signed off.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 974 bytes --]
[XFRM]: Use output device disable_xfrm for forwarded packets
Currently the behaviour of disable_xfrm is inconsistent between
locally generated and forwarded packets. For locally generated
packets disable_xfrm disables the policy lookup if it is set on
the output device, for forwarded traffic however it looks at the
input device. This makes it impossible to disable xfrm on all
devices but a dummy device and use normal routing to direct
traffic to that device.
Always use the output device when checking disable_xfrm.
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9f3924c..164a7ee 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1780,7 +1780,7 @@ #ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
#endif
if (in_dev->cnf.no_policy)
rth->u.dst.flags |= DST_NOPOLICY;
- if (in_dev->cnf.no_xfrm)
+ if (out_dev->cnf.no_xfrm)
rth->u.dst.flags |= DST_NOXFRM;
rth->fl.fl4_dst = daddr;
rth->rt_dst = daddr;
next prev parent reply other threads:[~2006-12-04 17:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-04 14:59 RFC: consistent disable_xfrm behaviour Patrick McHardy
2006-12-04 15:05 ` James Morris
2006-12-04 15:20 ` Patrick McHardy
2006-12-04 16:52 ` Alexey Kuznetsov
2006-12-04 17:03 ` Patrick McHardy [this message]
2006-12-04 17:20 ` Alexey Kuznetsov
2006-12-05 3:59 ` David Miller
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=457454CF.7040308@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@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).