aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@codefidence.com>2009-10-28 00:15:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-29 04:28:42 -0400
commit0c3adfb8ec9f85a63556b70f11e0fcf280545951 (patch)
tree20e23bfa4fb94e7eb9f8e4128e493eaf83b2dbd0 /include/net
parent022c3f7d82f0f1c68018696f2f027b87b9bb45c2 (diff)
Add dst_feature to query route entry features
Adding an accessor to existing dst_entry feautres field and refactor the only supported feature (allfrag) to use it. Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com> Sigend-off-by: Ori Finkelman <ori@comsleep.com> Sigend-off-by: Yony Amit <yony@comsleep.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dst.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 720d90653a8e..6377ab2feba9 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -111,6 +111,12 @@ dst_metric(const struct dst_entry *dst, int metric)
111 return dst->metrics[metric-1]; 111 return dst->metrics[metric-1];
112} 112}
113 113
114static inline u32
115dst_feature(const struct dst_entry *dst, u32 feature)
116{
117 return dst_metric(dst, RTAX_FEATURES) & feature;
118}
119
114static inline u32 dst_mtu(const struct dst_entry *dst) 120static inline u32 dst_mtu(const struct dst_entry *dst)
115{ 121{
116 u32 mtu = dst_metric(dst, RTAX_MTU); 122 u32 mtu = dst_metric(dst, RTAX_MTU);
@@ -136,7 +142,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
136static inline u32 142static inline u32
137dst_allfrag(const struct dst_entry *dst) 143dst_allfrag(const struct dst_entry *dst)
138{ 144{
139 int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; 145 int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG);
140 /* Yes, _exactly_. This is paranoia. */ 146 /* Yes, _exactly_. This is paranoia. */
141 barrier(); 147 barrier();
142 return ret; 148 return ret;