Skip to content

Commit 27d9280

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 patches contains Netfilter updates for net-next: 1) .br_defrag indirection depends on CONFIG_NF_DEFRAG_IPV6, from wenxu. 2) Remove unnecessary memset() in ipset, from Florent Fourcot. 3) Merge control plane addition and deletion in ipset, also from Florent. 4) A few missing check for nla_parse() in ipset, from Aditya Pakki and Jozsef Kadlecsik. 5) Incorrect cleanup in error path of xt_set version 3, from Jozsef. 6) Memory accounting problems when resizing in ipset, from Stefano Brivio. 7) Jozsef updates his email to @netfilter.org, this batch comes with a conflict resolution with recent SPDX header updates. 8) Add to create custom conntrack expectations via nftables, from Stephane Veyret. 9) A lookup optimization for conntrack, from Florian Westphal. 10) Check for supported flags in xt_owner. 11) Support for pernet sysctl in br_netfilter, patches from Christian Brauner. 12) Patches to move common synproxy infrastructure to nf_synproxy.c, to prepare the synproxy support for nf_tables, patches from Fernando Fernandez Mancera. 13) Support to restore expiration time in set element, from Laura Garcia. 14) Fix recent rewrite of netfilter IPv6 to avoid indirections when CONFIG_IPV6 is unset, from Arnd Bergmann. 15) Always reset vlan tag on skbuff fraglist when refragmenting in bridge conntrack, from wenxu. 16) Support to match IPv4 options in nf_tables, from Stephen Suryaputra. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 045df37 + 1c5ba67 commit 27d9280

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1611
-1127
lines changed

CREDITS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ S: 2300 Copenhagen S.
18001800
S: Denmark
18011801

18021802
N: Jozsef Kadlecsik
1803-
E: kadlec@blackhole.kfki.hu
1803+
E: kadlec@netfilter.org
18041804
P: 1024D/470DB964 4CB3 1A05 713E 9BF7 FAC5 5809 DD8C B7B1 470D B964
18051805
D: netfilter: TCP window tracking code
18061806
D: netfilter: raw table

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10866,7 +10866,7 @@ F: drivers/net/ethernet/neterion/
1086610866

1086710867
NETFILTER
1086810868
M: Pablo Neira Ayuso <pablo@netfilter.org>
10869-
M: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
10869+
M: Jozsef Kadlecsik <kadlec@netfilter.org>
1087010870
M: Florian Westphal <fw@strlen.de>
1087110871
L: netfilter-devel@vger.kernel.org
1087210872
L: coreteam@netfilter.org

include/linux/jhash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* if SELF_TEST is defined. You can use this free for any purpose. It's in
1818
* the public domain. It has no warranty.
1919
*
20-
* Copyright (C) 2009-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu)
20+
* Copyright (C) 2009-2010 Jozsef Kadlecsik (kadlec@netfilter.org)
2121
*
2222
* I've modified Bob's hash to be useful in the Linux kernel, and
2323
* any bugs present are my fault.

include/linux/netfilter/ipset/ip_set.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
33
* Patrick Schaaf <bof@bof.de>
44
* Martin Josefsson <gandalf@wlug.westbo.se>
5-
* Copyright (C) 2003-2013 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
5+
* Copyright (C) 2003-2013 Jozsef Kadlecsik <kadlec@netfilter.org>
66
*/
77
#ifndef _IP_SET_H
88
#define _IP_SET_H

include/linux/netfilter/ipset/ip_set_counter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#ifndef _IP_SET_COUNTER_H
33
#define _IP_SET_COUNTER_H
44

5-
/* Copyright (C) 2015 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
6-
*/
5+
/* Copyright (C) 2015 Jozsef Kadlecsik <kadlec@netfilter.org> */
76

87
#ifdef __KERNEL__
98

include/linux/netfilter/ipset/ip_set_skbinfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#ifndef _IP_SET_SKBINFO_H
33
#define _IP_SET_SKBINFO_H
44

5-
/* Copyright (C) 2015 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
6-
*/
5+
/* Copyright (C) 2015 Jozsef Kadlecsik <kadlec@netfilter.org> */
76

87
#ifdef __KERNEL__
98

include/linux/netfilter/ipset/ip_set_timeout.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#ifndef _IP_SET_TIMEOUT_H
33
#define _IP_SET_TIMEOUT_H
44

5-
/* Copyright (C) 2003-2013 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
6-
*/
5+
/* Copyright (C) 2003-2013 Jozsef Kadlecsik <kadlec@netfilter.org> */
76

87
#ifdef __KERNEL__
98

include/linux/netfilter_ipv6.h

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define __LINUX_IP6_NETFILTER_H
99

1010
#include <uapi/linux/netfilter_ipv6.h>
11+
#include <net/tcp.h>
1112

1213
/* Extra routing may needed on local out, as the QUEUE target never returns
1314
* control to the table.
@@ -35,6 +36,10 @@ struct nf_ipv6_ops {
3536
struct in6_addr *saddr);
3637
int (*route)(struct net *net, struct dst_entry **dst, struct flowi *fl,
3738
bool strict);
39+
u32 (*cookie_init_sequence)(const struct ipv6hdr *iph,
40+
const struct tcphdr *th, u16 *mssp);
41+
int (*cookie_v6_check)(const struct ipv6hdr *iph,
42+
const struct tcphdr *th, __u32 cookie);
3843
#endif
3944
void (*route_input)(struct sk_buff *skb);
4045
int (*fragment)(struct net *net, struct sock *sk, struct sk_buff *skb,
@@ -70,8 +75,10 @@ static inline int nf_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
7075
return 1;
7176

7277
return v6_ops->chk_addr(net, addr, dev, strict);
73-
#else
78+
#elif IS_BUILTIN(CONFIG_IPV6)
7479
return ipv6_chk_addr(net, addr, dev, strict);
80+
#else
81+
return 1;
7582
#endif
7683
}
7784

@@ -108,8 +115,10 @@ static inline int nf_ipv6_br_defrag(struct net *net, struct sk_buff *skb,
108115
return 1;
109116

110117
return v6_ops->br_defrag(net, skb, user);
111-
#else
118+
#elif IS_BUILTIN(CONFIG_IPV6)
112119
return nf_ct_frag6_gather(net, skb, user);
120+
#else
121+
return 1;
113122
#endif
114123
}
115124

@@ -133,8 +142,10 @@ static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk,
133142
return 1;
134143

135144
return v6_ops->br_fragment(net, sk, skb, data, output);
136-
#else
145+
#elif IS_BUILTIN(CONFIG_IPV6)
137146
return br_ip6_fragment(net, sk, skb, data, output);
147+
#else
148+
return 1;
138149
#endif
139150
}
140151

@@ -149,9 +160,44 @@ static inline int nf_ip6_route_me_harder(struct net *net, struct sk_buff *skb)
149160
return -EHOSTUNREACH;
150161

151162
return v6_ops->route_me_harder(net, skb);
152-
#else
163+
#elif IS_BUILTIN(CONFIG_IPV6)
153164
return ip6_route_me_harder(net, skb);
165+
#else
166+
return -EHOSTUNREACH;
167+
#endif
168+
}
169+
170+
static inline u32 nf_ipv6_cookie_init_sequence(const struct ipv6hdr *iph,
171+
const struct tcphdr *th,
172+
u16 *mssp)
173+
{
174+
#if IS_ENABLED(CONFIG_SYN_COOKIES)
175+
#if IS_MODULE(CONFIG_IPV6)
176+
const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops();
177+
178+
if (v6_ops)
179+
return v6_ops->cookie_init_sequence(iph, th, mssp);
180+
#elif IS_BUILTIN(CONFIG_IPV6)
181+
return __cookie_v6_init_sequence(iph, th, mssp);
182+
#endif
183+
#endif
184+
return 0;
185+
}
186+
187+
static inline int nf_cookie_v6_check(const struct ipv6hdr *iph,
188+
const struct tcphdr *th, __u32 cookie)
189+
{
190+
#if IS_ENABLED(CONFIG_SYN_COOKIES)
191+
#if IS_MODULE(CONFIG_IPV6)
192+
const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops();
193+
194+
if (v6_ops)
195+
return v6_ops->cookie_v6_check(iph, th, cookie);
196+
#elif IS_BUILTIN(CONFIG_IPV6)
197+
return __cookie_v6_check(iph, th, cookie);
198+
#endif
154199
#endif
200+
return 0;
155201
}
156202

157203
__sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,

include/net/netfilter/br_netfilter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
4242
return port ? &port->br->fake_rtable : NULL;
4343
}
4444

45-
struct net_device *setup_pre_routing(struct sk_buff *skb);
45+
struct net_device *setup_pre_routing(struct sk_buff *skb,
46+
const struct net *net);
4647

4748
#if IS_ENABLED(CONFIG_IPV6)
4849
int br_validate_ipv6(struct net *net, struct sk_buff *skb);

include/net/netfilter/nf_conntrack.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ struct nf_conn {
7070
struct nf_conntrack ct_general;
7171

7272
spinlock_t lock;
73-
u16 cpu;
73+
/* jiffies32 when this ct is considered dead */
74+
u32 timeout;
7475

7576
#ifdef CONFIG_NF_CONNTRACK_ZONES
7677
struct nf_conntrack_zone zone;
@@ -82,9 +83,7 @@ struct nf_conn {
8283
/* Have we seen traffic both ways yet? (bitset) */
8384
unsigned long status;
8485

85-
/* jiffies32 when this ct is considered dead */
86-
u32 timeout;
87-
86+
u16 cpu;
8887
possible_net_t ct_net;
8988

9089
#if IS_ENABLED(CONFIG_NF_NAT)

0 commit comments

Comments
 (0)