Commit 0c3adfb8 authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by David S. Miller

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: default avatarGilad Ben-Yossef <gilad@codefidence.com>
Sigend-off-by: default avatarOri Finkelman <ori@comsleep.com>
Sigend-off-by: default avatarYony Amit <yony@comsleep.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 022c3f7d
...@@ -111,6 +111,12 @@ dst_metric(const struct dst_entry *dst, int metric) ...@@ -111,6 +111,12 @@ dst_metric(const struct dst_entry *dst, int metric)
return dst->metrics[metric-1]; return dst->metrics[metric-1];
} }
static inline u32
dst_feature(const struct dst_entry *dst, u32 feature)
{
return dst_metric(dst, RTAX_FEATURES) & feature;
}
static inline u32 dst_mtu(const struct dst_entry *dst) static inline u32 dst_mtu(const struct dst_entry *dst)
{ {
u32 mtu = dst_metric(dst, RTAX_MTU); u32 mtu = dst_metric(dst, RTAX_MTU);
...@@ -136,7 +142,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, ...@@ -136,7 +142,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
static inline u32 static inline u32
dst_allfrag(const struct dst_entry *dst) dst_allfrag(const struct dst_entry *dst)
{ {
int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG);
/* Yes, _exactly_. This is paranoia. */ /* Yes, _exactly_. This is paranoia. */
barrier(); barrier();
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment