diff options
author | Hans Schillstrom <hans.schillstrom@ericsson.com> | 2011-01-03 08:44:43 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-01-12 20:30:26 -0500 |
commit | fc723250c9cb046cc19833a2b1c4309bbf59ac36 (patch) | |
tree | fa8cd33ad9e020549dd8c6389f311d25e495ca7d /net/netfilter/ipvs/ip_vs_proto_sctp.c | |
parent | 61b1ab4583e275af216c8454b9256de680499b19 (diff) |
IPVS: netns to services part 1
Services hash tables got netns ptr a hash arg,
While Real Servers (rs) has been moved to ipvs struct.
Two new inline functions added to get net ptr from skb.
Since ip_vs is called from different contexts there is two
places to dig for the net ptr skb->dev or skb->sk
this is handled in skb_net() and skb_sknet()
Global functions, ip_vs_service_get() ip_vs_lookup_real_service()
etc have got struct net *net as first param.
If possible get net ptr skb etc,
- if not &init_net is used at this early stage of patching.
ip_vs_ctl.c procfs not ready for netns yet.
*v3
Comments by Julian
- __ip_vs_service_find and __ip_vs_svc_fwm_find are fast path,
net_eq(svc->net, net) so the check is at the end now.
- net = skb_net(skb) in ip_vs_out moved after check for skb_dst.
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_proto_sctp.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_proto_sctp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c index a315159983a..521b827083f 100644 --- a/net/netfilter/ipvs/ip_vs_proto_sctp.c +++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c | |||
@@ -12,6 +12,7 @@ static int | |||
12 | sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp, | 12 | sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp, |
13 | int *verdict, struct ip_vs_conn **cpp) | 13 | int *verdict, struct ip_vs_conn **cpp) |
14 | { | 14 | { |
15 | struct net *net; | ||
15 | struct ip_vs_service *svc; | 16 | struct ip_vs_service *svc; |
16 | sctp_chunkhdr_t _schunkh, *sch; | 17 | sctp_chunkhdr_t _schunkh, *sch; |
17 | sctp_sctphdr_t *sh, _sctph; | 18 | sctp_sctphdr_t *sh, _sctph; |
@@ -27,9 +28,9 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp, | |||
27 | sizeof(_schunkh), &_schunkh); | 28 | sizeof(_schunkh), &_schunkh); |
28 | if (sch == NULL) | 29 | if (sch == NULL) |
29 | return 0; | 30 | return 0; |
30 | 31 | net = skb_net(skb); | |
31 | if ((sch->type == SCTP_CID_INIT) && | 32 | if ((sch->type == SCTP_CID_INIT) && |
32 | (svc = ip_vs_service_get(af, skb->mark, iph.protocol, | 33 | (svc = ip_vs_service_get(net, af, skb->mark, iph.protocol, |
33 | &iph.daddr, sh->dest))) { | 34 | &iph.daddr, sh->dest))) { |
34 | int ignored; | 35 | int ignored; |
35 | 36 | ||