aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 5a900ddcf10d..387cb3cfde7e 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -36,8 +36,7 @@
36 36
37struct sk_buff; 37struct sk_buff;
38 38
39struct dst_entry 39struct dst_entry {
40{
41 struct rcu_head rcu_head; 40 struct rcu_head rcu_head;
42 struct dst_entry *child; 41 struct dst_entry *child;
43 struct net_device *dev; 42 struct net_device *dev;
@@ -111,6 +110,12 @@ dst_metric(const struct dst_entry *dst, int metric)
111 return dst->metrics[metric-1]; 110 return dst->metrics[metric-1];
112} 111}
113 112
113static inline u32
114dst_feature(const struct dst_entry *dst, u32 feature)
115{
116 return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0);
117}
118
114static inline u32 dst_mtu(const struct dst_entry *dst) 119static inline u32 dst_mtu(const struct dst_entry *dst)
115{ 120{
116 u32 mtu = dst_metric(dst, RTAX_MTU); 121 u32 mtu = dst_metric(dst, RTAX_MTU);
@@ -136,7 +141,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
136static inline u32 141static inline u32
137dst_allfrag(const struct dst_entry *dst) 142dst_allfrag(const struct dst_entry *dst)
138{ 143{
139 int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; 144 int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG);
140 /* Yes, _exactly_. This is paranoia. */ 145 /* Yes, _exactly_. This is paranoia. */
141 barrier(); 146 barrier();
142 return ret; 147 return ret;
@@ -222,11 +227,19 @@ static inline void dst_confirm(struct dst_entry *dst)
222 neigh_confirm(dst->neighbour); 227 neigh_confirm(dst->neighbour);
223} 228}
224 229
225static inline void dst_negative_advice(struct dst_entry **dst_p) 230static inline void dst_negative_advice(struct dst_entry **dst_p,
231 struct sock *sk)
226{ 232{
227 struct dst_entry * dst = *dst_p; 233 struct dst_entry * dst = *dst_p;
228 if (dst && dst->ops->negative_advice) 234 if (dst && dst->ops->negative_advice) {
229 *dst_p = dst->ops->negative_advice(dst); 235 *dst_p = dst->ops->negative_advice(dst);
236
237 if (dst != *dst_p) {
238 extern void sk_reset_txq(struct sock *sk);
239
240 sk_reset_txq(sk);
241 }
242 }
230} 243}
231 244
232static inline void dst_link_failure(struct sk_buff *skb) 245static inline void dst_link_failure(struct sk_buff *skb)