From 2451cd2512fd3d267d4b906d71cd675d6e903a2e Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 14 Apr 2025 22:37:26 +0200 Subject: [PATCH] networkd: reduce the IPv4 DAD timeout to 200ms The original timeout of 7 seconds is very long for today's networks. Reduce it to 200ms. Note that this change also affects IPv4 link-local addressing. --- NEWS | 7 +++++++ man/systemd.network.xml | 2 +- src/libsystemd-network/sd-ipv4acd.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index af63649a166..147e5511a21 100644 --- a/NEWS +++ b/NEWS @@ -109,6 +109,13 @@ CHANGES WITH 258 in spe: * The meson option 'integration-tests' has been deprecated, and will be removed in a future release. + systemd-networkd and networkctl: + + * systemd-networkd now supports configuring the timeout for IPv4 + Duplicate Address Detection via a new setting + IPv4DuplicateAddressDetectionTimeoutSec=. The default timeout value + has been changed from 7 seconds to 200 milliseconds. + — , CHANGES WITH 257: diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 433ec4bb0da..98df365f1b7 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -996,7 +996,7 @@ DuplicateAddressDetection=none Configures the maximum timeout for IPv4 Duplicate Address Detection (RFC 5227). Must be a value between 1 millisecond and 60 seconds. If set, Duplicate Address Detection takes a randomized - time between 57% (4/7) and 100% of the given value. If unset, defaults to 7 seconds. + time between 57% (4/7) and 100% of the given value. If unset, defaults to 200 milliseconds. diff --git a/src/libsystemd-network/sd-ipv4acd.c b/src/libsystemd-network/sd-ipv4acd.c index 82d5fa75689..17db4a53f71 100644 --- a/src/libsystemd-network/sd-ipv4acd.c +++ b/src/libsystemd-network/sd-ipv4acd.c @@ -43,7 +43,7 @@ #define MAX_CONFLICTS 10U /* Default timeout from the RFC */ -#define DEFAULT_ACD_TIMEOUT_USEC (7 * USEC_PER_SEC) +#define DEFAULT_ACD_TIMEOUT_USEC (200 * USEC_PER_MSEC) typedef enum IPv4ACDState { IPV4ACD_STATE_INIT, -- 2.47.3