.. | .. |
---|
19 | 19 | #include <net/neighbour.h> |
---|
20 | 20 | #include <asm/processor.h> |
---|
21 | 21 | |
---|
22 | | -#define DST_GC_MIN (HZ/10) |
---|
23 | | -#define DST_GC_INC (HZ/2) |
---|
24 | | -#define DST_GC_MAX (120*HZ) |
---|
25 | | - |
---|
26 | | -/* Each dst_entry has reference count and sits in some parent list(s). |
---|
27 | | - * When it is removed from parent list, it is "freed" (dst_free). |
---|
28 | | - * After this it enters dead state (dst->obsolete > 0) and if its refcnt |
---|
29 | | - * is zero, it can be destroyed immediately, otherwise it is added |
---|
30 | | - * to gc list and garbage collector periodically checks the refcnt. |
---|
31 | | - */ |
---|
32 | | - |
---|
33 | 22 | struct sk_buff; |
---|
34 | 23 | |
---|
35 | 24 | struct dst_entry { |
---|
.. | .. |
---|
46 | 35 | int (*output)(struct net *net, struct sock *sk, struct sk_buff *skb); |
---|
47 | 36 | |
---|
48 | 37 | unsigned short flags; |
---|
49 | | -#define DST_HOST 0x0001 |
---|
50 | 38 | #define DST_NOXFRM 0x0002 |
---|
51 | 39 | #define DST_NOPOLICY 0x0004 |
---|
52 | 40 | #define DST_NOCOUNT 0x0008 |
---|
.. | .. |
---|
194 | 182 | } |
---|
195 | 183 | |
---|
196 | 184 | /* Kernel-internal feature bits that are unallocated in user space. */ |
---|
197 | | -#define DST_FEATURE_ECN_CA (1 << 31) |
---|
| 185 | +#define DST_FEATURE_ECN_CA (1U << 31) |
---|
198 | 186 | |
---|
199 | 187 | #define DST_FEATURE_MASK (DST_FEATURE_ECN_CA) |
---|
200 | 188 | #define DST_FEATURE_ECN_MASK (DST_FEATURE_ECN_CA | RTAX_FEATURE_ECN) |
---|
.. | .. |
---|
226 | 214 | static inline int |
---|
227 | 215 | dst_metric_locked(const struct dst_entry *dst, int metric) |
---|
228 | 216 | { |
---|
229 | | - return dst_metric(dst, RTAX_LOCK) & (1<<metric); |
---|
| 217 | + return dst_metric(dst, RTAX_LOCK) & (1 << metric); |
---|
230 | 218 | } |
---|
231 | 219 | |
---|
232 | 220 | static inline void dst_hold(struct dst_entry *dst) |
---|
.. | .. |
---|
547 | 535 | dst->ops->update_pmtu(dst, NULL, skb, mtu, false); |
---|
548 | 536 | } |
---|
549 | 537 | |
---|
550 | | -static inline void skb_tunnel_check_pmtu(struct sk_buff *skb, |
---|
551 | | - struct dst_entry *encap_dst, |
---|
552 | | - int headroom) |
---|
553 | | -{ |
---|
554 | | - u32 encap_mtu = dst_mtu(encap_dst); |
---|
555 | | - |
---|
556 | | - if (skb->len > encap_mtu - headroom) |
---|
557 | | - skb_dst_update_pmtu_no_confirm(skb, encap_mtu - headroom); |
---|
558 | | -} |
---|
| 538 | +struct dst_entry *dst_blackhole_check(struct dst_entry *dst, u32 cookie); |
---|
| 539 | +void dst_blackhole_update_pmtu(struct dst_entry *dst, struct sock *sk, |
---|
| 540 | + struct sk_buff *skb, u32 mtu, bool confirm_neigh); |
---|
| 541 | +void dst_blackhole_redirect(struct dst_entry *dst, struct sock *sk, |
---|
| 542 | + struct sk_buff *skb); |
---|
| 543 | +u32 *dst_blackhole_cow_metrics(struct dst_entry *dst, unsigned long old); |
---|
| 544 | +struct neighbour *dst_blackhole_neigh_lookup(const struct dst_entry *dst, |
---|
| 545 | + struct sk_buff *skb, |
---|
| 546 | + const void *daddr); |
---|
| 547 | +unsigned int dst_blackhole_mtu(const struct dst_entry *dst); |
---|
559 | 548 | |
---|
560 | 549 | #endif /* _NET_DST_H */ |
---|