From: Steffen Klassert <steffen.klassert@secunet.com>
To: Julian Anastasov <ja@ssi.bg>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: Fix flushing of cached routing informations
Date: Thu, 18 Oct 2012 08:54:25 +0200 [thread overview]
Message-ID: <20121018065425.GC27385@secunet.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1210180927230.1572@ja.ssi.bg>
On Thu, Oct 18, 2012 at 09:52:37AM +0300, Julian Anastasov wrote:
>
> Hello,
>
> On Thu, 18 Oct 2012, Steffen Klassert wrote:
>
> > Currently we can not flush cached pmtu/redirect informations via
> > the ipv4_sysctl_rtcache_flush sysctl. We need to check the rt_genid
> > of the old route and reset the nh exeption if the old route is
> > expired when we bind a new route to a nh exeption.
> >
> > Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> > ---
> > net/ipv4/route.c | 16 ++++++++++------
> > 1 files changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> > index 432f4bb..defb98d 100644
> > --- a/net/ipv4/route.c
> > +++ b/net/ipv4/route.c
> > @@ -1163,8 +1163,17 @@ static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe,
> > spin_lock_bh(&fnhe_lock);
> >
> > if (daddr == fnhe->fnhe_daddr) {
> > - struct rtable *orig;
> > + struct rtable *orig = rcu_dereference(fnhe->fnhe_rth);
> > + rcu_assign_pointer(fnhe->fnhe_rth, rt);
>
> May be the above rcu_assign_pointer should be after
>
> ... if (!rt->rt_gateway)
> rt->rt_gateway = daddr;
>
> part. It is possible another __mkroute_output
> caller to get the cached fnhe->fnhe_rth without valid
> rt->rt_gateway. rcu_assign_pointer should be after all
> writes to rt.
Right, I'll send an updated version.
Thanks!
next prev parent reply other threads:[~2012-10-18 6:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 5:27 [PATCH] ipv4: Fix flushing of cached routing informations Steffen Klassert
2012-10-18 6:52 ` Julian Anastasov
2012-10-18 6:54 ` Steffen Klassert [this message]
2012-10-18 7:17 ` [PATCH v2] " Steffen Klassert
2012-10-18 7:40 ` Eric Dumazet
2012-10-18 19:35 ` 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=20121018065425.GC27385@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=ja@ssi.bg \
--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).