Skip to content

Commit 59ce967

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains the first batch of Netfilter updates for the upcoming 4.5 kernel. This batch contains userspace netfilter header compilation fixes, support for packet mangling in nf_tables, the new tracing infrastructure for nf_tables and cgroup2 support for iptables. More specifically, they are: 1) Two patches to include dependencies in our netfilter userspace headers to resolve compilation problems, from Mikko Rapeli. 2) Four comestic cleanup patches for the ebtables codebase, from Ian Morris. 3) Remove duplicate include in the netfilter reject infrastructure, from Stephen Hemminger. 4) Two patches to simplify the netfilter defragmentation code for IPv6, patch from Florian Westphal. 5) Fix root ownership of /proc/net netfilter for unpriviledged net namespaces, from Philip Whineray. 6) Get rid of unused fields in struct nft_pktinfo, from Florian Westphal. 7) Add mangling support to our nf_tables payload expression, from Patrick McHardy. 8) Introduce a new netlink-based tracing infrastructure for nf_tables, from Florian Westphal. 9) Change setter functions in nfnetlink_log to be void, from Rami Rosen. 10) Add netns support to the cttimeout infrastructure. 11) Add cgroup2 support to iptables, from Tejun Heo. 12) Introduce nfnl_dereference_protected() in nfnetlink, from Florian. 13) Add support for mangling pkttype in the nf_tables meta expression, also from Florian. BTW, I need that you pull net into net-next, I have another batch that requires changes that I don't yet see in net. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4b402d7 + b4aae75 commit 59ce967

66 files changed

Lines changed: 1062 additions & 342 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ifndef _NF_CONNTRACK_SCTP_H
2+
#define _NF_CONNTRACK_SCTP_H
3+
/* SCTP tracking. */
4+
5+
#include <uapi/linux/netfilter/nf_conntrack_sctp.h>
6+
7+
struct ip_ct_sctp {
8+
enum sctp_conntrack state;
9+
10+
__be32 vtag[IP_CT_DIR_MAX];
11+
};
12+
13+
#endif /* _NF_CONNTRACK_SCTP_H */

‎include/net/net_namespace.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ struct net {
121121
#if IS_ENABLED(CONFIG_NETFILTER_NETLINK_ACCT)
122122
struct list_head nfnl_acct_list;
123123
#endif
124+
#if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT)
125+
struct list_head nfct_timeout_list;
126+
#endif
124127
#endif
125128
#ifdef CONFIG_WEXT_CORE
126129
struct sk_buff_head wext_nlevents;

‎include/net/netfilter/ipv6/nf_defrag_ipv6.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ void nf_defrag_ipv6_enable(void);
55

66
int nf_ct_frag6_init(void);
77
void nf_ct_frag6_cleanup(void);
8-
struct sk_buff *nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user);
9-
void nf_ct_frag6_consume_orig(struct sk_buff *skb);
8+
int nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user);
109

1110
struct inet_frags_ctl;
1211

‎include/net/netfilter/nf_conntrack_timeout.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static inline void nf_conntrack_timeout_fini(void)
104104
#endif /* CONFIG_NF_CONNTRACK_TIMEOUT */
105105

106106
#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
107-
extern struct ctnl_timeout *(*nf_ct_timeout_find_get_hook)(const char *name);
107+
extern struct ctnl_timeout *(*nf_ct_timeout_find_get_hook)(struct net *net, const char *name);
108108
extern void (*nf_ct_timeout_put_hook)(struct ctnl_timeout *timeout);
109109
#endif
110110

‎include/net/netfilter/nf_tables.h‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ struct nft_pktinfo {
1919
const struct net_device *out;
2020
u8 pf;
2121
u8 hook;
22-
u8 nhoff;
23-
u8 thoff;
2422
u8 tprot;
2523
/* for x_tables compatibility */
2624
struct xt_action_param xt;
@@ -890,6 +888,38 @@ void nft_unregister_chain_type(const struct nf_chain_type *);
890888
int nft_register_expr(struct nft_expr_type *);
891889
void nft_unregister_expr(struct nft_expr_type *);
892890

891+
int nft_verdict_dump(struct sk_buff *skb, int type,
892+
const struct nft_verdict *v);
893+
894+
/**
895+
* struct nft_traceinfo - nft tracing information and state
896+
*
897+
* @pkt: pktinfo currently processed
898+
* @basechain: base chain currently processed
899+
* @chain: chain currently processed
900+
* @rule: rule that was evaluated
901+
* @verdict: verdict given by rule
902+
* @type: event type (enum nft_trace_types)
903+
* @packet_dumped: packet headers sent in a previous traceinfo message
904+
* @trace: other struct members are initialised
905+
*/
906+
struct nft_traceinfo {
907+
const struct nft_pktinfo *pkt;
908+
const struct nft_base_chain *basechain;
909+
const struct nft_chain *chain;
910+
const struct nft_rule *rule;
911+
const struct nft_verdict *verdict;
912+
enum nft_trace_types type;
913+
bool packet_dumped;
914+
bool trace;
915+
};
916+
917+
void nft_trace_init(struct nft_traceinfo *info, const struct nft_pktinfo *pkt,
918+
const struct nft_verdict *verdict,
919+
const struct nft_chain *basechain);
920+
921+
void nft_trace_notify(struct nft_traceinfo *info);
922+
893923
#define nft_dereference(p) \
894924
nfnl_dereference(p, NFNL_SUBSYS_NFTABLES)
895925

‎include/net/netfilter/nf_tables_core.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ struct nft_payload {
4747
enum nft_registers dreg:8;
4848
};
4949

50+
struct nft_payload_set {
51+
enum nft_payload_bases base:8;
52+
u8 offset;
53+
u8 len;
54+
enum nft_registers sreg:8;
55+
u8 csum_type;
56+
u8 csum_offset;
57+
};
58+
5059
extern const struct nft_expr_ops nft_payload_fast_ops;
60+
extern struct static_key_false nft_trace_enabled;
5161

5262
int nft_payload_module_init(void);
5363
void nft_payload_module_exit(void);

‎include/net/netfilter/nft_meta.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ void nft_meta_set_eval(const struct nft_expr *expr,
3333
struct nft_regs *regs,
3434
const struct nft_pktinfo *pkt);
3535

36+
void nft_meta_set_destroy(const struct nft_ctx *ctx,
37+
const struct nft_expr *expr);
38+
3639
#endif

‎include/uapi/linux/netfilter/ipset/ip_set_bitmap.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef _UAPI__IP_SET_BITMAP_H
22
#define _UAPI__IP_SET_BITMAP_H
33

4+
#include <linux/netfilter/ipset/ip_set.h>
5+
46
/* Bitmap type specific error codes */
57
enum {
68
/* The element is out of the range of the set */

‎include/uapi/linux/netfilter/ipset/ip_set_hash.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef _UAPI__IP_SET_HASH_H
22
#define _UAPI__IP_SET_HASH_H
33

4+
#include <linux/netfilter/ipset/ip_set.h>
5+
46
/* Hash type specific error codes */
57
enum {
68
/* Hash is full */

‎include/uapi/linux/netfilter/ipset/ip_set_list.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef _UAPI__IP_SET_LIST_H
22
#define _UAPI__IP_SET_LIST_H
33

4+
#include <linux/netfilter/ipset/ip_set.h>
5+
46
/* List type specific error codes */
57
enum {
68
/* Set name to be added/deleted/tested does not exist. */

0 commit comments

Comments
 (0)