diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-09-30 08:54:46 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-30 08:54:46 (GMT) |
commit | 0b429e18c284af3e7a39f8ec44d95116c473fef8 (patch) | |
tree | 7957f57dc70c95a32f71896c9a526ca88b5517ad /net/ipv6/ip6mr.c | |
parent | d32cdbfb0ba319e44f75437afde868f7cafdc467 (diff) | |
parent | 53061afee43bc5041b67a45b6d793e7afdcf9ca7 (diff) | |
download | linux-0b429e18c284af3e7a39f8ec44d95116c473fef8.tar.xz |
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/ipv6/ip6mr.c')
-rw-r--r-- | net/ipv6/ip6mr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 6122f9c..fccb5dd 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -2239,6 +2239,7 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, struct rta_mfc_stats mfcs; struct nlattr *mp_attr; struct rtnexthop *nhp; + unsigned long lastuse; int ct; /* If cache is unresolved, don't try to parse IIF and OIF */ @@ -2269,12 +2270,14 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, nla_nest_end(skb, mp_attr); + lastuse = READ_ONCE(c->mfc_un.res.lastuse); + lastuse = time_after_eq(jiffies, lastuse) ? jiffies - lastuse : 0; + mfcs.mfcs_packets = c->mfc_un.res.pkt; mfcs.mfcs_bytes = c->mfc_un.res.bytes; mfcs.mfcs_wrong_if = c->mfc_un.res.wrong_if; if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) || - nla_put_u64_64bit(skb, RTA_EXPIRES, - jiffies_to_clock_t(c->mfc_un.res.lastuse), + nla_put_u64_64bit(skb, RTA_EXPIRES, jiffies_to_clock_t(lastuse), RTA_PAD)) return -EMSGSIZE; |