From 6d0650bbcd26a7147857548c5f20949d2c986f76 Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Tue, 20 May 2014 11:02:14 +0200 Subject: [PATCH] CLOUDSTACK-6665: A fix for vpc routers not releasing dhcp leases. Signed-off-by: Sebastien Goasguen --- systemvm/patches/debian/config/root/edithosts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/root/edithosts.sh b/systemvm/patches/debian/config/root/edithosts.sh index 57ee7dc1d64..0ff6cc5280b 100755 --- a/systemvm/patches/debian/config/root/edithosts.sh +++ b/systemvm/patches/debian/config/root/edithosts.sh @@ -99,7 +99,7 @@ if [ $dnsmasq_managed_lease -eq 1 ] then #release previous dhcp lease if present logger -t cloud "edithosts: releasing $ipv4" - dhcp_release eth0 $ipv4 $(grep "$ipv4 " $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 + dhcp_release $(ip route get "$ipv4/32" | grep " dev " | sed -e "s/^.* dev \([^ ]*\) .*$/\1/g") $ipv4 $(grep "$ipv4 " $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 logger -t cloud "edithosts: released $ipv4" fi