diff options
| author | Julian Anastasov <ja@ssi.bg> | 2014-09-09 19:40:30 -0400 |
|---|---|---|
| committer | Simon Horman <horms@verge.net.au> | 2014-09-15 20:03:38 -0400 |
| commit | cf34e646dad101170e00712fe51986cbcdad3044 (patch) | |
| tree | bdcec11114aab038d9c936790c6bc9611dbeaf54 | |
| parent | f7fa38006983c0933a550fa790a3b3d3856394d1 (diff) | |
ipvs: address family of LBLCR entry depends on svc family
The LBLCR entries should use svc->af, not dest->af.
Needed to support svc->af != dest->af.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Alex Gartrell <agartrell@fb.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_lblcr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 3f21a2f47de1..2229d2d8bbe0 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c | |||
| @@ -362,18 +362,18 @@ ip_vs_lblcr_get(int af, struct ip_vs_lblcr_table *tbl, | |||
| 362 | */ | 362 | */ |
| 363 | static inline struct ip_vs_lblcr_entry * | 363 | static inline struct ip_vs_lblcr_entry * |
| 364 | ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr, | 364 | ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr, |
| 365 | struct ip_vs_dest *dest) | 365 | u16 af, struct ip_vs_dest *dest) |
| 366 | { | 366 | { |
| 367 | struct ip_vs_lblcr_entry *en; | 367 | struct ip_vs_lblcr_entry *en; |
| 368 | 368 | ||
| 369 | en = ip_vs_lblcr_get(dest->af, tbl, daddr); | 369 | en = ip_vs_lblcr_get(af, tbl, daddr); |
| 370 | if (!en) { | 370 | if (!en) { |
| 371 | en = kmalloc(sizeof(*en), GFP_ATOMIC); | 371 | en = kmalloc(sizeof(*en), GFP_ATOMIC); |
| 372 | if (!en) | 372 | if (!en) |
| 373 | return NULL; | 373 | return NULL; |
| 374 | 374 | ||
| 375 | en->af = dest->af; | 375 | en->af = af; |
| 376 | ip_vs_addr_copy(dest->af, &en->addr, daddr); | 376 | ip_vs_addr_copy(af, &en->addr, daddr); |
| 377 | en->lastuse = jiffies; | 377 | en->lastuse = jiffies; |
| 378 | 378 | ||
| 379 | /* initialize its dest set */ | 379 | /* initialize its dest set */ |
| @@ -706,13 +706,13 @@ ip_vs_lblcr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb, | |||
| 706 | /* If we fail to create a cache entry, we'll just use the valid dest */ | 706 | /* If we fail to create a cache entry, we'll just use the valid dest */ |
| 707 | spin_lock_bh(&svc->sched_lock); | 707 | spin_lock_bh(&svc->sched_lock); |
| 708 | if (!tbl->dead) | 708 | if (!tbl->dead) |
| 709 | ip_vs_lblcr_new(tbl, &iph->daddr, dest); | 709 | ip_vs_lblcr_new(tbl, &iph->daddr, svc->af, dest); |
| 710 | spin_unlock_bh(&svc->sched_lock); | 710 | spin_unlock_bh(&svc->sched_lock); |
| 711 | 711 | ||
| 712 | out: | 712 | out: |
| 713 | IP_VS_DBG_BUF(6, "LBLCR: destination IP address %s --> server %s:%d\n", | 713 | IP_VS_DBG_BUF(6, "LBLCR: destination IP address %s --> server %s:%d\n", |
| 714 | IP_VS_DBG_ADDR(svc->af, &iph->daddr), | 714 | IP_VS_DBG_ADDR(svc->af, &iph->daddr), |
| 715 | IP_VS_DBG_ADDR(svc->af, &dest->addr), ntohs(dest->port)); | 715 | IP_VS_DBG_ADDR(dest->af, &dest->addr), ntohs(dest->port)); |
| 716 | 716 | ||
| 717 | return dest; | 717 | return dest; |
| 718 | } | 718 | } |
