lifecycle: kill dhcp client when called from ifdown

This commit is contained in:
Ariadne Conill 2020-07-23 09:45:52 -06:00
parent 2c556d8655
commit 5013dcf6c9

View file

@ -116,6 +116,13 @@ handle_down(const struct lif_execute_opts *opts, struct lif_interface *iface, co
return false; return false;
} }
if (iface->is_dhcp)
{
/* XXX: determine which dhcp client we should use */
if (!lif_execute_fmt(opts, NULL, "/bin/kill $(cat /var/run/udhcpc.%s.pid)", lifname))
return false;
}
skip_addresses: skip_addresses:
if (!lif_execute_fmt(opts, NULL, "/sbin/ip link set down dev %s", lifname)) if (!lif_execute_fmt(opts, NULL, "/sbin/ip link set down dev %s", lifname))
return false; return false;