Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aac3833 authored by David S. Miller's avatar David S. Miller
Browse files


Pablo Neira Ayuso says:

====================
nf-next pull request

The following patchset contains Netfilter/IPVS updates for your
net-next tree. Regarding nf_tables, most updates focus on consolidating
the NAT infrastructure and adding support for masquerading. More
specifically, they are:

1) use __u8 instead of u_int8_t in arptables header, from
   Mike Frysinger.

2) Add support to match by skb->pkttype to the meta expression, from
   Ana Rey.

3) Add support to match by cpu to the meta expression, also from
   Ana Rey.

4) A smatch warning about IPSET_ATTR_MARKMASK validation, patch from
   Vytas Dauksa.

5) Fix netnet and netportnet hash types the range support for IPv4,
   from Sergey Popovich.

6) Fix missing-field-initializer warnings resolved, from Mark Rustad.

7) Dan Carperter reported possible integer overflows in ipset, from
   Jozsef Kadlecsick.

8) Filter out accounting objects in nfacct by type, so you can
   selectively reset quotas, from Alexey Perevalov.

9) Move specific NAT IPv4 functions to the core so x_tables and
   nf_tables can share the same NAT IPv4 engine.

10) Use the new NAT IPv4 functions from nft_chain_nat_ipv4.

11) Move specific NAT IPv6 functions to the core so x_tables and
    nf_tables can share the same NAT IPv4 engine.

12) Use the new NAT IPv6 functions from nft_chain_nat_ipv6.

13) Refactor code to add nft_delrule(), which can be reused in the
    enhancement of the NFT_MSG_DELTABLE to remove a table and its
    content, from Arturo Borrero.

14) Add a helper function to unregister chain hooks, from
    Arturo Borrero.

15) A cleanup to rename to nft_delrule_by_chain for consistency with
    the new nft_*() functions, also from Arturo.

16) Add support to match devgroup to the meta expression, from Ana Rey.

17) Reduce stack usage for IPVS socket option, from Julian Anastasov.

18) Remove unnecessary textsearch state initialization in xt_string,
    from Bojan Prtvar.

19) Add several helper functions to nf_tables, more work to prepare
    the enhancement of NFT_MSG_DELTABLE, again from Arturo Borrero.

20) Enhance NFT_MSG_DELTABLE to delete a table and its content, from
    Arturo Borrero.

21) Support NAT flags in the nat expression to indicate the flavour,
    eg. random fully, from Arturo.

22) Add missing audit code to ebtables when replacing tables, from
    Nicolas Dichtel.

23) Generalize the IPv4 masquerading code to allow its re-use from
    nf_tables, from Arturo.

24) Generalize the IPv6 masquerading code, also from Arturo.

25) Add the new masq expression to support IPv4/IPv6 masquerading
    from nf_tables, also from Arturo.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b167a37c 9ba1f726
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,5 +6,6 @@

#define IP_SET_LIST_DEFAULT_SIZE	8
#define IP_SET_LIST_MIN_SIZE		4
#define IP_SET_LIST_MAX_SIZE		65536

#endif /* __IP_SET_LIST_H */
+14 −0
Original line number Diff line number Diff line
#ifndef _NF_NAT_MASQUERADE_IPV4_H_
#define _NF_NAT_MASQUERADE_IPV4_H_

#include <net/netfilter/nf_nat.h>

unsigned int
nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum,
		       const struct nf_nat_range *range,
		       const struct net_device *out);

void nf_nat_masquerade_ipv4_register_notifier(void);
void nf_nat_masquerade_ipv4_unregister_notifier(void);

#endif /*_NF_NAT_MASQUERADE_IPV4_H_ */
+10 −0
Original line number Diff line number Diff line
#ifndef _NF_NAT_MASQUERADE_IPV6_H_
#define _NF_NAT_MASQUERADE_IPV6_H_

unsigned int
nf_nat_masquerade_ipv6(struct sk_buff *skb, const struct nf_nat_range *range,
		       const struct net_device *out);
void nf_nat_masquerade_ipv6_register_notifier(void);
void nf_nat_masquerade_ipv6_unregister_notifier(void);

#endif /* _NF_NAT_MASQUERADE_IPV6_H_ */
+75 −0
Original line number Diff line number Diff line
@@ -42,8 +42,83 @@ const struct nf_nat_l3proto *__nf_nat_l3proto_find(u8 l3proto);
int nf_nat_icmp_reply_translation(struct sk_buff *skb, struct nf_conn *ct,
				  enum ip_conntrack_info ctinfo,
				  unsigned int hooknum);

unsigned int nf_nat_ipv4_in(const struct nf_hook_ops *ops, struct sk_buff *skb,
			    const struct net_device *in,
			    const struct net_device *out,
			    unsigned int (*do_chain)(const struct nf_hook_ops *ops,
						     struct sk_buff *skb,
						     const struct net_device *in,
						     const struct net_device *out,
						     struct nf_conn *ct));

unsigned int nf_nat_ipv4_out(const struct nf_hook_ops *ops, struct sk_buff *skb,
			     const struct net_device *in,
			     const struct net_device *out,
			     unsigned int (*do_chain)(const struct nf_hook_ops *ops,
						      struct sk_buff *skb,
						      const struct net_device *in,
						      const struct net_device *out,
						      struct nf_conn *ct));

unsigned int nf_nat_ipv4_local_fn(const struct nf_hook_ops *ops,
				  struct sk_buff *skb,
				  const struct net_device *in,
				  const struct net_device *out,
				  unsigned int (*do_chain)(const struct nf_hook_ops *ops,
							   struct sk_buff *skb,
							   const struct net_device *in,
							   const struct net_device *out,
							   struct nf_conn *ct));

unsigned int nf_nat_ipv4_fn(const struct nf_hook_ops *ops, struct sk_buff *skb,
			    const struct net_device *in,
			    const struct net_device *out,
			    unsigned int (*do_chain)(const struct nf_hook_ops *ops,
						     struct sk_buff *skb,
						     const struct net_device *in,
						     const struct net_device *out,
						     struct nf_conn *ct));

int nf_nat_icmpv6_reply_translation(struct sk_buff *skb, struct nf_conn *ct,
				    enum ip_conntrack_info ctinfo,
				    unsigned int hooknum, unsigned int hdrlen);

unsigned int nf_nat_ipv6_in(const struct nf_hook_ops *ops, struct sk_buff *skb,
			    const struct net_device *in,
			    const struct net_device *out,
			    unsigned int (*do_chain)(const struct nf_hook_ops *ops,
						     struct sk_buff *skb,
						     const struct net_device *in,
						     const struct net_device *out,
						     struct nf_conn *ct));

unsigned int nf_nat_ipv6_out(const struct nf_hook_ops *ops, struct sk_buff *skb,
			     const struct net_device *in,
			     const struct net_device *out,
			     unsigned int (*do_chain)(const struct nf_hook_ops *ops,
						      struct sk_buff *skb,
						      const struct net_device *in,
						      const struct net_device *out,
						      struct nf_conn *ct));

unsigned int nf_nat_ipv6_local_fn(const struct nf_hook_ops *ops,
				  struct sk_buff *skb,
				  const struct net_device *in,
				  const struct net_device *out,
				  unsigned int (*do_chain)(const struct nf_hook_ops *ops,
							   struct sk_buff *skb,
							   const struct net_device *in,
							   const struct net_device *out,
							   struct nf_conn *ct));

unsigned int nf_nat_ipv6_fn(const struct nf_hook_ops *ops, struct sk_buff *skb,
			    const struct net_device *in,
			    const struct net_device *out,
			    unsigned int (*do_chain)(const struct nf_hook_ops *ops,
						     struct sk_buff *skb,
						     const struct net_device *in,
						     const struct net_device *out,
						     struct nf_conn *ct));

#endif /* _NF_NAT_L3PROTO_H */
+16 −0
Original line number Diff line number Diff line
#ifndef _NFT_MASQ_H_
#define _NFT_MASQ_H_

struct nft_masq {
	u32	flags;
};

extern const struct nla_policy nft_masq_policy[];

int nft_masq_init(const struct nft_ctx *ctx,
		  const struct nft_expr *expr,
		  const struct nlattr * const tb[]);

int nft_masq_dump(struct sk_buff *skb, const struct nft_expr *expr);

#endif /* _NFT_MASQ_H_ */
Loading