hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/include/net/dst.h
....@@ -19,17 +19,6 @@
1919 #include <net/neighbour.h>
2020 #include <asm/processor.h>
2121
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
-
3322 struct sk_buff;
3423
3524 struct dst_entry {
....@@ -46,7 +35,6 @@
4635 int (*output)(struct net *net, struct sock *sk, struct sk_buff *skb);
4736
4837 unsigned short flags;
49
-#define DST_HOST 0x0001
5038 #define DST_NOXFRM 0x0002
5139 #define DST_NOPOLICY 0x0004
5240 #define DST_NOCOUNT 0x0008
....@@ -194,7 +182,7 @@
194182 }
195183
196184 /* 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)
198186
199187 #define DST_FEATURE_MASK (DST_FEATURE_ECN_CA)
200188 #define DST_FEATURE_ECN_MASK (DST_FEATURE_ECN_CA | RTAX_FEATURE_ECN)
....@@ -226,7 +214,7 @@
226214 static inline int
227215 dst_metric_locked(const struct dst_entry *dst, int metric)
228216 {
229
- return dst_metric(dst, RTAX_LOCK) & (1<<metric);
217
+ return dst_metric(dst, RTAX_LOCK) & (1 << metric);
230218 }
231219
232220 static inline void dst_hold(struct dst_entry *dst)
....@@ -547,14 +535,15 @@
547535 dst->ops->update_pmtu(dst, NULL, skb, mtu, false);
548536 }
549537
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);
559548
560549 #endif /* _NET_DST_H */