diff mbox

[net-next] net: ipmr/ip6mr: update lastuse on entry change

Message ID 1469550861-13032-1-git-send-email-nikolay@cumulusnetworks.com
State Superseded, archived
Headers show

Commit Message

Nikolay Aleksandrov July 26, 2016, 4:34 p.m. UTC
Currently lastuse is updated on entry creation and cache hit, but it should
also be updated on entry change.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: Donald Sharp <sharpd@cumulusnetworks.com>
CC: David S. Miller <davem@davemloft.net>
---
 net/ipv4/ipmr.c  | 1 +
 net/ipv6/ip6mr.c | 1 +
 2 files changed, 2 insertions(+)
diff mbox

Patch

diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index eec234161b89..8f032428c14c 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1135,6 +1135,7 @@  static int ipmr_mfc_add(struct net *net, struct mr_table *mrt,
 		if (!mrtsock)
 			c->mfc_flags |= MFC_STATIC;
 		write_unlock_bh(&mrt_lock);
+		c->mfc_un.res.lastuse = jiffies;
 		mroute_netlink_event(mrt, c, RTM_NEWROUTE);
 		return 0;
 	}
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 7adce139d92a..45c5b30a3a8a 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1485,6 +1485,7 @@  static int ip6mr_mfc_add(struct net *net, struct mr6_table *mrt,
 		if (!mrtsock)
 			c->mfc_flags |= MFC_STATIC;
 		write_unlock_bh(&mrt_lock);
+		c->mfc_un.res.lastuse = jiffies;
 		mr6_netlink_event(mrt, c, RTM_NEWROUTE);
 		return 0;
 	}