From: Gilad Ben-Yossef Date: Wed, 28 Oct 2009 04:15:23 +0000 (+0000) Subject: Add dst_feature to query route entry features X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0c3adfb8ec9f85a63556b70f11e0fcf280545951;p=linux-beck.git 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 Sigend-off-by: Ori Finkelman Sigend-off-by: Yony Amit Signed-off-by: David S. Miller --- 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) 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) { u32 mtu = dst_metric(dst, RTAX_MTU); @@ -136,7 +142,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, static inline u32 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. */ barrier(); return ret;