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://1984.lsi.us.es/net-next
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
What: ip_queue
|
||||
Date: finally removed in kernel v3.5.0
|
||||
Contact: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
Description:
|
||||
ip_queue has been replaced by nfnetlink_queue which provides
|
||||
more advanced queueing mechanism to user-space. The ip_queue
|
||||
module was already announced to become obsolete years ago.
|
||||
|
||||
Users:
|
||||
@@ -1301,13 +1301,22 @@ bridge-nf-call-ip6tables - BOOLEAN
|
||||
bridge-nf-filter-vlan-tagged - BOOLEAN
|
||||
1 : pass bridged vlan-tagged ARP/IP/IPv6 traffic to {arp,ip,ip6}tables.
|
||||
0 : disable this.
|
||||
Default: 1
|
||||
Default: 0
|
||||
|
||||
bridge-nf-filter-pppoe-tagged - BOOLEAN
|
||||
1 : pass bridged pppoe-tagged IP/IPv6 traffic to {ip,ip6}tables.
|
||||
0 : disable this.
|
||||
Default: 1
|
||||
Default: 0
|
||||
|
||||
bridge-nf-pass-vlan-input-dev - BOOLEAN
|
||||
1: if bridge-nf-filter-vlan-tagged is enabled, try to find a vlan
|
||||
interface on the bridge and set the netfilter input device to the vlan.
|
||||
This allows use of e.g. "iptables -i br0.1" and makes the REDIRECT
|
||||
target work with vlan-on-top-of-bridge interfaces. When no matching
|
||||
vlan interface is found, or this switch is off, the input device is
|
||||
set to the bridge interface.
|
||||
0: disable bridge netfilter vlan interface lookup.
|
||||
Default: 0
|
||||
|
||||
proc/sys/net/sctp/* Variables:
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
|
||||
#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */
|
||||
|
||||
/* Initial bits allowed in backup server */
|
||||
#define IP_VS_CONN_F_BACKUP_MASK (IP_VS_CONN_F_FWD_MASK | \
|
||||
IP_VS_CONN_F_NOOUTPUT | \
|
||||
IP_VS_CONN_F_INACTIVE | \
|
||||
@@ -97,6 +98,10 @@
|
||||
IP_VS_CONN_F_TEMPLATE \
|
||||
)
|
||||
|
||||
/* Bits allowed to update in backup server */
|
||||
#define IP_VS_CONN_F_BACKUP_UPD_MASK (IP_VS_CONN_F_INACTIVE | \
|
||||
IP_VS_CONN_F_SEQ_MASK)
|
||||
|
||||
/* Flags that are not sent to backup server start from bit 16 */
|
||||
#define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */
|
||||
|
||||
|
||||
@@ -83,6 +83,10 @@ enum ip_conntrack_status {
|
||||
/* Conntrack is a fake untracked entry */
|
||||
IPS_UNTRACKED_BIT = 12,
|
||||
IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
|
||||
|
||||
/* Conntrack got a helper explicitly attached via CT target. */
|
||||
IPS_HELPER_BIT = 13,
|
||||
IPS_HELPER = (1 << IPS_HELPER_BIT),
|
||||
};
|
||||
|
||||
/* Connection tracking event types */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
header-y += ip_queue.h
|
||||
header-y += ip_tables.h
|
||||
header-y += ipt_CLUSTERIP.h
|
||||
header-y += ipt_ECN.h
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* This is a module which is used for queueing IPv4 packets and
|
||||
* communicating with userspace via netlink.
|
||||
*
|
||||
* (C) 2000 James Morris, this code is GPL.
|
||||
*/
|
||||
#ifndef _IP_QUEUE_H
|
||||
#define _IP_QUEUE_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef DEBUG_IPQ
|
||||
#define QDEBUG(x...) printk(KERN_DEBUG ## x)
|
||||
#else
|
||||
#define QDEBUG(x...)
|
||||
#endif /* DEBUG_IPQ */
|
||||
#else
|
||||
#include <net/if.h>
|
||||
#endif /* ! __KERNEL__ */
|
||||
|
||||
/* Messages sent from kernel */
|
||||
typedef struct ipq_packet_msg {
|
||||
unsigned long packet_id; /* ID of queued packet */
|
||||
unsigned long mark; /* Netfilter mark value */
|
||||
long timestamp_sec; /* Packet arrival time (seconds) */
|
||||
long timestamp_usec; /* Packet arrvial time (+useconds) */
|
||||
unsigned int hook; /* Netfilter hook we rode in on */
|
||||
char indev_name[IFNAMSIZ]; /* Name of incoming interface */
|
||||
char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */
|
||||
__be16 hw_protocol; /* Hardware protocol (network order) */
|
||||
unsigned short hw_type; /* Hardware type */
|
||||
unsigned char hw_addrlen; /* Hardware address length */
|
||||
unsigned char hw_addr[8]; /* Hardware address */
|
||||
size_t data_len; /* Length of packet data */
|
||||
unsigned char payload[0]; /* Optional packet data */
|
||||
} ipq_packet_msg_t;
|
||||
|
||||
/* Messages sent from userspace */
|
||||
typedef struct ipq_mode_msg {
|
||||
unsigned char value; /* Requested mode */
|
||||
size_t range; /* Optional range of packet requested */
|
||||
} ipq_mode_msg_t;
|
||||
|
||||
typedef struct ipq_verdict_msg {
|
||||
unsigned int value; /* Verdict to hand to netfilter */
|
||||
unsigned long id; /* Packet ID for this verdict */
|
||||
size_t data_len; /* Length of replacement data */
|
||||
unsigned char payload[0]; /* Optional replacement packet */
|
||||
} ipq_verdict_msg_t;
|
||||
|
||||
typedef struct ipq_peer_msg {
|
||||
union {
|
||||
ipq_verdict_msg_t verdict;
|
||||
ipq_mode_msg_t mode;
|
||||
} msg;
|
||||
} ipq_peer_msg_t;
|
||||
|
||||
/* Packet delivery modes */
|
||||
enum {
|
||||
IPQ_COPY_NONE, /* Initial mode, packets are dropped */
|
||||
IPQ_COPY_META, /* Copy metadata */
|
||||
IPQ_COPY_PACKET /* Copy metadata + packet (range) */
|
||||
};
|
||||
#define IPQ_COPY_MAX IPQ_COPY_PACKET
|
||||
|
||||
/* Types of messages */
|
||||
#define IPQM_BASE 0x10 /* standard netlink messages below this */
|
||||
#define IPQM_MODE (IPQM_BASE + 1) /* Mode request from peer */
|
||||
#define IPQM_VERDICT (IPQM_BASE + 2) /* Verdict from peer */
|
||||
#define IPQM_PACKET (IPQM_BASE + 3) /* Packet from kernel */
|
||||
#define IPQM_MAX (IPQM_BASE + 4)
|
||||
|
||||
#endif /*_IP_QUEUE_H*/
|
||||
@@ -7,7 +7,7 @@
|
||||
#define NETLINK_ROUTE 0 /* Routing/device hook */
|
||||
#define NETLINK_UNUSED 1 /* Unused number */
|
||||
#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
|
||||
#define NETLINK_FIREWALL 3 /* Firewalling hook */
|
||||
#define NETLINK_FIREWALL 3 /* Unused number, formerly ip_queue */
|
||||
#define NETLINK_SOCK_DIAG 4 /* socket monitoring */
|
||||
#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
|
||||
#define NETLINK_XFRM 6 /* ipsec */
|
||||
|
||||
+79
-8
@@ -504,6 +504,7 @@ struct ip_vs_conn {
|
||||
* state transition triggerd
|
||||
* synchronization
|
||||
*/
|
||||
unsigned long sync_endtime; /* jiffies + sent_retries */
|
||||
|
||||
/* Control members */
|
||||
struct ip_vs_conn *control; /* Master control connection */
|
||||
@@ -783,6 +784,16 @@ struct ip_vs_app {
|
||||
void (*timeout_change)(struct ip_vs_app *app, int flags);
|
||||
};
|
||||
|
||||
struct ipvs_master_sync_state {
|
||||
struct list_head sync_queue;
|
||||
struct ip_vs_sync_buff *sync_buff;
|
||||
int sync_queue_len;
|
||||
unsigned int sync_queue_delay;
|
||||
struct task_struct *master_thread;
|
||||
struct delayed_work master_wakeup_work;
|
||||
struct netns_ipvs *ipvs;
|
||||
};
|
||||
|
||||
/* IPVS in network namespace */
|
||||
struct netns_ipvs {
|
||||
int gen; /* Generation */
|
||||
@@ -869,10 +880,15 @@ struct netns_ipvs {
|
||||
#endif
|
||||
int sysctl_snat_reroute;
|
||||
int sysctl_sync_ver;
|
||||
int sysctl_sync_ports;
|
||||
int sysctl_sync_qlen_max;
|
||||
int sysctl_sync_sock_size;
|
||||
int sysctl_cache_bypass;
|
||||
int sysctl_expire_nodest_conn;
|
||||
int sysctl_expire_quiescent_template;
|
||||
int sysctl_sync_threshold[2];
|
||||
unsigned int sysctl_sync_refresh_period;
|
||||
int sysctl_sync_retries;
|
||||
int sysctl_nat_icmp_send;
|
||||
|
||||
/* ip_vs_lblc */
|
||||
@@ -888,13 +904,11 @@ struct netns_ipvs {
|
||||
spinlock_t est_lock;
|
||||
struct timer_list est_timer; /* Estimation timer */
|
||||
/* ip_vs_sync */
|
||||
struct list_head sync_queue;
|
||||
spinlock_t sync_lock;
|
||||
struct ip_vs_sync_buff *sync_buff;
|
||||
struct ipvs_master_sync_state *ms;
|
||||
spinlock_t sync_buff_lock;
|
||||
struct sockaddr_in sync_mcast_addr;
|
||||
struct task_struct *master_thread;
|
||||
struct task_struct *backup_thread;
|
||||
struct task_struct **backup_threads;
|
||||
int threads_mask;
|
||||
int send_mesg_maxlen;
|
||||
int recv_mesg_maxlen;
|
||||
volatile int sync_state;
|
||||
@@ -911,6 +925,14 @@ struct netns_ipvs {
|
||||
#define DEFAULT_SYNC_THRESHOLD 3
|
||||
#define DEFAULT_SYNC_PERIOD 50
|
||||
#define DEFAULT_SYNC_VER 1
|
||||
#define DEFAULT_SYNC_REFRESH_PERIOD (0U * HZ)
|
||||
#define DEFAULT_SYNC_RETRIES 0
|
||||
#define IPVS_SYNC_WAKEUP_RATE 8
|
||||
#define IPVS_SYNC_QLEN_MAX (IPVS_SYNC_WAKEUP_RATE * 4)
|
||||
#define IPVS_SYNC_SEND_DELAY (HZ / 50)
|
||||
#define IPVS_SYNC_CHECK_PERIOD HZ
|
||||
#define IPVS_SYNC_FLUSH_TIME (HZ * 2)
|
||||
#define IPVS_SYNC_PORTS_MAX (1 << 6)
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
|
||||
@@ -921,7 +943,17 @@ static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs)
|
||||
|
||||
static inline int sysctl_sync_period(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return ipvs->sysctl_sync_threshold[1];
|
||||
return ACCESS_ONCE(ipvs->sysctl_sync_threshold[1]);
|
||||
}
|
||||
|
||||
static inline unsigned int sysctl_sync_refresh_period(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return ACCESS_ONCE(ipvs->sysctl_sync_refresh_period);
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_retries(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return ipvs->sysctl_sync_retries;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_ver(struct netns_ipvs *ipvs)
|
||||
@@ -929,6 +961,21 @@ static inline int sysctl_sync_ver(struct netns_ipvs *ipvs)
|
||||
return ipvs->sysctl_sync_ver;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_ports(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return ACCESS_ONCE(ipvs->sysctl_sync_ports);
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return ipvs->sysctl_sync_qlen_max;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return ipvs->sysctl_sync_sock_size;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs)
|
||||
@@ -941,11 +988,36 @@ static inline int sysctl_sync_period(struct netns_ipvs *ipvs)
|
||||
return DEFAULT_SYNC_PERIOD;
|
||||
}
|
||||
|
||||
static inline unsigned int sysctl_sync_refresh_period(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return DEFAULT_SYNC_REFRESH_PERIOD;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_retries(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return DEFAULT_SYNC_RETRIES & 3;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_ver(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return DEFAULT_SYNC_VER;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_ports(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return IPVS_SYNC_QLEN_MAX;
|
||||
}
|
||||
|
||||
static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1185,7 +1257,6 @@ extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
|
||||
extern struct ip_vs_stats ip_vs_stats;
|
||||
extern int sysctl_ip_vs_sync_ver;
|
||||
|
||||
extern void ip_vs_sync_switch_mode(struct net *net, int mode);
|
||||
extern struct ip_vs_service *
|
||||
ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol,
|
||||
const union nf_inet_addr *vaddr, __be16 vport);
|
||||
@@ -1219,7 +1290,7 @@ extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp);
|
||||
extern int start_sync_thread(struct net *net, int state, char *mcast_ifn,
|
||||
__u8 syncid);
|
||||
extern int stop_sync_thread(struct net *net, int state);
|
||||
extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp);
|
||||
extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -321,14 +321,8 @@ extern unsigned int nf_conntrack_max;
|
||||
extern unsigned int nf_conntrack_hash_rnd;
|
||||
void init_nf_conntrack_hash_rnd(void);
|
||||
|
||||
#define NF_CT_STAT_INC(net, count) \
|
||||
__this_cpu_inc((net)->ct.stat->count)
|
||||
#define NF_CT_STAT_INC_ATOMIC(net, count) \
|
||||
do { \
|
||||
local_bh_disable(); \
|
||||
__this_cpu_inc((net)->ct.stat->count); \
|
||||
local_bh_enable(); \
|
||||
} while (0)
|
||||
#define NF_CT_STAT_INC(net, count) __this_cpu_inc((net)->ct.stat->count)
|
||||
#define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count)
|
||||
|
||||
#define MODULE_ALIAS_NFCT_HELPER(helper) \
|
||||
MODULE_ALIAS("nfct-helper-" helper)
|
||||
|
||||
@@ -60,8 +60,8 @@ static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
|
||||
return nf_ct_ext_find(ct, NF_CT_EXT_HELPER);
|
||||
}
|
||||
|
||||
extern int nf_conntrack_helper_init(void);
|
||||
extern void nf_conntrack_helper_fini(void);
|
||||
extern int nf_conntrack_helper_init(struct net *net);
|
||||
extern void nf_conntrack_helper_fini(struct net *net);
|
||||
|
||||
extern int nf_conntrack_broadcast_help(struct sk_buff *skb,
|
||||
unsigned int protoff,
|
||||
|
||||
@@ -26,11 +26,14 @@ struct netns_ct {
|
||||
int sysctl_tstamp;
|
||||
int sysctl_checksum;
|
||||
unsigned int sysctl_log_invalid; /* Log invalid packets */
|
||||
int sysctl_auto_assign_helper;
|
||||
bool auto_assign_helper_warned;
|
||||
#ifdef CONFIG_SYSCTL
|
||||
struct ctl_table_header *sysctl_header;
|
||||
struct ctl_table_header *acct_sysctl_header;
|
||||
struct ctl_table_header *tstamp_sysctl_header;
|
||||
struct ctl_table_header *event_sysctl_header;
|
||||
struct ctl_table_header *helper_sysctl_header;
|
||||
#endif
|
||||
char *slabname;
|
||||
};
|
||||
|
||||
@@ -54,12 +54,14 @@ static int brnf_call_ip6tables __read_mostly = 1;
|
||||
static int brnf_call_arptables __read_mostly = 1;
|
||||
static int brnf_filter_vlan_tagged __read_mostly = 0;
|
||||
static int brnf_filter_pppoe_tagged __read_mostly = 0;
|
||||
static int brnf_pass_vlan_indev __read_mostly = 0;
|
||||
#else
|
||||
#define brnf_call_iptables 1
|
||||
#define brnf_call_ip6tables 1
|
||||
#define brnf_call_arptables 1
|
||||
#define brnf_filter_vlan_tagged 0
|
||||
#define brnf_filter_pppoe_tagged 0
|
||||
#define brnf_pass_vlan_indev 0
|
||||
#endif
|
||||
|
||||
#define IS_IP(skb) \
|
||||
@@ -503,6 +505,19 @@ bridged_dnat:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct net_device *brnf_get_logical_dev(struct sk_buff *skb, const struct net_device *dev)
|
||||
{
|
||||
struct net_device *vlan, *br;
|
||||
|
||||
br = bridge_parent(dev);
|
||||
if (brnf_pass_vlan_indev == 0 || !vlan_tx_tag_present(skb))
|
||||
return br;
|
||||
|
||||
vlan = __vlan_find_dev_deep(br, vlan_tx_tag_get(skb) & VLAN_VID_MASK);
|
||||
|
||||
return vlan ? vlan : br;
|
||||
}
|
||||
|
||||
/* Some common code for IPv4/IPv6 */
|
||||
static struct net_device *setup_pre_routing(struct sk_buff *skb)
|
||||
{
|
||||
@@ -515,7 +530,7 @@ static struct net_device *setup_pre_routing(struct sk_buff *skb)
|
||||
|
||||
nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING;
|
||||
nf_bridge->physindev = skb->dev;
|
||||
skb->dev = bridge_parent(skb->dev);
|
||||
skb->dev = brnf_get_logical_dev(skb, skb->dev);
|
||||
if (skb->protocol == htons(ETH_P_8021Q))
|
||||
nf_bridge->mask |= BRNF_8021Q;
|
||||
else if (skb->protocol == htons(ETH_P_PPP_SES))
|
||||
@@ -774,7 +789,7 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
|
||||
else
|
||||
skb->protocol = htons(ETH_P_IPV6);
|
||||
|
||||
NF_HOOK(pf, NF_INET_FORWARD, skb, bridge_parent(in), parent,
|
||||
NF_HOOK(pf, NF_INET_FORWARD, skb, brnf_get_logical_dev(skb, in), parent,
|
||||
br_nf_forward_finish);
|
||||
|
||||
return NF_STOLEN;
|
||||
@@ -1002,6 +1017,13 @@ static ctl_table brnf_table[] = {
|
||||
.mode = 0644,
|
||||
.proc_handler = brnf_sysctl_call_tables,
|
||||
},
|
||||
{
|
||||
.procname = "bridge-nf-pass-vlan-input-dev",
|
||||
.data = &brnf_pass_vlan_indev,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = brnf_sysctl_call_tables,
|
||||
},
|
||||
{ }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -259,7 +259,9 @@ static struct lock_class_key af_callback_keys[AF_MAX];
|
||||
|
||||
/* Run time adjustable parameters. */
|
||||
__u32 sysctl_wmem_max __read_mostly = SK_WMEM_MAX;
|
||||
EXPORT_SYMBOL(sysctl_wmem_max);
|
||||
__u32 sysctl_rmem_max __read_mostly = SK_RMEM_MAX;
|
||||
EXPORT_SYMBOL(sysctl_rmem_max);
|
||||
__u32 sysctl_wmem_default __read_mostly = SK_WMEM_MAX;
|
||||
__u32 sysctl_rmem_default __read_mostly = SK_RMEM_MAX;
|
||||
|
||||
|
||||
@@ -66,6 +66,3 @@ obj-$(CONFIG_IP_NF_ARP_MANGLE) += arpt_mangle.o
|
||||
|
||||
# just filtering instance of ARP tables for now
|
||||
obj-$(CONFIG_IP_NF_ARPFILTER) += arptable_filter.o
|
||||
|
||||
obj-$(CONFIG_IP_NF_QUEUE) += ip_queue.o
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,28 +25,6 @@ config NF_CONNTRACK_IPV6
|
||||
|
||||
To compile it as a module, choose M here. If unsure, say N.
|
||||
|
||||
config IP6_NF_QUEUE
|
||||
tristate "IP6 Userspace queueing via NETLINK (OBSOLETE)"
|
||||
depends on INET && IPV6 && NETFILTER
|
||||
depends on NETFILTER_ADVANCED
|
||||
---help---
|
||||
|
||||
This option adds a queue handler to the kernel for IPv6
|
||||
packets which enables users to receive the filtered packets
|
||||
with QUEUE target using libipq.
|
||||
|
||||
This option enables the old IPv6-only "ip6_queue" implementation
|
||||
which has been obsoleted by the new "nfnetlink_queue" code (see
|
||||
CONFIG_NETFILTER_NETLINK_QUEUE).
|
||||
|
||||
(C) Fernando Anton 2001
|
||||
IPv64 Project - Work based in IPv64 draft by Arturo Azcorra.
|
||||
Universidad Carlos III de Madrid
|
||||
Universidad Politecnica de Alcala de Henares
|
||||
email: <fanton@it.uc3m.es>.
|
||||
|
||||
To compile it as a module, choose M here. If unsure, say N.
|
||||
|
||||
config IP6_NF_IPTABLES
|
||||
tristate "IP6 tables support (required for filtering)"
|
||||
depends on INET && IPV6
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o
|
||||
obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
|
||||
obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
|
||||
obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o
|
||||
obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o
|
||||
obj-$(CONFIG_IP6_NF_SECURITY) += ip6table_security.o
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -548,6 +548,7 @@ static inline void
|
||||
ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
|
||||
{
|
||||
unsigned int conn_flags;
|
||||
__u32 flags;
|
||||
|
||||
/* if dest is NULL, then return directly */
|
||||
if (!dest)
|
||||
@@ -559,17 +560,19 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
|
||||
conn_flags = atomic_read(&dest->conn_flags);
|
||||
if (cp->protocol != IPPROTO_UDP)
|
||||
conn_flags &= ~IP_VS_CONN_F_ONE_PACKET;
|
||||
flags = cp->flags;
|
||||
/* Bind with the destination and its corresponding transmitter */
|
||||
if (cp->flags & IP_VS_CONN_F_SYNC) {
|
||||
if (flags & IP_VS_CONN_F_SYNC) {
|
||||
/* if the connection is not template and is created
|
||||
* by sync, preserve the activity flag.
|
||||
*/
|
||||
if (!(cp->flags & IP_VS_CONN_F_TEMPLATE))
|
||||
if (!(flags & IP_VS_CONN_F_TEMPLATE))
|
||||
conn_flags &= ~IP_VS_CONN_F_INACTIVE;
|
||||
/* connections inherit forwarding method from dest */
|
||||
cp->flags &= ~IP_VS_CONN_F_FWD_MASK;
|
||||
flags &= ~(IP_VS_CONN_F_FWD_MASK | IP_VS_CONN_F_NOOUTPUT);
|
||||
}
|
||||
cp->flags |= conn_flags;
|
||||
flags |= conn_flags;
|
||||
cp->flags = flags;
|
||||
cp->dest = dest;
|
||||
|
||||
IP_VS_DBG_BUF(7, "Bind-dest %s c:%s:%d v:%s:%d "
|
||||
@@ -584,12 +587,12 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
|
||||
atomic_read(&dest->refcnt));
|
||||
|
||||
/* Update the connection counters */
|
||||
if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) {
|
||||
/* It is a normal connection, so increase the inactive
|
||||
connection counter because it is in TCP SYNRECV
|
||||
state (inactive) or other protocol inacive state */
|
||||
if ((cp->flags & IP_VS_CONN_F_SYNC) &&
|
||||
(!(cp->flags & IP_VS_CONN_F_INACTIVE)))
|
||||
if (!(flags & IP_VS_CONN_F_TEMPLATE)) {
|
||||
/* It is a normal connection, so modify the counters
|
||||
* according to the flags, later the protocol can
|
||||
* update them on state change
|
||||
*/
|
||||
if (!(flags & IP_VS_CONN_F_INACTIVE))
|
||||
atomic_inc(&dest->activeconns);
|
||||
else
|
||||
atomic_inc(&dest->inactconns);
|
||||
@@ -613,14 +616,40 @@ struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp)
|
||||
{
|
||||
struct ip_vs_dest *dest;
|
||||
|
||||
if ((cp) && (!cp->dest)) {
|
||||
dest = ip_vs_find_dest(ip_vs_conn_net(cp), cp->af, &cp->daddr,
|
||||
cp->dport, &cp->vaddr, cp->vport,
|
||||
cp->protocol, cp->fwmark, cp->flags);
|
||||
dest = ip_vs_find_dest(ip_vs_conn_net(cp), cp->af, &cp->daddr,
|
||||
cp->dport, &cp->vaddr, cp->vport,
|
||||
cp->protocol, cp->fwmark, cp->flags);
|
||||
if (dest) {
|
||||
struct ip_vs_proto_data *pd;
|
||||
|
||||
spin_lock(&cp->lock);
|
||||
if (cp->dest) {
|
||||
spin_unlock(&cp->lock);
|
||||
return dest;
|
||||
}
|
||||
|
||||
/* Applications work depending on the forwarding method
|
||||
* but better to reassign them always when binding dest */
|
||||
if (cp->app)
|
||||
ip_vs_unbind_app(cp);
|
||||
|
||||
ip_vs_bind_dest(cp, dest);
|
||||
return dest;
|
||||
} else
|
||||
return NULL;
|
||||
spin_unlock(&cp->lock);
|
||||
|
||||
/* Update its packet transmitter */
|
||||
cp->packet_xmit = NULL;
|
||||
#ifdef CONFIG_IP_VS_IPV6
|
||||
if (cp->af == AF_INET6)
|
||||
ip_vs_bind_xmit_v6(cp);
|
||||
else
|
||||
#endif
|
||||
ip_vs_bind_xmit(cp);
|
||||
|
||||
pd = ip_vs_proto_data_get(ip_vs_conn_net(cp), cp->protocol);
|
||||
if (pd && atomic_read(&pd->appcnt))
|
||||
ip_vs_bind_app(cp, pd->pp);
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
@@ -743,7 +772,8 @@ int ip_vs_check_template(struct ip_vs_conn *ct)
|
||||
static void ip_vs_conn_expire(unsigned long data)
|
||||
{
|
||||
struct ip_vs_conn *cp = (struct ip_vs_conn *)data;
|
||||
struct netns_ipvs *ipvs = net_ipvs(ip_vs_conn_net(cp));
|
||||
struct net *net = ip_vs_conn_net(cp);
|
||||
struct netns_ipvs *ipvs = net_ipvs(net);
|
||||
|
||||
cp->timeout = 60*HZ;
|
||||
|
||||
@@ -808,6 +838,9 @@ static void ip_vs_conn_expire(unsigned long data)
|
||||
atomic_read(&cp->refcnt)-1,
|
||||
atomic_read(&cp->n_control));
|
||||
|
||||
if (ipvs->sync_state & IP_VS_STATE_MASTER)
|
||||
ip_vs_sync_conn(net, cp, sysctl_sync_threshold(ipvs));
|
||||
|
||||
ip_vs_conn_put(cp);
|
||||
}
|
||||
|
||||
@@ -881,6 +914,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p,
|
||||
/* Set its state and timeout */
|
||||
cp->state = 0;
|
||||
cp->timeout = 3*HZ;
|
||||
cp->sync_endtime = jiffies & ~3UL;
|
||||
|
||||
/* Bind its packet transmitter */
|
||||
#ifdef CONFIG_IP_VS_IPV6
|
||||
|
||||
@@ -1613,34 +1613,8 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
|
||||
else
|
||||
pkts = atomic_add_return(1, &cp->in_pkts);
|
||||
|
||||
if ((ipvs->sync_state & IP_VS_STATE_MASTER) &&
|
||||
cp->protocol == IPPROTO_SCTP) {
|
||||
if ((cp->state == IP_VS_SCTP_S_ESTABLISHED &&
|
||||
(pkts % sysctl_sync_period(ipvs)
|
||||
== sysctl_sync_threshold(ipvs))) ||
|
||||
(cp->old_state != cp->state &&
|
||||
((cp->state == IP_VS_SCTP_S_CLOSED) ||
|
||||
(cp->state == IP_VS_SCTP_S_SHUT_ACK_CLI) ||
|
||||
(cp->state == IP_VS_SCTP_S_SHUT_ACK_SER)))) {
|
||||
ip_vs_sync_conn(net, cp);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* Keep this block last: TCP and others with pp->num_states <= 1 */
|
||||
else if ((ipvs->sync_state & IP_VS_STATE_MASTER) &&
|
||||
(((cp->protocol != IPPROTO_TCP ||
|
||||
cp->state == IP_VS_TCP_S_ESTABLISHED) &&
|
||||
(pkts % sysctl_sync_period(ipvs)
|
||||
== sysctl_sync_threshold(ipvs))) ||
|
||||
((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) &&
|
||||
((cp->state == IP_VS_TCP_S_FIN_WAIT) ||
|
||||
(cp->state == IP_VS_TCP_S_CLOSE) ||
|
||||
(cp->state == IP_VS_TCP_S_CLOSE_WAIT) ||
|
||||
(cp->state == IP_VS_TCP_S_TIME_WAIT)))))
|
||||
ip_vs_sync_conn(net, cp);
|
||||
out:
|
||||
cp->old_state = cp->state;
|
||||
if (ipvs->sync_state & IP_VS_STATE_MASTER)
|
||||
ip_vs_sync_conn(net, cp, pkts);
|
||||
|
||||
ip_vs_conn_put(cp);
|
||||
return ret;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user