Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipvs: address family of LBLC entry depends on svc family

The LBLC 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>

authored by

Julian Anastasov and committed by
Simon Horman
f7fa3800 8052ba29

+6 -6
+6 -6
net/netfilter/ipvs/ip_vs_lblc.c
··· 199 199 */ 200 200 static inline struct ip_vs_lblc_entry * 201 201 ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr, 202 - struct ip_vs_dest *dest) 202 + u16 af, struct ip_vs_dest *dest) 203 203 { 204 204 struct ip_vs_lblc_entry *en; 205 205 206 - en = ip_vs_lblc_get(dest->af, tbl, daddr); 206 + en = ip_vs_lblc_get(af, tbl, daddr); 207 207 if (en) { 208 208 if (en->dest == dest) 209 209 return en; ··· 213 213 if (!en) 214 214 return NULL; 215 215 216 - en->af = dest->af; 217 - ip_vs_addr_copy(dest->af, &en->addr, daddr); 216 + en->af = af; 217 + ip_vs_addr_copy(af, &en->addr, daddr); 218 218 en->lastuse = jiffies; 219 219 220 220 ip_vs_dest_hold(dest); ··· 521 521 /* If we fail to create a cache entry, we'll just use the valid dest */ 522 522 spin_lock_bh(&svc->sched_lock); 523 523 if (!tbl->dead) 524 - ip_vs_lblc_new(tbl, &iph->daddr, dest); 524 + ip_vs_lblc_new(tbl, &iph->daddr, svc->af, dest); 525 525 spin_unlock_bh(&svc->sched_lock); 526 526 527 527 out: 528 528 IP_VS_DBG_BUF(6, "LBLC: destination IP address %s --> server %s:%d\n", 529 529 IP_VS_DBG_ADDR(svc->af, &iph->daddr), 530 - IP_VS_DBG_ADDR(svc->af, &dest->addr), ntohs(dest->port)); 530 + IP_VS_DBG_ADDR(dest->af, &dest->addr), ntohs(dest->port)); 531 531 532 532 return dest; 533 533 }