Currently lastuse is updated on entry creation and cache hit, but it should
also be updated on entry change.

Signed-off-by: Nikolay Aleksandrov <niko...@cumulusnetworks.com>
CC: Roopa Prabhu <ro...@cumulusnetworks.com>
CC: Donald Sharp <sha...@cumulusnetworks.com>
CC: David S. Miller <da...@davemloft.net>
---
 net/ipv4/ipmr.c  | 1 +
 net/ipv6/ip6mr.c | 1 +
 2 files changed, 2 insertions(+)

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;
        }
-- 
2.1.4

Reply via email to