diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 6f152c9e14..f263c2c0b2 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -1550,8 +1550,11 @@ Table=1234
IPServiceType=
- Takes string; CS6 or CS4. Used to set IP
- service type to CS6 (network control) or CS4 (Realtime). Defaults to CS6.
+ Takes one of the special values none, CS6, or
+ CS4. When none no IP sevice type is set to the packet
+ sent from the DHCPv4 client. When CS6 (network control) or
+ CS4 (realtime), the corresponding service type will be set. Defaults to
+ CS6.
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index b8efb76858..81faf48448 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -1704,17 +1704,24 @@ int config_parse_dhcp_ip_service_type(
void *data,
void *userdata) {
+ int *tos = data;
+
assert(filename);
assert(lvalue);
assert(rvalue);
+ assert(data);
- if (streq(rvalue, "CS4"))
- *((int *)data) = IPTOS_CLASS_CS4;
+ if (isempty(rvalue))
+ *tos = -1; /* use sd_dhcp_client's default (currently, CS6). */
+ else if (streq(rvalue, "none"))
+ *tos = 0;
+ else if (streq(rvalue, "CS4"))
+ *tos = IPTOS_CLASS_CS4;
else if (streq(rvalue, "CS6"))
- *((int *)data) = IPTOS_CLASS_CS6;
+ *tos = IPTOS_CLASS_CS6;
else
log_syntax(unit, LOG_WARNING, filename, line, 0,
- "Failed to parse IPServiceType type '%s', ignoring.", rvalue);
+ "Failed to parse %s=, ignoring assignment: %s", lvalue, rvalue);
return 0;
}