Date: Tue, 23 Jan 2018 03:15:44 +0000 (UTC) From: Ryan Stone <rstone@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328272 - head/sys/net Message-ID: <201801230315.w0N3FiAr007009@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rstone Date: Tue Jan 23 03:15:44 2018 New Revision: 328272 URL: https://svnweb.freebsd.org/changeset/base/328272 Log: Increment the route table gen count after a modify Increment the route table generation count after modifying a route. This signals back to TCP connections that they need to update their L2 caches as the gateway for their route may have changed. This is a heavier hammer than is needed, strictly speaking, but route changes will be unlikely enough that the performance effects of invalidating all connection route caches should be negligible. MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13990 Reviewed by: karels Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jan 23 03:15:39 2018 (r328271) +++ head/sys/net/route.c Tue Jan 23 03:15:44 2018 (r328272) @@ -1733,6 +1733,8 @@ rtrequest1_fib_change(struct rib_head *rnh, struct rt_ int family, mtu; struct if_mtuinfo ifmtu; + RIB_WLOCK_ASSERT(rnh); + rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], info->rti_info[RTAX_NETMASK], &rnh->head); @@ -1822,6 +1824,13 @@ rtrequest1_fib_change(struct rib_head *rnh, struct rt_ if_updatemtu_cb(rt->rt_nodes, &ifmtu); } } + + /* + * This route change may have modified the route's gateway. In that + * case, any inpcbs that have cached this route need to invalidate their + * llentry cache. + */ + rnh->rnh_gen++; if (ret_nrt) { *ret_nrt = rt;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801230315.w0N3FiAr007009>