net: Abstract RTAX_HOPLIMIT metric accesses behind helper.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2010-12-12 21:35:57 -08:00
parent abbf46ae0e
commit 5170ae824d
8 changed files with 22 additions and 9 deletions

View File

@@ -104,11 +104,24 @@ struct dst_entry {
#ifdef __KERNEL__
static inline u32
dst_metric(const struct dst_entry *dst, int metric)
dst_metric_raw(const struct dst_entry *dst, const int metric)
{
return dst->_metrics[metric-1];
}
static inline u32
dst_metric(const struct dst_entry *dst, const int metric)
{
WARN_ON_ONCE(metric == RTAX_HOPLIMIT);
return dst_metric_raw(dst, metric);
}
static inline u32
dst_metric_hoplimit(const struct dst_entry *dst)
{
return dst_metric_raw(dst, RTAX_HOPLIMIT);
}
static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
{
dst->_metrics[metric-1] = val;