diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2020-10-26 18:07:49 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2020-10-28 14:44:43 +0100 |
commit | b8162cd200c69be509475b8f2184a5ac651fc2b0 (patch) | |
tree | a6b07641f3794fd3b204e7a9c2f2a8a26e163ba1 /src/network/networkd-dhcp4.c | |
parent | 4fc8a29a7e06debb65f4e2651a03804beb41f781 (diff) | |
download | systemd-b8162cd200c69be509475b8f2184a5ac651fc2b0.tar.gz |
network: store full hardware address in Link struct
This passes the legacy ethernet address to functions in a lot of places,
which all will need migrated to handle arbitrary size hardware addresses
eventually.
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r-- | src/network/networkd-dhcp4.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index bb8c34f7cc..5255ec3e1c 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -650,7 +650,7 @@ static int dhcp4_configure_dad(Link *link) { if (r < 0) return r; - r = sd_ipv4acd_set_mac(link->dhcp_acd, &link->mac); + r = sd_ipv4acd_set_mac(link->dhcp_acd, &link->hw_addr.addr.ether); if (r < 0) return r; @@ -672,7 +672,7 @@ static int dhcp4_dad_update_mac(Link *link) { if (r < 0) return r; - r = sd_ipv4acd_set_mac(link->dhcp_acd, &link->mac); + r = sd_ipv4acd_set_mac(link->dhcp_acd, &link->hw_addr.addr.ether); if (r < 0) return r; @@ -1274,8 +1274,8 @@ static int dhcp4_set_client_identifier(Link *link) { 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)); + link->hw_addr.addr.bytes, + link->hw_addr.length); if (r < 0) return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set client ID: %m"); break; @@ -1325,8 +1325,8 @@ int dhcp4_configure(Link *link) { return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to initialize DHCP4 client: %m"); r = sd_dhcp_client_set_mac(link->dhcp_client, - (const uint8_t *) &link->mac, - sizeof (link->mac), ARPHRD_ETHER); + link->hw_addr.addr.bytes, + link->hw_addr.length, ARPHRD_ETHER); if (r < 0) return log_link_error_errno(link, r, "DHCP4 CLIENT: Failed to set MAC address: %m"); @@ -1484,7 +1484,7 @@ int dhcp4_update_mac(Link *link) { if (!link->dhcp_client) return 0; - r = sd_dhcp_client_set_mac(link->dhcp_client, (const uint8_t *) &link->mac, sizeof (link->mac), ARPHRD_ETHER); + r = sd_dhcp_client_set_mac(link->dhcp_client, link->hw_addr.addr.bytes, link->hw_addr.length, ARPHRD_ETHER); if (r < 0) return r; |