ipvs: Pass ipvs not net to ip_vs_service_find
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
committed by
Simon Horman
parent
bb2e2a8c95
commit
0a4fd6ce92
+1
-1
@@ -1410,7 +1410,7 @@ extern struct ip_vs_stats ip_vs_stats;
|
|||||||
extern int sysctl_ip_vs_sync_ver;
|
extern int sysctl_ip_vs_sync_ver;
|
||||||
|
|
||||||
struct ip_vs_service *
|
struct ip_vs_service *
|
||||||
ip_vs_service_find(struct net *net, int af, __u32 fwmark, __u16 protocol,
|
ip_vs_service_find(struct netns_ipvs *ipvs, int af, __u32 fwmark, __u16 protocol,
|
||||||
const union nf_inet_addr *vaddr, __be16 vport);
|
const union nf_inet_addr *vaddr, __be16 vport);
|
||||||
|
|
||||||
bool ip_vs_has_real_service(struct net *net, int af, __u16 protocol,
|
bool ip_vs_has_real_service(struct net *net, int af, __u16 protocol,
|
||||||
|
|||||||
@@ -406,11 +406,10 @@ __ip_vs_svc_fwm_find(struct netns_ipvs *ipvs, int af, __u32 fwmark)
|
|||||||
|
|
||||||
/* Find service, called under RCU lock */
|
/* Find service, called under RCU lock */
|
||||||
struct ip_vs_service *
|
struct ip_vs_service *
|
||||||
ip_vs_service_find(struct net *net, int af, __u32 fwmark, __u16 protocol,
|
ip_vs_service_find(struct netns_ipvs *ipvs, int af, __u32 fwmark, __u16 protocol,
|
||||||
const union nf_inet_addr *vaddr, __be16 vport)
|
const union nf_inet_addr *vaddr, __be16 vport)
|
||||||
{
|
{
|
||||||
struct ip_vs_service *svc;
|
struct ip_vs_service *svc;
|
||||||
struct netns_ipvs *ipvs = net_ipvs(net);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check the table hashed by fwmark first
|
* Check the table hashed by fwmark first
|
||||||
@@ -612,7 +611,7 @@ struct ip_vs_dest *ip_vs_find_dest(struct net *net, int svc_af, int dest_af,
|
|||||||
struct ip_vs_service *svc;
|
struct ip_vs_service *svc;
|
||||||
__be16 port = dport;
|
__be16 port = dport;
|
||||||
|
|
||||||
svc = ip_vs_service_find(net, svc_af, fwmark, protocol, vaddr, vport);
|
svc = ip_vs_service_find(net_ipvs(net), svc_af, fwmark, protocol, vaddr, vport);
|
||||||
if (!svc)
|
if (!svc)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (fwmark && (flags & IP_VS_CONN_F_FWD_MASK) != IP_VS_CONN_F_MASQ)
|
if (fwmark && (flags & IP_VS_CONN_F_FWD_MASK) != IP_VS_CONN_F_MASQ)
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
|
|||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
if (likely(!ip_vs_iph_inverse(iph)))
|
if (likely(!ip_vs_iph_inverse(iph)))
|
||||||
svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
|
svc = ip_vs_service_find(ipvs, af, skb->mark, iph->protocol,
|
||||||
&iph->daddr, ports[1]);
|
&iph->daddr, ports[1]);
|
||||||
else
|
else
|
||||||
svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
|
svc = ip_vs_service_find(ipvs, af, skb->mark, iph->protocol,
|
||||||
&iph->saddr, ports[0]);
|
&iph->saddr, ports[0]);
|
||||||
if (svc) {
|
if (svc) {
|
||||||
int ignored;
|
int ignored;
|
||||||
|
|||||||
@@ -70,10 +70,10 @@ tcp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
|
|||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
|
||||||
if (likely(!ip_vs_iph_inverse(iph)))
|
if (likely(!ip_vs_iph_inverse(iph)))
|
||||||
svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
|
svc = ip_vs_service_find(ipvs, af, skb->mark, iph->protocol,
|
||||||
&iph->daddr, ports[1]);
|
&iph->daddr, ports[1]);
|
||||||
else
|
else
|
||||||
svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
|
svc = ip_vs_service_find(ipvs, af, skb->mark, iph->protocol,
|
||||||
&iph->saddr, ports[0]);
|
&iph->saddr, ports[0]);
|
||||||
|
|
||||||
if (svc) {
|
if (svc) {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ udp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
|
|||||||
struct ip_vs_iphdr *iph)
|
struct ip_vs_iphdr *iph)
|
||||||
{
|
{
|
||||||
struct net *net;
|
struct net *net;
|
||||||
|
struct netns_ipvs *ipvs;
|
||||||
struct ip_vs_service *svc;
|
struct ip_vs_service *svc;
|
||||||
struct udphdr _udph, *uh;
|
struct udphdr _udph, *uh;
|
||||||
__be16 _ports[2], *ports = NULL;
|
__be16 _ports[2], *ports = NULL;
|
||||||
@@ -54,12 +55,13 @@ udp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
net = skb_net(skb);
|
net = skb_net(skb);
|
||||||
|
ipvs = net_ipvs(net);
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
if (likely(!ip_vs_iph_inverse(iph)))
|
if (likely(!ip_vs_iph_inverse(iph)))
|
||||||
svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
|
svc = ip_vs_service_find(ipvs, af, skb->mark, iph->protocol,
|
||||||
&iph->daddr, ports[1]);
|
&iph->daddr, ports[1]);
|
||||||
else
|
else
|
||||||
svc = ip_vs_service_find(net, af, skb->mark, iph->protocol,
|
svc = ip_vs_service_find(ipvs, af, skb->mark, iph->protocol,
|
||||||
&iph->saddr, ports[0]);
|
&iph->saddr, ports[0]);
|
||||||
|
|
||||||
if (svc) {
|
if (svc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user