[PATCH 11/15] ipvs: address family of LBLC entry depends on svc family

To: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Subject: [PATCH 11/15] ipvs: address family of LBLC entry depends on svc family
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Alex Gartrell <agartrell@xxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Thu, 18 Sep 2014 09:25:57 +0900
From: Julian Anastasov <ja@xxxxxx>

The LBLC entries should use svc->af, not dest->af.
Needed to support svc->af != dest->af.

Signed-off-by: Julian Anastasov <ja@xxxxxx>
Signed-off-by: Alex Gartrell <agartrell@xxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
 net/netfilter/ipvs/ip_vs_lblc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index 547ff33..127f140 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -199,11 +199,11 @@ ip_vs_lblc_get(int af, struct ip_vs_lblc_table *tbl,
 static inline struct ip_vs_lblc_entry *
 ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr,
-              struct ip_vs_dest *dest)
+              u16 af, struct ip_vs_dest *dest)
        struct ip_vs_lblc_entry *en;
-       en = ip_vs_lblc_get(dest->af, tbl, daddr);
+       en = ip_vs_lblc_get(af, tbl, daddr);
        if (en) {
                if (en->dest == dest)
                        return en;
@@ -213,8 +213,8 @@ ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union 
nf_inet_addr *daddr,
        if (!en)
                return NULL;
-       en->af = dest->af;
-       ip_vs_addr_copy(dest->af, &en->addr, daddr);
+       en->af = af;
+       ip_vs_addr_copy(af, &en->addr, daddr);
        en->lastuse = jiffies;
@@ -521,13 +521,13 @@ ip_vs_lblc_schedule(struct ip_vs_service *svc, const 
struct sk_buff *skb,
        /* If we fail to create a cache entry, we'll just use the valid dest */
        if (!tbl->dead)
-               ip_vs_lblc_new(tbl, &iph->daddr, dest);
+               ip_vs_lblc_new(tbl, &iph->daddr, svc->af, dest);
        IP_VS_DBG_BUF(6, "LBLC: destination IP address %s --> server %s:%d\n",
                      IP_VS_DBG_ADDR(svc->af, &iph->daddr),
-                     IP_VS_DBG_ADDR(svc->af, &dest->addr), ntohs(dest->port));
+                     IP_VS_DBG_ADDR(dest->af, &dest->addr), ntohs(dest->port));
        return dest;

To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

<Prev in Thread] Current Thread [Next in Thread>