[strongSwan-dev] [PATCH] updown: Assign the first virtual IP to PLUTO_MY_SOURCEIP

Volker Rümelin vr_strongswan at t-online.de
Mon Mar 10 21:00:34 CET 2014


The old code sets environment variable PLUTO_MY_SOURCEIP for each
virtual IP, which has the effect to assign the last virtual IP.
---
 src/libcharon/plugins/updown/updown_listener.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libcharon/plugins/updown/updown_listener.c b/src/libcharon/plugins/updown/updown_listener.c
index 2c3f932..52891fc 100644
--- a/src/libcharon/plugins/updown/updown_listener.c
+++ b/src/libcharon/plugins/updown/updown_listener.c
@@ -154,6 +154,7 @@ static char *make_vip_vars(private_updown_listener_t *this, ike_sa_t *ike_sa)
 			snprintf(current, sizeof(current),
 						 "PLUTO_MY_SOURCEIP='%H' ", host);
 			strncat(total, current, sizeof(total) - strlen(total) - 1);
+			first = FALSE;
 		}
 		switch (host->get_family(host))
 		{
-- 
1.8.4.5




More information about the Dev mailing list