forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says: ==================== Netfilter/IPVS updates for net-next The following patchset contains Netfilter/IPVS updates for your net-next tree: 1) No need to set ttl from reject action for the bridge family, from Taehee Yoo. 2) Use a fixed timeout for flow that are passed up from the flowtable to conntrack, from Florian Westphal. 3) More preparation patches for tproxy support for nf_tables, from Mate Eckl. 4) Remove unnecessary indirection in core IPv6 checksum function, from Florian Westphal. 5) Use nf_ct_get_tuplepr() from openvswitch, instead of opencoding it. From Florian Westphal. 6) socket match now selects socket infrastructure, instead of depending on it. From Mate Eckl. 7) Patch series to simplify conntrack tuple building/parsing from packet path and ctnetlink, from Florian Westphal. 8) Fetch timeout policy from protocol helpers, instead of doing it from core, from Florian Westphal. 9) Merge IPv4 and IPv6 protocol trackers into conntrack core, from Florian Westphal. 10) Depend on CONFIG_NF_TABLES_IPV6 and CONFIG_IP6_NF_IPTABLES respectively, instead of IPV6. Patch from Mate Eckl. 11) Add specific function for garbage collection in conncount, from Yi-Hung Wei. 12) Catch number of elements in the connlimit list, from Yi-Hung Wei. 13) Move locking to nf_conncount, from Yi-Hung Wei. 14) Series of patches to add lockless tree traversal in nf_conncount, from Yi-Hung Wei. 15) Resolve clash in matching conntracks when race happens, from Martynas Pumputis. 16) If connection entry times out, remove template entry from the ip_vs_conn_tab table to improve behaviour under flood, from Julian Anastasov. 17) Remove useless parameter from nf_ct_helper_ext_add(), from Gao feng. 18) Call abort from 2-phase commit protocol before requesting modules, make sure this is done under the mutex, from Florian Westphal. 19) Grab module reference when starting transaction, also from Florian. 20) Dynamically allocate expression info array for pre-parsing, from Florian. 21) Add per netns mutex for nf_tables, from Florian Westphal. 22) A couple of patches to simplify and refactor nf_osf code to prepare for nft_osf support. 23) Break evaluation on missing socket, from Mate Eckl. 24) Allow to match socket mark from nft_socket, from Mate Eckl. 25) Remove dependency on nf_defrag_ipv6, now that IPv6 tracker is built-in into nf_conntrack. From Florian Westphal. ==================== Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
72 changed files
with
2,029 additions
and
2,408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _IPV6_FRAG_H | ||
#define _IPV6_FRAG_H | ||
#include <linux/kernel.h> | ||
#include <net/addrconf.h> | ||
#include <net/ipv6.h> | ||
#include <net/inet_frag.h> | ||
|
||
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, | ||
}; | ||
|
||
/* | ||
* Equivalent of ipv4 struct ip | ||
*/ | ||
struct frag_queue { | ||
struct inet_frag_queue q; | ||
|
||
int iif; | ||
__u16 nhoffset; | ||
u8 ecn; | ||
}; | ||
|
||
#if IS_ENABLED(CONFIG_IPV6) | ||
static inline void ip6frag_init(struct inet_frag_queue *q, const void *a) | ||
{ | ||
struct frag_queue *fq = container_of(q, struct frag_queue, q); | ||
const struct frag_v6_compare_key *key = a; | ||
|
||
q->key.v6 = *key; | ||
fq->ecn = 0; | ||
} | ||
|
||
static inline u32 ip6frag_key_hashfn(const void *data, u32 len, u32 seed) | ||
{ | ||
return jhash2(data, | ||
sizeof(struct frag_v6_compare_key) / sizeof(u32), seed); | ||
} | ||
|
||
static inline u32 ip6frag_obj_hashfn(const void *data, u32 len, u32 seed) | ||
{ | ||
const struct inet_frag_queue *fq = data; | ||
|
||
return jhash2((const u32 *)&fq->key.v6, | ||
sizeof(struct frag_v6_compare_key) / sizeof(u32), seed); | ||
} | ||
|
||
static inline int | ||
ip6frag_obj_cmpfn(struct rhashtable_compare_arg *arg, const void *ptr) | ||
{ | ||
const struct frag_v6_compare_key *key = arg->key; | ||
const struct inet_frag_queue *fq = ptr; | ||
|
||
return !!memcmp(&fq->key, key, sizeof(*key)); | ||
} | ||
|
||
static inline void | ||
ip6frag_expire_frag_queue(struct net *net, struct frag_queue *fq) | ||
{ | ||
struct net_device *dev = NULL; | ||
struct sk_buff *head; | ||
|
||
rcu_read_lock(); | ||
spin_lock(&fq->q.lock); | ||
|
||
if (fq->q.flags & INET_FRAG_COMPLETE) | ||
goto out; | ||
|
||
inet_frag_kill(&fq->q); | ||
|
||
dev = dev_get_by_index_rcu(net, fq->iif); | ||
if (!dev) | ||
goto out; | ||
|
||
__IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); | ||
__IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMTIMEOUT); | ||
|
||
/* Don't send error if the first segment did not arrive. */ | ||
head = fq->q.fragments; | ||
if (!(fq->q.flags & INET_FRAG_FIRST_IN) || !head) | ||
goto out; | ||
|
||
head->dev = dev; | ||
skb_get(head); | ||
spin_unlock(&fq->q.lock); | ||
|
||
icmpv6_send(head, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0); | ||
kfree_skb(head); | ||
goto out_rcu_unlock; | ||
|
||
out: | ||
spin_unlock(&fq->q.lock); | ||
out_rcu_unlock: | ||
rcu_read_unlock(); | ||
inet_frag_put(&fq->q); | ||
} | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.