You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
This commit is contained in:
@@ -3,6 +3,7 @@ header-y += nf_conntrack_tuple_common.h
|
||||
header-y += nfnetlink_conntrack.h
|
||||
header-y += nfnetlink_log.h
|
||||
header-y += nfnetlink_queue.h
|
||||
header-y += xt_CHECKSUM.h
|
||||
header-y += xt_CLASSIFY.h
|
||||
header-y += xt_CONNMARK.h
|
||||
header-y += xt_CONNSECMARK.h
|
||||
@@ -19,17 +20,19 @@ header-y += xt_TCPMSS.h
|
||||
header-y += xt_TCPOPTSTRIP.h
|
||||
header-y += xt_TEE.h
|
||||
header-y += xt_TPROXY.h
|
||||
header-y += xt_cluster.h
|
||||
header-y += xt_comment.h
|
||||
header-y += xt_connbytes.h
|
||||
header-y += xt_connlimit.h
|
||||
header-y += xt_connmark.h
|
||||
header-y += xt_conntrack.h
|
||||
header-y += xt_cluster.h
|
||||
header-y += xt_cpu.h
|
||||
header-y += xt_dccp.h
|
||||
header-y += xt_dscp.h
|
||||
header-y += xt_esp.h
|
||||
header-y += xt_hashlimit.h
|
||||
header-y += xt_iprange.h
|
||||
header-y += xt_ipvs.h
|
||||
header-y += xt_helper.h
|
||||
header-y += xt_length.h
|
||||
header-y += xt_limit.h
|
||||
|
||||
@@ -89,7 +89,7 @@ enum nfulnl_attr_config {
|
||||
#define NFULNL_COPY_NONE 0x00
|
||||
#define NFULNL_COPY_META 0x01
|
||||
#define NFULNL_COPY_PACKET 0x02
|
||||
#define NFULNL_COPY_DISABLED 0x03
|
||||
/* 0xff is reserved, don't use it for new copy modes. */
|
||||
|
||||
#define NFULNL_CFG_F_SEQ 0x0001
|
||||
#define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Header file for iptables ipt_CHECKSUM target
|
||||
*
|
||||
* (C) 2002 by Harald Welte <laforge@gnumonks.org>
|
||||
* (C) 2010 Red Hat Inc
|
||||
* Author: Michael S. Tsirkin <mst@redhat.com>
|
||||
*
|
||||
* This software is distributed under GNU GPL v2, 1991
|
||||
*/
|
||||
#ifndef _XT_CHECKSUM_TARGET_H
|
||||
#define _XT_CHECKSUM_TARGET_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define XT_CHECKSUM_OP_FILL 0x01 /* fill in checksum in IP header */
|
||||
|
||||
struct xt_CHECKSUM_info {
|
||||
__u8 operation; /* bitset of operations */
|
||||
};
|
||||
|
||||
#endif /* _XT_CHECKSUM_TARGET_H */
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef _XT_CPU_H
|
||||
#define _XT_CPU_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct xt_cpu_info {
|
||||
__u32 cpu;
|
||||
__u32 invert;
|
||||
};
|
||||
|
||||
#endif /*_XT_CPU_H*/
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef _XT_IPVS_H
|
||||
#define _XT_IPVS_H
|
||||
|
||||
enum {
|
||||
XT_IPVS_IPVS_PROPERTY = 1 << 0, /* all other options imply this one */
|
||||
XT_IPVS_PROTO = 1 << 1,
|
||||
XT_IPVS_VADDR = 1 << 2,
|
||||
XT_IPVS_VPORT = 1 << 3,
|
||||
XT_IPVS_DIR = 1 << 4,
|
||||
XT_IPVS_METHOD = 1 << 5,
|
||||
XT_IPVS_VPORTCTL = 1 << 6,
|
||||
XT_IPVS_MASK = (1 << 7) - 1,
|
||||
XT_IPVS_ONCE_MASK = XT_IPVS_MASK & ~XT_IPVS_IPVS_PROPERTY
|
||||
};
|
||||
|
||||
struct xt_ipvs_mtinfo {
|
||||
union nf_inet_addr vaddr, vmask;
|
||||
__be16 vport;
|
||||
__u8 l4proto;
|
||||
__u8 fwd_method;
|
||||
__be16 vportctl;
|
||||
|
||||
__u8 invert;
|
||||
__u8 bitmask;
|
||||
};
|
||||
|
||||
#endif /* _XT_IPVS_H */
|
||||
@@ -11,9 +11,9 @@ struct xt_quota_priv;
|
||||
struct xt_quota_info {
|
||||
u_int32_t flags;
|
||||
u_int32_t pad;
|
||||
aligned_u64 quota;
|
||||
|
||||
/* Used internally by the kernel */
|
||||
aligned_u64 quota;
|
||||
struct xt_quota_priv *master;
|
||||
};
|
||||
|
||||
|
||||
+12
-2
@@ -632,10 +632,22 @@ extern struct ip_vs_conn *ip_vs_ct_in_get
|
||||
(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
|
||||
const union nf_inet_addr *d_addr, __be16 d_port);
|
||||
|
||||
struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
|
||||
struct ip_vs_protocol *pp,
|
||||
const struct ip_vs_iphdr *iph,
|
||||
unsigned int proto_off,
|
||||
int inverse);
|
||||
|
||||
extern struct ip_vs_conn *ip_vs_conn_out_get
|
||||
(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
|
||||
const union nf_inet_addr *d_addr, __be16 d_port);
|
||||
|
||||
struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
|
||||
struct ip_vs_protocol *pp,
|
||||
const struct ip_vs_iphdr *iph,
|
||||
unsigned int proto_off,
|
||||
int inverse);
|
||||
|
||||
/* put back the conn without restarting its timer */
|
||||
static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
|
||||
{
|
||||
@@ -736,8 +748,6 @@ extern void ip_vs_app_inc_put(struct ip_vs_app *inc);
|
||||
|
||||
extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
|
||||
extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
|
||||
extern int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri,
|
||||
char *o_buf, int o_len, char *n_buf, int n_len);
|
||||
extern int ip_vs_app_init(void);
|
||||
extern void ip_vs_app_cleanup(void);
|
||||
|
||||
|
||||
@@ -28,9 +28,14 @@ struct nf_ct_ext {
|
||||
char data[0];
|
||||
};
|
||||
|
||||
static inline int nf_ct_ext_exist(const struct nf_conn *ct, u8 id)
|
||||
static inline bool __nf_ct_ext_exist(const struct nf_ct_ext *ext, u8 id)
|
||||
{
|
||||
return (ct->ext && ct->ext->offset[id]);
|
||||
return !!ext->offset[id];
|
||||
}
|
||||
|
||||
static inline bool nf_ct_ext_exist(const struct nf_conn *ct, u8 id)
|
||||
{
|
||||
return (ct->ext && __nf_ct_ext_exist(ct->ext, id));
|
||||
}
|
||||
|
||||
static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id)
|
||||
|
||||
@@ -27,9 +27,9 @@ struct nf_nat_protocol {
|
||||
|
||||
/* Alter the per-proto part of the tuple (depending on
|
||||
maniptype), to give a unique tuple in the given range if
|
||||
possible; return false if not. Per-protocol part of tuple
|
||||
is initialized to the incoming packet. */
|
||||
bool (*unique_tuple)(struct nf_conntrack_tuple *tuple,
|
||||
possible. Per-protocol part of tuple is initialized to the
|
||||
incoming packet. */
|
||||
void (*unique_tuple)(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
const struct nf_conn *ct);
|
||||
@@ -63,7 +63,7 @@ extern bool nf_nat_proto_in_range(const struct nf_conntrack_tuple *tuple,
|
||||
const union nf_conntrack_man_proto *min,
|
||||
const union nf_conntrack_man_proto *max);
|
||||
|
||||
extern bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
extern void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
const struct nf_conn *ct,
|
||||
|
||||
@@ -10,5 +10,7 @@ nfulnl_log_packet(u_int8_t pf,
|
||||
const struct nf_loginfo *li_user,
|
||||
const char *prefix);
|
||||
|
||||
#define NFULNL_COPY_DISABLED 0xff
|
||||
|
||||
#endif /* _KER_NFNETLINK_LOG_H */
|
||||
|
||||
|
||||
@@ -283,16 +283,13 @@ unsigned int arpt_do_table(struct sk_buff *skb,
|
||||
arp = arp_hdr(skb);
|
||||
do {
|
||||
const struct arpt_entry_target *t;
|
||||
int hdr_len;
|
||||
|
||||
if (!arp_packet_match(arp, skb->dev, indev, outdev, &e->arp)) {
|
||||
e = arpt_next_entry(e);
|
||||
continue;
|
||||
}
|
||||
|
||||
hdr_len = sizeof(*arp) + (2 * sizeof(struct in_addr)) +
|
||||
(2 * skb->dev->addr_len);
|
||||
ADD_COUNTER(e->counters, hdr_len, 1);
|
||||
ADD_COUNTER(e->counters, arp_hdr_len(skb->dev), 1);
|
||||
|
||||
t = arpt_get_target_c(e);
|
||||
|
||||
@@ -713,7 +710,7 @@ static void get_counters(const struct xt_table_info *t,
|
||||
struct arpt_entry *iter;
|
||||
unsigned int cpu;
|
||||
unsigned int i;
|
||||
unsigned int curcpu;
|
||||
unsigned int curcpu = get_cpu();
|
||||
|
||||
/* Instead of clearing (by a previous call to memset())
|
||||
* the counters and using adds, we set the counters
|
||||
@@ -723,14 +720,16 @@ static void get_counters(const struct xt_table_info *t,
|
||||
* if new softirq were to run and call ipt_do_table
|
||||
*/
|
||||
local_bh_disable();
|
||||
curcpu = smp_processor_id();
|
||||
|
||||
i = 0;
|
||||
xt_entry_foreach(iter, t->entries[curcpu], t->size) {
|
||||
SET_COUNTER(counters[i], iter->counters.bcnt,
|
||||
iter->counters.pcnt);
|
||||
++i;
|
||||
}
|
||||
local_bh_enable();
|
||||
/* Processing counters from other cpus, we can let bottom half enabled,
|
||||
* (preemption is disabled)
|
||||
*/
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
if (cpu == curcpu)
|
||||
@@ -744,7 +743,7 @@ static void get_counters(const struct xt_table_info *t,
|
||||
}
|
||||
xt_info_wrunlock(cpu);
|
||||
}
|
||||
local_bh_enable();
|
||||
put_cpu();
|
||||
}
|
||||
|
||||
static struct xt_counters *alloc_counters(const struct xt_table *table)
|
||||
|
||||
@@ -364,7 +364,7 @@ ipt_do_table(struct sk_buff *skb,
|
||||
goto no_match;
|
||||
}
|
||||
|
||||
ADD_COUNTER(e->counters, ntohs(ip->tot_len), 1);
|
||||
ADD_COUNTER(e->counters, skb->len, 1);
|
||||
|
||||
t = ipt_get_target(e);
|
||||
IP_NF_ASSERT(t->u.kernel.target);
|
||||
@@ -884,7 +884,7 @@ get_counters(const struct xt_table_info *t,
|
||||
struct ipt_entry *iter;
|
||||
unsigned int cpu;
|
||||
unsigned int i;
|
||||
unsigned int curcpu;
|
||||
unsigned int curcpu = get_cpu();
|
||||
|
||||
/* Instead of clearing (by a previous call to memset())
|
||||
* the counters and using adds, we set the counters
|
||||
@@ -894,14 +894,16 @@ get_counters(const struct xt_table_info *t,
|
||||
* if new softirq were to run and call ipt_do_table
|
||||
*/
|
||||
local_bh_disable();
|
||||
curcpu = smp_processor_id();
|
||||
|
||||
i = 0;
|
||||
xt_entry_foreach(iter, t->entries[curcpu], t->size) {
|
||||
SET_COUNTER(counters[i], iter->counters.bcnt,
|
||||
iter->counters.pcnt);
|
||||
++i;
|
||||
}
|
||||
local_bh_enable();
|
||||
/* Processing counters from other cpus, we can let bottom half enabled,
|
||||
* (preemption is disabled)
|
||||
*/
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
if (cpu == curcpu)
|
||||
@@ -915,7 +917,7 @@ get_counters(const struct xt_table_info *t,
|
||||
}
|
||||
xt_info_wrunlock(cpu);
|
||||
}
|
||||
local_bh_enable();
|
||||
put_cpu();
|
||||
}
|
||||
|
||||
static struct xt_counters *alloc_counters(const struct xt_table *table)
|
||||
|
||||
@@ -95,10 +95,11 @@ static void send_reset(struct sk_buff *oldskb, int hook)
|
||||
}
|
||||
|
||||
tcph->rst = 1;
|
||||
tcph->check = tcp_v4_check(sizeof(struct tcphdr),
|
||||
niph->saddr, niph->daddr,
|
||||
csum_partial(tcph,
|
||||
sizeof(struct tcphdr), 0));
|
||||
tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr,
|
||||
niph->daddr, 0);
|
||||
nskb->ip_summed = CHECKSUM_PARTIAL;
|
||||
nskb->csum_start = (unsigned char *)tcph - nskb->head;
|
||||
nskb->csum_offset = offsetof(struct tcphdr, check);
|
||||
|
||||
addr_type = RTN_UNSPEC;
|
||||
if (hook != NF_INET_FORWARD
|
||||
@@ -115,7 +116,6 @@ static void send_reset(struct sk_buff *oldskb, int hook)
|
||||
goto free_nskb;
|
||||
|
||||
niph->ttl = dst_metric(skb_dst(nskb), RTAX_HOPLIMIT);
|
||||
nskb->ip_summed = CHECKSUM_NONE;
|
||||
|
||||
/* "Never happens" */
|
||||
if (nskb->len > dst_mtu(skb_dst(nskb)))
|
||||
|
||||
@@ -261,14 +261,9 @@ get_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
rcu_read_lock();
|
||||
proto = __nf_nat_proto_find(orig_tuple->dst.protonum);
|
||||
|
||||
/* Change protocol info to have some randomization */
|
||||
if (range->flags & IP_NAT_RANGE_PROTO_RANDOM) {
|
||||
proto->unique_tuple(tuple, range, maniptype, ct);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Only bother mapping if it's not already in range and unique */
|
||||
if ((!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED) ||
|
||||
if (!(range->flags & IP_NAT_RANGE_PROTO_RANDOM) &&
|
||||
(!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED) ||
|
||||
proto->in_range(tuple, maniptype, &range->min, &range->max)) &&
|
||||
!nf_nat_used_tuple(tuple, ct))
|
||||
goto out;
|
||||
@@ -440,7 +435,7 @@ int nf_nat_icmp_reply_translation(struct nf_conn *ct,
|
||||
if (!skb_make_writable(skb, hdrlen + sizeof(*inside)))
|
||||
return 0;
|
||||
|
||||
inside = (void *)skb->data + ip_hdrlen(skb);
|
||||
inside = (void *)skb->data + hdrlen;
|
||||
|
||||
/* We're actually going to mangle it beyond trivial checksum
|
||||
adjustment, so make sure the current checksum is correct. */
|
||||
@@ -470,12 +465,10 @@ int nf_nat_icmp_reply_translation(struct nf_conn *ct,
|
||||
/* rcu_read_lock()ed by nf_hook_slow */
|
||||
l4proto = __nf_ct_l4proto_find(PF_INET, inside->ip.protocol);
|
||||
|
||||
if (!nf_ct_get_tuple(skb,
|
||||
ip_hdrlen(skb) + sizeof(struct icmphdr),
|
||||
(ip_hdrlen(skb) +
|
||||
if (!nf_ct_get_tuple(skb, hdrlen + sizeof(struct icmphdr),
|
||||
(hdrlen +
|
||||
sizeof(struct icmphdr) + inside->ip.ihl * 4),
|
||||
(u_int16_t)AF_INET,
|
||||
inside->ip.protocol,
|
||||
(u_int16_t)AF_INET, inside->ip.protocol,
|
||||
&inner, l3proto, l4proto))
|
||||
return 0;
|
||||
|
||||
@@ -484,15 +477,13 @@ int nf_nat_icmp_reply_translation(struct nf_conn *ct,
|
||||
pass all hooks (locally-generated ICMP). Consider incoming
|
||||
packet: PREROUTING (DST manip), routing produces ICMP, goes
|
||||
through POSTROUTING (which must correct the DST manip). */
|
||||
if (!manip_pkt(inside->ip.protocol, skb,
|
||||
ip_hdrlen(skb) + sizeof(inside->icmp),
|
||||
&ct->tuplehash[!dir].tuple,
|
||||
!manip))
|
||||
if (!manip_pkt(inside->ip.protocol, skb, hdrlen + sizeof(inside->icmp),
|
||||
&ct->tuplehash[!dir].tuple, !manip))
|
||||
return 0;
|
||||
|
||||
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
||||
/* Reloading "inside" here since manip_pkt inner. */
|
||||
inside = (void *)skb->data + ip_hdrlen(skb);
|
||||
inside = (void *)skb->data + hdrlen;
|
||||
inside->icmp.checksum = 0;
|
||||
inside->icmp.checksum =
|
||||
csum_fold(skb_checksum(skb, hdrlen,
|
||||
|
||||
@@ -34,7 +34,7 @@ bool nf_nat_proto_in_range(const struct nf_conntrack_tuple *tuple,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nf_nat_proto_in_range);
|
||||
|
||||
bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
const struct nf_conn *ct,
|
||||
@@ -53,7 +53,7 @@ bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED)) {
|
||||
/* If it's dst rewrite, can't change port */
|
||||
if (maniptype == IP_NAT_MANIP_DST)
|
||||
return false;
|
||||
return;
|
||||
|
||||
if (ntohs(*portptr) < 1024) {
|
||||
/* Loose convention: >> 512 is credential passing */
|
||||
@@ -81,15 +81,15 @@ bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
else
|
||||
off = *rover;
|
||||
|
||||
for (i = 0; i < range_size; i++, off++) {
|
||||
for (i = 0; ; ++off) {
|
||||
*portptr = htons(min + off % range_size);
|
||||
if (nf_nat_used_tuple(tuple, ct))
|
||||
if (++i != range_size && nf_nat_used_tuple(tuple, ct))
|
||||
continue;
|
||||
if (!(range->flags & IP_NAT_RANGE_PROTO_RANDOM))
|
||||
*rover = off;
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nf_nat_proto_unique_tuple);
|
||||
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
|
||||
static u_int16_t dccp_port_rover;
|
||||
|
||||
static bool
|
||||
static void
|
||||
dccp_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
const struct nf_conn *ct)
|
||||
{
|
||||
return nf_nat_proto_unique_tuple(tuple, range, maniptype, ct,
|
||||
&dccp_port_rover);
|
||||
nf_nat_proto_unique_tuple(tuple, range, maniptype, ct,
|
||||
&dccp_port_rover);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
@@ -37,7 +37,7 @@ MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
|
||||
MODULE_DESCRIPTION("Netfilter NAT protocol helper module for GRE");
|
||||
|
||||
/* generate unique tuple ... */
|
||||
static bool
|
||||
static void
|
||||
gre_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
@@ -50,7 +50,7 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
/* If there is no master conntrack we are not PPTP,
|
||||
do not change tuples */
|
||||
if (!ct->master)
|
||||
return false;
|
||||
return;
|
||||
|
||||
if (maniptype == IP_NAT_MANIP_SRC)
|
||||
keyptr = &tuple->src.u.gre.key;
|
||||
@@ -68,14 +68,14 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
|
||||
pr_debug("min = %u, range_size = %u\n", min, range_size);
|
||||
|
||||
for (i = 0; i < range_size; i++, key++) {
|
||||
for (i = 0; ; ++key) {
|
||||
*keyptr = htons(min + key % range_size);
|
||||
if (!nf_nat_used_tuple(tuple, ct))
|
||||
return true;
|
||||
if (++i == range_size || !nf_nat_used_tuple(tuple, ct))
|
||||
return;
|
||||
}
|
||||
|
||||
pr_debug("%p: no NAT mapping\n", ct);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* manipulate a GRE packet according to maniptype */
|
||||
|
||||
@@ -27,7 +27,7 @@ icmp_in_range(const struct nf_conntrack_tuple *tuple,
|
||||
ntohs(tuple->src.u.icmp.id) <= ntohs(max->icmp.id);
|
||||
}
|
||||
|
||||
static bool
|
||||
static void
|
||||
icmp_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
@@ -42,13 +42,13 @@ icmp_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED))
|
||||
range_size = 0xFFFF;
|
||||
|
||||
for (i = 0; i < range_size; i++, id++) {
|
||||
for (i = 0; ; ++id) {
|
||||
tuple->src.u.icmp.id = htons(ntohs(range->min.icmp.id) +
|
||||
(id % range_size));
|
||||
if (!nf_nat_used_tuple(tuple, ct))
|
||||
return true;
|
||||
if (++i == range_size || !nf_nat_used_tuple(tuple, ct))
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
static u_int16_t nf_sctp_port_rover;
|
||||
|
||||
static bool
|
||||
static void
|
||||
sctp_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
const struct nf_conn *ct)
|
||||
{
|
||||
return nf_nat_proto_unique_tuple(tuple, range, maniptype, ct,
|
||||
&nf_sctp_port_rover);
|
||||
nf_nat_proto_unique_tuple(tuple, range, maniptype, ct,
|
||||
&nf_sctp_port_rover);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
@@ -20,14 +20,13 @@
|
||||
|
||||
static u_int16_t tcp_port_rover;
|
||||
|
||||
static bool
|
||||
static void
|
||||
tcp_unique_tuple(struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_nat_range *range,
|
||||
enum nf_nat_manip_type maniptype,
|
||||
const struct nf_conn *ct)
|
||||
{
|
||||
return nf_nat_proto_unique_tuple(tuple, range, maniptype, ct,
|
||||
&tcp_port_rover);
|
||||
nf_nat_proto_unique_tuple(tuple, range, maniptype, ct, &tcp_port_rover);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user