summaryrefslogtreecommitdiff
path: root/src/network/networkd-dhcp4.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2015-03-03 19:49:48 +0100
committerTom Gundersen <teg@jklm.no>2015-03-04 11:01:39 +0100
commit3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0 (patch)
treec08352984781c8e266a7fa05e6db7b0c16158b38 /src/network/networkd-dhcp4.c
parentff88a301e93cf1bddbaa7faa981f390a2a81a4bb (diff)
networkd: Make DHCP client ID creation configurable
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r--src/network/networkd-dhcp4.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index c3d0e3d39d..38321905e6 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -661,5 +661,21 @@ int dhcp4_configure(Link *link) {
return r;
}
+ switch (link->network->dhcp_client_identifier) {
+ case DHCP_CLIENT_ID_DUID:
+ /* Library defaults to this. */
+ break;
+ case DHCP_CLIENT_ID_MAC:
+ r = sd_dhcp_client_set_client_id(link->dhcp_client,
+ ARPHRD_ETHER,
+ (const uint8_t *) &link->mac,
+ sizeof (link->mac));
+ if (r < 0)
+ return r;
+ break;
+ default:
+ assert_not_reached("Unknown client identifier type.");
+ }
+
return 0;
}