All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipvsadm: Fix svc->pe_name conditional
@ 2013-08-18 16:41 Ryan O'Hara
  2013-08-18 18:13 ` Julian Anastasov
  0 siblings, 1 reply; 8+ messages in thread
From: Ryan O'Hara @ 2013-08-18 16:41 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: lvs-devel, Ryan O'Hara

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@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-20 14:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-18 16:41 [PATCH] ipvsadm: Fix svc->pe_name conditional Ryan O'Hara
2013-08-18 18:13 ` Julian Anastasov
2013-08-19 14:52   ` Ryan O'Hara
2013-08-19 15:27     ` Julian Anastasov
2013-08-19 20:40       ` Ryan O'Hara
2013-08-20  0:28         ` Simon Horman
2013-08-20  6:35         ` Julian Anastasov
2013-08-20 14:00           ` Ryan O'Hara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.