]> git.baikalelectronics.ru Git - kernel.git/commit
route: update fnhe_expires for redirect when the fnhe exists
authorXin Long <lucien.xin@gmail.com>
Fri, 17 Nov 2017 06:27:06 +0000 (14:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Nov 2017 01:32:41 +0000 (10:32 +0900)
commita10eec635cf362279a485e1c337aef8ee12644b4
tree2e3933acfc0942755425f2bb8ae1b9aa9d54c991
parentae8a52f639cd865243810873ed38f46eb9d5f952
route: update fnhe_expires for redirect when the fnhe exists

Now when creating fnhe for redirect, it sets fnhe_expires for this
new route cache. But when updating the exist one, it doesn't do it.
It will cause this fnhe never to be expired.

Paolo already noticed it before, in Jianlin's test case, it became
even worse:

When ip route flush cache, the old fnhe is not to be removed, but
only clean it's members. When redirect comes again, this fnhe will
be found and updated, but never be expired due to fnhe_expires not
being set.

So fix it by simply updating fnhe_expires even it's for redirect.

Fixes: 69909d91bfcf ("ipv4: use seqlock for nh_exceptions")
Reported-by: Jianlin Shi <jishi@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c