aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index c8a202436e01..979bf6c13141 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -34,6 +34,7 @@
34#define NEXTHDR_IPV6 41 /* IPv6 in IPv6 */ 34#define NEXTHDR_IPV6 41 /* IPv6 in IPv6 */
35#define NEXTHDR_ROUTING 43 /* Routing header. */ 35#define NEXTHDR_ROUTING 43 /* Routing header. */
36#define NEXTHDR_FRAGMENT 44 /* Fragmentation/reassembly header. */ 36#define NEXTHDR_FRAGMENT 44 /* Fragmentation/reassembly header. */
37#define NEXTHDR_GRE 47 /* GRE header. */
37#define NEXTHDR_ESP 50 /* Encapsulating security payload. */ 38#define NEXTHDR_ESP 50 /* Encapsulating security payload. */
38#define NEXTHDR_AUTH 51 /* Authentication header. */ 39#define NEXTHDR_AUTH 51 /* Authentication header. */
39#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */ 40#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */
@@ -270,8 +271,17 @@ struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
270 271
271extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); 272extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb);
272 273
273int ip6_frag_nqueues(struct net *net); 274#if IS_ENABLED(CONFIG_IPV6)
274int ip6_frag_mem(struct net *net); 275static inline int ip6_frag_nqueues(struct net *net)
276{
277 return net->ipv6.frags.nqueues;
278}
279
280static inline int ip6_frag_mem(struct net *net)
281{
282 return atomic_read(&net->ipv6.frags.mem);
283}
284#endif
275 285
276#define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */ 286#define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */
277#define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */ 287#define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */
@@ -410,6 +420,25 @@ struct ip6_create_arg {
410void ip6_frag_init(struct inet_frag_queue *q, void *a); 420void ip6_frag_init(struct inet_frag_queue *q, void *a);
411bool ip6_frag_match(struct inet_frag_queue *q, void *a); 421bool ip6_frag_match(struct inet_frag_queue *q, void *a);
412 422
423/*
424 * Equivalent of ipv4 struct ip
425 */
426struct frag_queue {
427 struct inet_frag_queue q;
428
429 __be32 id; /* fragment id */
430 u32 user;
431 struct in6_addr saddr;
432 struct in6_addr daddr;
433
434 int iif;
435 unsigned int csum;
436 __u16 nhoffset;
437};
438
439void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq,
440 struct inet_frags *frags);
441
413static inline bool ipv6_addr_any(const struct in6_addr *a) 442static inline bool ipv6_addr_any(const struct in6_addr *a)
414{ 443{
415#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 444#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64