]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
dhcpcd.exe: Flush any configured IP addresses on shutdown
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Sep 2022 10:21:31 +0000 (12:21 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Oct 2022 14:00:46 +0000 (16:00 +0200)
This allows us to start with a fresh interface every time dhcpcd is
being restarted.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/networking/dhcpcd.exe

index be6d63708862a130475202765e37907eaefe2b4d..f79d5d16dd6a643d502f1f71680b9697a4225e6d 100644 (file)
@@ -84,6 +84,11 @@ dhcpcd_down()
                        run_subdir ${rc_base}/init.d/networking/red.down/
                fi
        fi
+
+       # Remove any configured IP address from the device
+       ip addr flush dev "${interface}" &>/dev/null
+
+       return 0
 }
 
 # Called when dhcpcd relies on a third party to configure an IP address