summaryrefslogtreecommitdiff
path: root/src/network/networkd-dhcp-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-dhcp-common.c')
-rw-r--r--src/network/networkd-dhcp-common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c
index 2537561265..c338c775a7 100644
--- a/src/network/networkd-dhcp-common.c
+++ b/src/network/networkd-dhcp-common.c
@@ -58,9 +58,16 @@ void network_adjust_dhcp(Network *network) {
}
}
+static struct DUID fallback_duid = { .type = DUID_TYPE_EN };
DUID* link_get_duid(Link *link) {
if (link->network->duid.type != _DUID_TYPE_INVALID)
return &link->network->duid;
+ else if (link->hw_addr.length == 0 &&
+ (link->manager->duid.type == DUID_TYPE_LLT ||
+ link->manager->duid.type == DUID_TYPE_LL))
+ /* Fallback to DUID that works without mac addresses.
+ * This is useful for tunnel devices without mac address. */
+ return &fallback_duid;
else
return &link->manager->duid;
}