diff options
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 0cb4d9e53a07..e76539a5eb5e 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -212,6 +212,26 @@ nla_put_failure: | |||
212 | return nla_nest_cancel(skb, mx); | 212 | return nla_nest_cancel(skb, mx); |
213 | } | 213 | } |
214 | 214 | ||
215 | int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id, | ||
216 | u32 ts, u32 tsage, long expires, u32 error) | ||
217 | { | ||
218 | struct rta_cacheinfo ci = { | ||
219 | .rta_lastuse = jiffies_to_clock_t(jiffies - dst->lastuse), | ||
220 | .rta_used = dst->__use, | ||
221 | .rta_clntref = atomic_read(&(dst->__refcnt)), | ||
222 | .rta_error = error, | ||
223 | .rta_id = id, | ||
224 | .rta_ts = ts, | ||
225 | .rta_tsage = tsage, | ||
226 | }; | ||
227 | |||
228 | if (expires) | ||
229 | ci.rta_expires = jiffies_to_clock_t(expires); | ||
230 | |||
231 | return nla_put(skb, RTA_CACHEINFO, sizeof(ci), &ci); | ||
232 | } | ||
233 | |||
234 | EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo); | ||
215 | 235 | ||
216 | static void set_operstate(struct net_device *dev, unsigned char transition) | 236 | static void set_operstate(struct net_device *dev, unsigned char transition) |
217 | { | 237 | { |