summaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-06-20 05:02:19 +0000
committerDavid S. Miller <davem@davemloft.net>2012-06-22 21:47:33 -0700
commit7586eceb0abc0ea1c2b023e3e5d4dfd4ff40930a (patch)
tree79fc35a3afa23896ab3e6e00b4d9d1178bfee1df /net/ipv4/route.c
parent24ea818e305b92ad1fadcca015ae3b0c1222c497 (diff)
downloadlinux-7586eceb0abc0ea1c2b023e3e5d4dfd4ff40930a.tar.bz2
ipv4: tcp: dont cache output dst for syncookies
Don't cache output dst for syncookies, as this adds pressure on IP route cache and rcu subsystem for no gain. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Hans Schillstrom <hans.schillstrom@ericsson.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a91f6d33804c..8d62d85e68dc 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1156,7 +1156,7 @@ restart:
candp = NULL;
now = jiffies;
- if (!rt_caching(dev_net(rt->dst.dev))) {
+ if (!rt_caching(dev_net(rt->dst.dev)) || (rt->dst.flags & DST_NOCACHE)) {
/*
* If we're not caching, just tell the caller we
* were successful and don't touch the route. The
@@ -2582,6 +2582,9 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
rt_set_nexthop(rth, fl4, res, fi, type, 0);
+ if (fl4->flowi4_flags & FLOWI_FLAG_RT_NOCACHE)
+ rth->dst.flags |= DST_NOCACHE;
+
return rth;
}