From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com
Subject: [PATCH 2/3 XFRM]: Always reroute in tunnel mode
Date: Sat, 05 Mar 2005 14:59:03 +0100 [thread overview]
Message-ID: <4229BB27.30009@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: 02.diff --]
[-- Type: text/x-patch, Size: 3022 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/03/05 01:58:51+01:00 kaber@coreworks.de
# [XFRM]: Always reroute in tunnel mode
#
# Tunnel mode packets are rerouted if the tunnel destination
# address is different from the original destination address,
# otherwise the old route is used. This is inconsistent, the
# old route might have been selected for a given output device
# or using routing by tos/fwmark. Always choose a new route
# in tunnel mode.
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv6/xfrm6_policy.c
# 2005/03/05 01:58:41+01:00 kaber@coreworks.de +3 -1
# [XFRM]: Always reroute in tunnel mode
#
# Tunnel mode packets are rerouted if the tunnel destination
# address is different from the original destination address,
# otherwise the old route is used. This is inconsistent, the
# old route might have been selected for a given output device
# or using routing by tos/fwmark. Always choose a new route
# in tunnel mode.
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv4/xfrm4_policy.c
# 2005/03/05 01:58:41+01:00 kaber@coreworks.de +3 -1
# [XFRM]: Always reroute in tunnel mode
#
# Tunnel mode packets are rerouted if the tunnel destination
# address is different from the original destination address,
# otherwise the old route is used. This is inconsistent, the
# old route might have been selected for a given output device
# or using routing by tos/fwmark. Always choose a new route
# in tunnel mode.
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
--- a/net/ipv4/xfrm4_policy.c 2005-03-05 13:03:32 +01:00
+++ b/net/ipv4/xfrm4_policy.c 2005-03-05 13:03:32 +01:00
@@ -59,6 +59,7 @@
int err;
int header_len = 0;
int trailer_len = 0;
+ int tunnel = 0;
dst = dst_prev = NULL;
@@ -81,12 +82,13 @@
if (xfrm[i]->props.mode) {
remote = xfrm[i]->id.daddr.a4;
local = xfrm[i]->props.saddr.a4;
+ tunnel = 1;
}
header_len += xfrm[i]->props.header_len;
trailer_len += xfrm[i]->props.trailer_len;
}
- if (remote != fl->fl4_dst) {
+ if (tunnel) {
struct flowi fl_tunnel = { .nl_u = { .ip4_u =
{ .daddr = remote,
.saddr = local }
diff -Nru a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
--- a/net/ipv6/xfrm6_policy.c 2005-03-05 13:03:32 +01:00
+++ b/net/ipv6/xfrm6_policy.c 2005-03-05 13:03:32 +01:00
@@ -76,6 +76,7 @@
int err = 0;
int header_len = 0;
int trailer_len = 0;
+ int tunnel = 0;
dst = dst_prev = NULL;
@@ -98,12 +99,13 @@
if (xfrm[i]->props.mode) {
remote = (struct in6_addr*)&xfrm[i]->id.daddr;
local = (struct in6_addr*)&xfrm[i]->props.saddr;
+ tunnel = 1;
}
header_len += xfrm[i]->props.header_len;
trailer_len += xfrm[i]->props.trailer_len;
}
- if (!ipv6_addr_equal(remote, &fl->fl6_dst)) {
+ if (tunnel) {
struct flowi fl_tunnel;
memset(&fl_tunnel, 0, sizeof(fl_tunnel));
next reply other threads:[~2005-03-05 13:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-05 13:59 Patrick McHardy [this message]
2005-03-11 0:19 ` [PATCH 2/3 XFRM]: Always reroute in tunnel mode David S. 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=4229BB27.30009@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netdev@oss.sgi.com \
/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).