LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

[PATCH] ipvsadm: Fix svc->pe_name conditional

To: Julian Anastasov <ja@xxxxxx>
Subject: [PATCH] ipvsadm: Fix svc->pe_name conditional
Cc: lvs-devel@xxxxxxxxxxxxxxx, "Ryan O'Hara" <rohara@xxxxxxxxxx>
From: "Ryan O'Hara" <rohara@xxxxxxxxxx>
Date: Sun, 18 Aug 2013 11:41:03 -0500
The pe_name in ipvs_service_t is an array, so comparing it NULL has no
effect. Use strlen to see if pe_name is set.

Signed-off-by: Ryan O'Hara <rohara@xxxxxxxxxx>
---
 libipvs/libipvs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
index c3c3b0a..ebc46e9 100644
--- a/libipvs/libipvs.c
+++ b/libipvs/libipvs.c
@@ -229,7 +229,7 @@ static int ipvs_nl_fill_service_attr(struct nl_msg *msg, 
ipvs_service_t *svc)
        }
 
        NLA_PUT_STRING(msg, IPVS_SVC_ATTR_SCHED_NAME, svc->sched_name);
-       if (svc->pe_name)
+       if (strlen(svc->pe_name))
                NLA_PUT_STRING(msg, IPVS_SVC_ATTR_PE_NAME, svc->pe_name);
        NLA_PUT(msg, IPVS_SVC_ATTR_FLAGS, sizeof(flags), &flags);
        NLA_PUT_U32(msg, IPVS_SVC_ATTR_TIMEOUT, svc->timeout);
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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