From 9afcea251bdc895ffd49cb11f455fd636fdf817b Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 7 Aug 2023 22:53:49 +0200 Subject: dhcp: T5428: always release lease from default VRF Otherwise packet can be received in a VRF that was already deleted. Image of the following CLI commands: del interface ethernet eth0 address dhcp del interface ethernet eth0 vrf red del vrf name red VRF could be deleted even if dhclient release was not yet completely processed. --- data/templates/dhcp-client/override.conf.j2 | 2 +- src/systemd/dhclient@.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/templates/dhcp-client/override.conf.j2 b/data/templates/dhcp-client/override.conf.j2 index d4d5eb49f..03fd71bf1 100644 --- a/data/templates/dhcp-client/override.conf.j2 +++ b/data/templates/dhcp-client/override.conf.j2 @@ -10,6 +10,6 @@ ConditionPathExists={{ isc_dhclient_dir }}/dhclient_%i.conf ExecStart= ExecStart={{ vrf_command }}/sbin/dhclient -4 {{ dhclient_options }} {{ ifname }} ExecStop= -ExecStop={{ vrf_command }}/sbin/dhclient -4 {{ dhclient_options }} {{ ifname }} -r +ExecStop=/sbin/dhclient -4 -r {{ dhclient_options }} {{ ifname }} WorkingDirectory={{ isc_dhclient_dir }} PIDFile={{ isc_dhclient_dir }}/dhclient_%i.pid diff --git a/src/systemd/dhclient@.service b/src/systemd/dhclient@.service index 6d41de232..099f7ed52 100644 --- a/src/systemd/dhclient@.service +++ b/src/systemd/dhclient@.service @@ -7,7 +7,7 @@ After=vyos-router.service [Service] Type=exec ExecStart=/sbin/dhclient -4 -d $DHCLIENT_OPTS -ExecStop=/sbin/dhclient -4 -d $DHCLIENT_OPTS -r +ExecStop=/sbin/dhclient -4 -r $DHCLIENT_OPTS Restart=always RestartPreventExitStatus= RestartSec=10 -- cgit v1.2.3