diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-13 00:35:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-13 00:35:57 -0500 |
commit | 5170ae824ddf1988a63fb12cbedcff817634c444 (patch) | |
tree | 9f1619ca6edd0e8078bfcd9d6123e119b935e43b /include | |
parent | abbf46ae0e4954584eac599bec73502c1c805e9e (diff) |
net: Abstract RTAX_HOPLIMIT metric accesses behind helper.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-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 { | |||
104 | #ifdef __KERNEL__ | 104 | #ifdef __KERNEL__ |
105 | 105 | ||
106 | static inline u32 | 106 | static inline u32 |
107 | dst_metric(const struct dst_entry *dst, int metric) | 107 | dst_metric_raw(const struct dst_entry *dst, const int metric) |
108 | { | 108 | { |
109 | return dst->_metrics[metric-1]; | 109 | return dst->_metrics[metric-1]; |
110 | } | 110 | } |
111 | 111 | ||
112 | static inline u32 | ||
113 | dst_metric(const struct dst_entry *dst, const int metric) | ||
114 | { | ||
115 | WARN_ON_ONCE(metric == RTAX_HOPLIMIT); | ||
116 | return dst_metric_raw(dst, metric); | ||
117 | } | ||
118 | |||
119 | static inline u32 | ||
120 | dst_metric_hoplimit(const struct dst_entry *dst) | ||
121 | { | ||
122 | return dst_metric_raw(dst, RTAX_HOPLIMIT); | ||
123 | } | ||
124 | |||
112 | static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val) | 125 | static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val) |
113 | { | 126 | { |
114 | dst->_metrics[metric-1] = val; | 127 | dst->_metrics[metric-1] = val; |