diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-12 21:35:57 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-12 21:35:57 -0800 |
commit | 5170ae824ddf1988a63fb12cbedcff817634c444 (patch) | |
tree | 9f1619ca6edd0e8078bfcd9d6123e119b935e43b /include/net | |
parent | abbf46ae0e4954584eac599bec73502c1c805e9e (diff) | |
download | linux-5170ae824ddf1988a63fb12cbedcff817634c444.tar.gz linux-5170ae824ddf1988a63fb12cbedcff817634c444.tar.bz2 linux-5170ae824ddf1988a63fb12cbedcff817634c444.zip |
net: Abstract RTAX_HOPLIMIT metric accesses behind helper.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/dst.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index 85dee3a57b9b..9208b500aaaf 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -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; |