From: David Miller <davem@davemloft.net>
To: steffen.klassert@secunet.com
Cc: gaofeng@cn.fujitsu.com, netdev@vger.kernel.org
Subject: Re: [PATCH 1/4] ipv4: Fix pmtu propagating
Date: Thu, 01 Dec 2011 13:40:45 -0500 (EST) [thread overview]
Message-ID: <20111201.134045.1083297991862286043.davem@davemloft.net> (raw)
In-Reply-To: <20111121075621.GF20943@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Mon, 21 Nov 2011 08:56:21 +0100
> I still don't see any problems with both of the patches.
> So I assume that both patches would fix the issue. However,
> your patch is probaply less fragile as this does not depend
> on a certain value of dst->obsolete.
Great, thanks for checking it out.
I'll add the following to the net tree and queue it up for -stable
too.
--------------------
ipv4: Perform peer validation on cached route lookup.
Otherwise we won't notice the peer GENID change.
Reported-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/route.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 57e01bc..ca5e237 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1693,12 +1693,8 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
}
-static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)
+static struct rtable *ipv4_validate_peer(struct rtable *rt)
{
- struct rtable *rt = (struct rtable *) dst;
-
- if (rt_is_expired(rt))
- return NULL;
if (rt->rt_peer_genid != rt_peer_genid()) {
struct inet_peer *peer;
@@ -1707,19 +1703,29 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)
peer = rt->peer;
if (peer) {
- check_peer_pmtu(dst, peer);
+ check_peer_pmtu(&rt->dst, peer);
if (peer->redirect_genid != redirect_genid)
peer->redirect_learned.a4 = 0;
if (peer->redirect_learned.a4 &&
peer->redirect_learned.a4 != rt->rt_gateway) {
- if (check_peer_redir(dst, peer))
+ if (check_peer_redir(&rt->dst, peer))
return NULL;
}
}
rt->rt_peer_genid = rt_peer_genid();
}
+ return rt;
+}
+
+static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)
+{
+ struct rtable *rt = (struct rtable *) dst;
+
+ if (rt_is_expired(rt))
+ return NULL;
+ dst = (struct dst_entry *) ipv4_validate_peer(rt);
return dst;
}
@@ -2374,6 +2380,9 @@ int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr,
rth->rt_mark == skb->mark &&
net_eq(dev_net(rth->dst.dev), net) &&
!rt_is_expired(rth)) {
+ rth = ipv4_validate_peer(rth);
+ if (!rth)
+ continue;
if (noref) {
dst_use_noref(&rth->dst, jiffies);
skb_dst_set_noref(skb, &rth->dst);
@@ -2749,6 +2758,9 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *flp4)
(IPTOS_RT_MASK | RTO_ONLINK)) &&
net_eq(dev_net(rth->dst.dev), net) &&
!rt_is_expired(rth)) {
+ rth = ipv4_validate_peer(rth);
+ if (!rth)
+ continue;
dst_use(&rth->dst, jiffies);
RT_CACHE_STAT_INC(out_hit);
rcu_read_unlock_bh();
--
1.7.7.3
next prev parent reply other threads:[~2011-12-01 18:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 11:08 [PATCH net 0/4] ipv4: various pmtu discovery fixes Steffen Klassert
2011-10-11 11:09 ` [PATCH 1/4] ipv4: Fix pmtu propagating Steffen Klassert
2011-10-12 21:02 ` David Miller
2011-10-13 10:09 ` Steffen Klassert
2011-10-13 17:58 ` David Miller
2011-10-14 5:54 ` Steffen Klassert
2011-10-17 12:18 ` Steffen Klassert
2011-10-19 9:07 ` Gao feng
2011-10-19 19:32 ` David Miller
2011-11-08 19:19 ` David Miller
2011-11-08 19:33 ` David Miller
2011-11-09 12:08 ` Steffen Klassert
2011-11-21 7:56 ` Steffen Klassert
2011-12-01 18:40 ` David Miller [this message]
2011-10-11 11:10 ` [PATCH 2/4] ipv4: Update pmtu informations on inetpeer only for output routes Steffen Klassert
2011-10-12 21:08 ` David Miller
2011-10-14 6:34 ` Steffen Klassert
2011-11-08 19:36 ` David Miller
2011-11-09 12:11 ` Steffen Klassert
2011-11-14 10:12 ` Steffen Klassert
2011-11-14 19:33 ` David Miller
2011-11-15 10:00 ` Steffen Klassert
2011-11-22 13:20 ` Steffen Klassert
2011-10-11 11:11 ` [PATCH 3/4] ipv4: Fix inetpeer expiration handling Steffen Klassert
2011-10-20 6:24 ` Gao feng
2011-11-08 19:38 ` David Miller
2011-11-09 12:47 ` Steffen Klassert
2011-10-11 11:12 ` [PATCH 4/4] ipv4: Fix inetpeer expire time information Steffen Klassert
2011-10-11 19:54 ` [PATCH net 0/4] ipv4: various pmtu discovery fixes David Miller
2011-11-08 19:41 ` 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=20111201.134045.1083297991862286043.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=gaofeng@cn.fujitsu.com \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.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).