]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/net/ipv6.h
netfilter: uapi: Avoid undefined left-shift in xt_sctp.h
[mirror_ubuntu-bionic-kernel.git] / include / net / ipv6.h
index f73797e2fa60c51a81c8d7a0e231bd2be0137119..ef776212cae2394b81aadd99da8c6bc7f7a8651c 100644 (file)
@@ -331,6 +331,7 @@ int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
                           int flags);
 int ip6_flowlabel_init(void);
 void ip6_flowlabel_cleanup(void);
+bool ip6_autoflowlabel(struct net *net, const struct ipv6_pinfo *np);
 
 static inline void fl6_sock_release(struct ip6_flowlabel *fl)
 {
@@ -352,14 +353,7 @@ struct ipv6_txoptions *ipv6_dup_options(struct sock *sk,
 struct ipv6_txoptions *ipv6_renew_options(struct sock *sk,
                                          struct ipv6_txoptions *opt,
                                          int newtype,
-                                         struct ipv6_opt_hdr __user *newopt,
-                                         int newoptlen);
-struct ipv6_txoptions *
-ipv6_renew_options_kern(struct sock *sk,
-                       struct ipv6_txoptions *opt,
-                       int newtype,
-                       struct ipv6_opt_hdr *newopt,
-                       int newoptlen);
+                                         struct ipv6_opt_hdr *newopt);
 struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
                                          struct ipv6_txoptions *opt);
 
@@ -377,15 +371,8 @@ static inline bool ipv6_accept_ra(struct inet6_dev *idev)
            idev->cnf.accept_ra;
 }
 
-#if IS_ENABLED(CONFIG_IPV6)
-static inline int ip6_frag_mem(struct net *net)
-{
-       return sum_frag_mem_limit(&net->ipv6.frags);
-}
-#endif
-
-#define IPV6_FRAG_HIGH_THRESH  (4 * 1024*1024) /* 4194304 */
-#define IPV6_FRAG_LOW_THRESH   (3 * 1024*1024) /* 3145728 */
+#define IPV6_FRAG_HIGH_THRESH  (256 * 1024)    /* 262144 */
+#define IPV6_FRAG_LOW_THRESH   (192 * 1024)    /* 196608 */
 #define IPV6_FRAG_TIMEOUT      (60 * HZ)       /* 60 seconds */
 
 int __ipv6_addr_type(const struct in6_addr *addr);
@@ -565,50 +552,6 @@ static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,
 }
 #endif
 
-struct inet_frag_queue;
-
-enum ip6_defrag_users {
-       IP6_DEFRAG_LOCAL_DELIVER,
-       IP6_DEFRAG_CONNTRACK_IN,
-       __IP6_DEFRAG_CONNTRACK_IN       = IP6_DEFRAG_CONNTRACK_IN + USHRT_MAX,
-       IP6_DEFRAG_CONNTRACK_OUT,
-       __IP6_DEFRAG_CONNTRACK_OUT      = IP6_DEFRAG_CONNTRACK_OUT + USHRT_MAX,
-       IP6_DEFRAG_CONNTRACK_BRIDGE_IN,
-       __IP6_DEFRAG_CONNTRACK_BRIDGE_IN = IP6_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX,
-};
-
-struct ip6_create_arg {
-       __be32 id;
-       u32 user;
-       const struct in6_addr *src;
-       const struct in6_addr *dst;
-       int iif;
-       u8 ecn;
-};
-
-void ip6_frag_init(struct inet_frag_queue *q, const void *a);
-bool ip6_frag_match(const struct inet_frag_queue *q, const void *a);
-
-/*
- *     Equivalent of ipv4 struct ip
- */
-struct frag_queue {
-       struct inet_frag_queue  q;
-
-       __be32                  id;             /* fragment id          */
-       u32                     user;
-       struct in6_addr         saddr;
-       struct in6_addr         daddr;
-
-       int                     iif;
-       unsigned int            csum;
-       __u16                   nhoffset;
-       u8                      ecn;
-};
-
-void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq,
-                          struct inet_frags *frags);
-
 static inline bool ipv6_addr_any(const struct in6_addr *a)
 {
 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
@@ -834,7 +777,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
         * to minimize possbility that any useful information to an
         * attacker is leaked. Only lower 20 bits are relevant.
         */
-       rol32(hash, 16);
+       hash = rol32(hash, 16);
 
        flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK;
 
@@ -900,6 +843,11 @@ static inline __be32 ip6_make_flowinfo(unsigned int tclass, __be32 flowlabel)
        return htonl(tclass << IPV6_TCLASS_SHIFT) | flowlabel;
 }
 
+static inline __be32 flowi6_get_flowlabel(const struct flowi6 *fl6)
+{
+       return fl6->flowlabel & IPV6_FLOWLABEL_MASK;
+}
+
 /*
  *     Prototypes exported by ipv6
  */