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.h63
1 files changed, 31 insertions, 32 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8f73be494503..ff33f498c137 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -294,6 +294,7 @@ struct ipv6_fl_socklist {
294}; 294};
295 295
296struct ipcm6_cookie { 296struct ipcm6_cookie {
297 struct sockcm_cookie sockc;
297 __s16 hlimit; 298 __s16 hlimit;
298 __s16 tclass; 299 __s16 tclass;
299 __s8 dontfrag; 300 __s8 dontfrag;
@@ -301,6 +302,25 @@ struct ipcm6_cookie {
301 __u16 gso_size; 302 __u16 gso_size;
302}; 303};
303 304
305static inline void ipcm6_init(struct ipcm6_cookie *ipc6)
306{
307 *ipc6 = (struct ipcm6_cookie) {
308 .hlimit = -1,
309 .tclass = -1,
310 .dontfrag = -1,
311 };
312}
313
314static inline void ipcm6_init_sk(struct ipcm6_cookie *ipc6,
315 const struct ipv6_pinfo *np)
316{
317 *ipc6 = (struct ipcm6_cookie) {
318 .hlimit = -1,
319 .tclass = np->tclass,
320 .dontfrag = np->dontfrag,
321 };
322}
323
304static inline struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np) 324static inline struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np)
305{ 325{
306 struct ipv6_txoptions *opt; 326 struct ipv6_txoptions *opt;
@@ -554,34 +574,6 @@ static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,
554} 574}
555#endif 575#endif
556 576
557struct inet_frag_queue;
558
559enum ip6_defrag_users {
560 IP6_DEFRAG_LOCAL_DELIVER,
561 IP6_DEFRAG_CONNTRACK_IN,
562 __IP6_DEFRAG_CONNTRACK_IN = IP6_DEFRAG_CONNTRACK_IN + USHRT_MAX,
563 IP6_DEFRAG_CONNTRACK_OUT,
564 __IP6_DEFRAG_CONNTRACK_OUT = IP6_DEFRAG_CONNTRACK_OUT + USHRT_MAX,
565 IP6_DEFRAG_CONNTRACK_BRIDGE_IN,
566 __IP6_DEFRAG_CONNTRACK_BRIDGE_IN = IP6_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX,
567};
568
569void ip6_frag_init(struct inet_frag_queue *q, const void *a);
570extern const struct rhashtable_params ip6_rhash_params;
571
572/*
573 * Equivalent of ipv4 struct ip
574 */
575struct frag_queue {
576 struct inet_frag_queue q;
577
578 int iif;
579 __u16 nhoffset;
580 u8 ecn;
581};
582
583void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq);
584
585static inline bool ipv6_addr_any(const struct in6_addr *a) 577static inline bool ipv6_addr_any(const struct in6_addr *a)
586{ 578{
587#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 579#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
@@ -790,6 +782,13 @@ static inline void iph_to_flow_copy_v6addrs(struct flow_keys *flow,
790 782
791#if IS_ENABLED(CONFIG_IPV6) 783#if IS_ENABLED(CONFIG_IPV6)
792 784
785static inline bool ipv6_can_nonlocal_bind(struct net *net,
786 struct inet_sock *inet)
787{
788 return net->ipv6.sysctl.ip_nonlocal_bind ||
789 inet->freebind || inet->transparent;
790}
791
793/* Sysctl settings for net ipv6.auto_flowlabels */ 792/* Sysctl settings for net ipv6.auto_flowlabels */
794#define IP6_AUTO_FLOW_LABEL_OFF 0 793#define IP6_AUTO_FLOW_LABEL_OFF 0
795#define IP6_AUTO_FLOW_LABEL_OPTOUT 1 794#define IP6_AUTO_FLOW_LABEL_OPTOUT 1
@@ -915,6 +914,8 @@ static inline __be32 flowi6_get_flowlabel(const struct flowi6 *fl6)
915 914
916int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, 915int ipv6_rcv(struct sk_buff *skb, struct net_device *dev,
917 struct packet_type *pt, struct net_device *orig_dev); 916 struct packet_type *pt, struct net_device *orig_dev);
917void ipv6_list_rcv(struct list_head *head, struct packet_type *pt,
918 struct net_device *orig_dev);
918 919
919int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb); 920int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
920 921
@@ -931,8 +932,7 @@ int ip6_append_data(struct sock *sk,
931 int odd, struct sk_buff *skb), 932 int odd, struct sk_buff *skb),
932 void *from, int length, int transhdrlen, 933 void *from, int length, int transhdrlen,
933 struct ipcm6_cookie *ipc6, struct flowi6 *fl6, 934 struct ipcm6_cookie *ipc6, struct flowi6 *fl6,
934 struct rt6_info *rt, unsigned int flags, 935 struct rt6_info *rt, unsigned int flags);
935 const struct sockcm_cookie *sockc);
936 936
937int ip6_push_pending_frames(struct sock *sk); 937int ip6_push_pending_frames(struct sock *sk);
938 938
@@ -949,8 +949,7 @@ struct sk_buff *ip6_make_skb(struct sock *sk,
949 void *from, int length, int transhdrlen, 949 void *from, int length, int transhdrlen,
950 struct ipcm6_cookie *ipc6, struct flowi6 *fl6, 950 struct ipcm6_cookie *ipc6, struct flowi6 *fl6,
951 struct rt6_info *rt, unsigned int flags, 951 struct rt6_info *rt, unsigned int flags,
952 struct inet_cork_full *cork, 952 struct inet_cork_full *cork);
953 const struct sockcm_cookie *sockc);
954 953
955static inline struct sk_buff *ip6_finish_skb(struct sock *sk) 954static inline struct sk_buff *ip6_finish_skb(struct sock *sk)
956{ 955{