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.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 5a900ddcf10d..ce078cda6b74 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;
@@ -84,8 +83,6 @@ struct dst_entry
84 * (L1_CACHE_SIZE would be too much) 83 * (L1_CACHE_SIZE would be too much)
85 */ 84 */
86#ifdef CONFIG_64BIT 85#ifdef CONFIG_64BIT
87 long __pad_to_align_refcnt[2];
88#else
89 long __pad_to_align_refcnt[1]; 86 long __pad_to_align_refcnt[1];
90#endif 87#endif
91 /* 88 /*
@@ -111,6 +108,12 @@ dst_metric(const struct dst_entry *dst, int metric)
111 return dst->metrics[metric-1]; 108 return dst->metrics[metric-1];
112} 109}
113 110
111static inline u32
112dst_feature(const struct dst_entry *dst, u32 feature)
113{
114 return dst_metric(dst, RTAX_FEATURES) & feature;
115}
116
114static inline u32 dst_mtu(const struct dst_entry *dst) 117static inline u32 dst_mtu(const struct dst_entry *dst)
115{ 118{
116 u32 mtu = dst_metric(dst, RTAX_MTU); 119 u32 mtu = dst_metric(dst, RTAX_MTU);
@@ -136,7 +139,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
136static inline u32 139static inline u32
137dst_allfrag(const struct dst_entry *dst) 140dst_allfrag(const struct dst_entry *dst)
138{ 141{
139 int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; 142 int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG);
140 /* Yes, _exactly_. This is paranoia. */ 143 /* Yes, _exactly_. This is paranoia. */
141 barrier(); 144 barrier();
142 return ret; 145 return ret;
@@ -222,11 +225,19 @@ static inline void dst_confirm(struct dst_entry *dst)
222 neigh_confirm(dst->neighbour); 225 neigh_confirm(dst->neighbour);
223} 226}
224 227
225static inline void dst_negative_advice(struct dst_entry **dst_p) 228static inline void dst_negative_advice(struct dst_entry **dst_p,
229 struct sock *sk)
226{ 230{
227 struct dst_entry * dst = *dst_p; 231 struct dst_entry * dst = *dst_p;
228 if (dst && dst->ops->negative_advice) 232 if (dst && dst->ops->negative_advice) {
229 *dst_p = dst->ops->negative_advice(dst); 233 *dst_p = dst->ops->negative_advice(dst);
234
235 if (dst != *dst_p) {
236 extern void sk_reset_txq(struct sock *sk);
237
238 sk_reset_txq(sk);
239 }
240 }
230} 241}
231 242
232static inline void dst_link_failure(struct sk_buff *skb) 243static inline void dst_link_failure(struct sk_buff *skb)