Skip to content

Commit ed77a89

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
Conflicts: net/netfilter/nf_conntrack_netlink.c
2 parents 475ad8e + d6e8cc6 commit ed77a89

40 files changed

Lines changed: 514 additions & 221 deletions

‎include/linux/netfilter_bridge/ebtables.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ struct ebt_table
300300

301301
#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \
302302
~(__alignof__(struct ebt_replace)-1))
303-
extern int ebt_register_table(struct ebt_table *table);
303+
extern struct ebt_table *ebt_register_table(struct net *net,
304+
struct ebt_table *table);
304305
extern void ebt_unregister_table(struct ebt_table *table);
305306
extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
306307
const struct net_device *in, const struct net_device *out,

‎include/linux/netfilter_ipv4/ipt_policy.h‎

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

4+
#include <linux/netfilter/xt_policy.h>
5+
46
#define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
57

68
/* ipt_policy_flags */

‎include/linux/netfilter_ipv6/ip6t_policy.h‎

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

4+
#include <linux/netfilter/xt_policy.h>
5+
46
#define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
57

68
/* ip6t_policy_flags */

‎include/net/netfilter/nf_conntrack.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ __nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple);
199199

200200
extern void nf_conntrack_hash_insert(struct nf_conn *ct);
201201

202-
extern void nf_conntrack_flush(struct net *net);
202+
extern void nf_conntrack_flush(struct net *net, u32 pid, int report);
203203

204204
extern bool nf_ct_get_tuplepr(const struct sk_buff *skb,
205205
unsigned int nhoff, u_int16_t l3num,
@@ -298,5 +298,8 @@ do { \
298298
local_bh_enable(); \
299299
} while (0)
300300

301+
#define MODULE_ALIAS_NFCT_HELPER(helper) \
302+
MODULE_ALIAS("nfct-helper-" helper)
303+
301304
#endif /* __KERNEL__ */
302305
#endif /* _NF_CONNTRACK_H */

‎include/net/netfilter/nf_conntrack_ecache.h‎

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ struct nf_conntrack_ecache {
1717
unsigned int events;
1818
};
1919

20+
/* This structure is passed to event handler */
21+
struct nf_ct_event {
22+
struct nf_conn *ct;
23+
u32 pid;
24+
int report;
25+
};
26+
2027
extern struct atomic_notifier_head nf_conntrack_chain;
2128
extern int nf_conntrack_register_notifier(struct notifier_block *nb);
2229
extern int nf_conntrack_unregister_notifier(struct notifier_block *nb);
@@ -39,22 +46,56 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
3946
local_bh_enable();
4047
}
4148

42-
static inline void nf_conntrack_event(enum ip_conntrack_events event,
43-
struct nf_conn *ct)
49+
static inline void
50+
nf_conntrack_event_report(enum ip_conntrack_events event,
51+
struct nf_conn *ct,
52+
u32 pid,
53+
int report)
4454
{
55+
struct nf_ct_event item = {
56+
.ct = ct,
57+
.pid = pid,
58+
.report = report
59+
};
4560
if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct))
46-
atomic_notifier_call_chain(&nf_conntrack_chain, event, ct);
61+
atomic_notifier_call_chain(&nf_conntrack_chain, event, &item);
4762
}
4863

64+
static inline void
65+
nf_conntrack_event(enum ip_conntrack_events event, struct nf_conn *ct)
66+
{
67+
nf_conntrack_event_report(event, ct, 0, 0);
68+
}
69+
70+
struct nf_exp_event {
71+
struct nf_conntrack_expect *exp;
72+
u32 pid;
73+
int report;
74+
};
75+
4976
extern struct atomic_notifier_head nf_ct_expect_chain;
5077
extern int nf_ct_expect_register_notifier(struct notifier_block *nb);
5178
extern int nf_ct_expect_unregister_notifier(struct notifier_block *nb);
5279

80+
static inline void
81+
nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
82+
struct nf_conntrack_expect *exp,
83+
u32 pid,
84+
int report)
85+
{
86+
struct nf_exp_event item = {
87+
.exp = exp,
88+
.pid = pid,
89+
.report = report
90+
};
91+
atomic_notifier_call_chain(&nf_ct_expect_chain, event, &item);
92+
}
93+
5394
static inline void
5495
nf_ct_expect_event(enum ip_conntrack_expect_events event,
5596
struct nf_conntrack_expect *exp)
5697
{
57-
atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp);
98+
nf_ct_expect_event_report(event, exp, 0, 0);
5899
}
59100

60101
extern int nf_conntrack_ecache_init(struct net *net);
@@ -66,9 +107,17 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
66107
struct nf_conn *ct) {}
67108
static inline void nf_conntrack_event(enum ip_conntrack_events event,
68109
struct nf_conn *ct) {}
110+
static inline void nf_conntrack_event_report(enum ip_conntrack_events event,
111+
struct nf_conn *ct,
112+
u32 pid,
113+
int report) {}
69114
static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
70115
static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event,
71116
struct nf_conntrack_expect *exp) {}
117+
static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e,
118+
struct nf_conntrack_expect *exp,
119+
u32 pid,
120+
int report) {}
72121
static inline void nf_ct_event_cache_flush(struct net *net) {}
73122

74123
static inline int nf_conntrack_ecache_init(struct net *net)

‎include/net/netfilter/nf_conntrack_expect.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, u_int8_t,
100100
u_int8_t, const __be16 *, const __be16 *);
101101
void nf_ct_expect_put(struct nf_conntrack_expect *exp);
102102
int nf_ct_expect_related(struct nf_conntrack_expect *expect);
103+
int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
104+
u32 pid, int report);
103105

104106
#endif /*_NF_CONNTRACK_EXPECT_H*/
105107

‎include/net/netfilter/nf_conntrack_helper.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ struct nf_conntrack_helper
3838
unsigned int expect_class_max;
3939
};
4040

41-
extern struct nf_conntrack_helper *
42-
__nf_ct_helper_find(const struct nf_conntrack_tuple *tuple);
43-
4441
extern struct nf_conntrack_helper *
4542
__nf_conntrack_helper_find_byname(const char *name);
4643

@@ -49,6 +46,8 @@ extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
4946

5047
extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp);
5148

49+
extern int __nf_ct_try_assign_helper(struct nf_conn *ct, gfp_t flags);
50+
5251
static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
5352
{
5453
return nf_ct_ext_find(ct, NF_CT_EXT_HELPER);

‎include/net/netfilter/nf_conntrack_l4proto.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ extern const struct nla_policy nf_ct_port_nla_policy[];
129129
&& net_ratelimit())
130130
#endif
131131
#else
132-
#define LOG_INVALID(net, proto) 0
132+
static inline int LOG_INVALID(struct net *net, int proto) { return 0; }
133133
#endif /* CONFIG_SYSCTL */
134134

135135
#endif /*_NF_CONNTRACK_PROTOCOL_H*/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef _KER_NFNETLINK_LOG_H
2+
#define _KER_NFNETLINK_LOG_H
3+
4+
void
5+
nfulnl_log_packet(u_int8_t pf,
6+
unsigned int hooknum,
7+
const struct sk_buff *skb,
8+
const struct net_device *in,
9+
const struct net_device *out,
10+
const struct nf_loginfo *li_user,
11+
const char *prefix);
12+
13+
#endif /* _KER_NFNETLINK_LOG_H */
14+

‎include/net/netns/x_tables.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
#include <linux/list.h>
55
#include <linux/netfilter.h>
66

7+
struct ebt_table;
8+
79
struct netns_xt {
810
struct list_head tables[NFPROTO_NUMPROTO];
11+
struct ebt_table *broute_table;
12+
struct ebt_table *frame_filter;
13+
struct ebt_table *frame_nat;
914
};
1015
#endif

0 commit comments

Comments
 (0)