From: Martin Bouzek <martin.bouzek@radas-atc.cz>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Minor IPSec bug + solution
Date: 16 Sep 2004 11:36:12 +0200 [thread overview]
Message-ID: <1095327372.4466.87.camel@mabouzek> (raw)
Hi,
I was setting up an VPN via IPSec in kernel 2.6.x on IPv4 and found the
following bug. It is not possible to set up an IPComp/ESP tunnel with
IPComp set as mandatory. The following setup works fine for me:
spdadd 192.168.1.0/24 192.168.2.0/24 any -P out ipsec
ipcomp/tunnel/192.168.1.100-192.168.2.212/use
esp/tunnel/192.168.1.100-82.99.145.1/require;
(IPs are little bit confusing, because computers are behing NAT and the
pair SP is not shown, because it is not important)
But the following one is not working:
spdadd 192.168.1.0/24 192.168.2.0/24 any -P out ipsec
ipcomp/tunnel/192.168.1.100-192.168.2.212/require
esp/tunnel/192.168.1.100-82.99.145.1/require;
Of course it is possible to use the first setup, but I found that
problem was in "require" for IPComp only after quite a while of
debugging. :-)
The later setup is not working, because all IP-IP packets are droped by
__xfrm_policy_check function, because of error in xfrm_state_ok
function. For tunnels it returns
tmpl->optional && !xfrm_state_addr_cmp(tmpl, x, family);
but it should return
tmpl->optional || !xfrm_state_addr_cmp(tmpl, x, family);
The packet should pass policy check if either the policy is optional OR
the source address match. The code says that check pass if policy is
optional AND the address match, which is obviously wrong. IMHO it is the
reason, why I have to set this "use" for IPComp tunnel.
So the problem is in file "net/xfrm/xfrm_policy.c" in function
"xfrm_state_ok" - on line 868 in 2.6.8.1 kernel. It seems to me to
trivial change to create a patch.
I am not sure where I shall send this mail. As I said, it is a minnor
bug, and it is possible to set up things working even with it.
Nevertheless it would be nice to have it fixed. Can somebody help me,
where I shall send it?
Thanks.
- Martin Bouzek
- martin.bouzek@radas-atc.cz
next reply other threads:[~2004-09-16 9:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-16 9:36 Martin Bouzek [this message]
2004-09-16 21:19 ` Minor IPSec bug + solution Herbert Xu
2004-09-17 9:26 ` Martin Bouzek
2004-09-17 10:27 ` Herbert Xu
2004-09-20 7:49 ` Martin Bouzek
2004-09-20 10:57 ` Herbert Xu
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=1095327372.4466.87.camel@mabouzek \
--to=martin.bouzek@radas-atc.cz \
--cc=linux-kernel@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.