diff options
-rw-r--r-- | net/netfilter/ipvs/ip_vs_core.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index e2bb3cd41c07..9acdd79a4a05 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -200,7 +200,7 @@ ip_vs_conn_fill_param_persist(const struct ip_vs_service *svc, | |||
200 | static struct ip_vs_conn * | 200 | static struct ip_vs_conn * |
201 | ip_vs_sched_persist(struct ip_vs_service *svc, | 201 | ip_vs_sched_persist(struct ip_vs_service *svc, |
202 | struct sk_buff *skb, | 202 | struct sk_buff *skb, |
203 | __be16 ports[2]) | 203 | __be16 src_port, __be16 dst_port) |
204 | { | 204 | { |
205 | struct ip_vs_conn *cp = NULL; | 205 | struct ip_vs_conn *cp = NULL; |
206 | struct ip_vs_iphdr iph; | 206 | struct ip_vs_iphdr iph; |
@@ -224,8 +224,8 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
224 | 224 | ||
225 | IP_VS_DBG_BUF(6, "p-schedule: src %s:%u dest %s:%u " | 225 | IP_VS_DBG_BUF(6, "p-schedule: src %s:%u dest %s:%u " |
226 | "mnet %s\n", | 226 | "mnet %s\n", |
227 | IP_VS_DBG_ADDR(svc->af, &iph.saddr), ntohs(ports[0]), | 227 | IP_VS_DBG_ADDR(svc->af, &iph.saddr), ntohs(src_port), |
228 | IP_VS_DBG_ADDR(svc->af, &iph.daddr), ntohs(ports[1]), | 228 | IP_VS_DBG_ADDR(svc->af, &iph.daddr), ntohs(dst_port), |
229 | IP_VS_DBG_ADDR(svc->af, &snet)); | 229 | IP_VS_DBG_ADDR(svc->af, &snet)); |
230 | 230 | ||
231 | /* | 231 | /* |
@@ -247,14 +247,14 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
247 | const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) }; | 247 | const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) }; |
248 | __be16 vport = 0; | 248 | __be16 vport = 0; |
249 | 249 | ||
250 | if (ports[1] == svc->port) { | 250 | if (dst_port == svc->port) { |
251 | /* non-FTP template: | 251 | /* non-FTP template: |
252 | * <protocol, caddr, 0, vaddr, vport, daddr, dport> | 252 | * <protocol, caddr, 0, vaddr, vport, daddr, dport> |
253 | * FTP template: | 253 | * FTP template: |
254 | * <protocol, caddr, 0, vaddr, 0, daddr, 0> | 254 | * <protocol, caddr, 0, vaddr, 0, daddr, 0> |
255 | */ | 255 | */ |
256 | if (svc->port != FTPPORT) | 256 | if (svc->port != FTPPORT) |
257 | vport = ports[1]; | 257 | vport = dst_port; |
258 | } else { | 258 | } else { |
259 | /* Note: persistent fwmark-based services and | 259 | /* Note: persistent fwmark-based services and |
260 | * persistent port zero service are handled here. | 260 | * persistent port zero service are handled here. |
@@ -285,7 +285,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
285 | return NULL; | 285 | return NULL; |
286 | } | 286 | } |
287 | 287 | ||
288 | if (ports[1] == svc->port && svc->port != FTPPORT) | 288 | if (dst_port == svc->port && svc->port != FTPPORT) |
289 | dport = dest->port; | 289 | dport = dest->port; |
290 | 290 | ||
291 | /* Create a template | 291 | /* Create a template |
@@ -306,7 +306,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
306 | kfree(param.pe_data); | 306 | kfree(param.pe_data); |
307 | } | 307 | } |
308 | 308 | ||
309 | dport = ports[1]; | 309 | dport = dst_port; |
310 | if (dport == svc->port && dest->port) | 310 | if (dport == svc->port && dest->port) |
311 | dport = dest->port; | 311 | dport = dest->port; |
312 | 312 | ||
@@ -317,8 +317,9 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
317 | /* | 317 | /* |
318 | * Create a new connection according to the template | 318 | * Create a new connection according to the template |
319 | */ | 319 | */ |
320 | ip_vs_conn_fill_param(svc->af, iph.protocol, &iph.saddr, ports[0], | 320 | ip_vs_conn_fill_param(svc->af, iph.protocol, &iph.saddr, src_port, |
321 | &iph.daddr, ports[1], ¶m); | 321 | &iph.daddr, dst_port, ¶m); |
322 | |||
322 | cp = ip_vs_conn_new(¶m, &dest->addr, dport, flags, dest, skb->mark); | 323 | cp = ip_vs_conn_new(¶m, &dest->addr, dport, flags, dest, skb->mark); |
323 | if (cp == NULL) { | 324 | if (cp == NULL) { |
324 | ip_vs_conn_put(ct); | 325 | ip_vs_conn_put(ct); |
@@ -388,7 +389,7 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | |||
388 | */ | 389 | */ |
389 | if (svc->flags & IP_VS_SVC_F_PERSISTENT) { | 390 | if (svc->flags & IP_VS_SVC_F_PERSISTENT) { |
390 | *ignored = 0; | 391 | *ignored = 0; |
391 | return ip_vs_sched_persist(svc, skb, pptr); | 392 | return ip_vs_sched_persist(svc, skb, pptr[0], pptr[1]); |
392 | } | 393 | } |
393 | 394 | ||
394 | /* | 395 | /* |