summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-10-08 14:15:45 -0500
committerTom Gundersen <teg@jklm.no>2014-10-11 12:15:54 +0200
commit76253e73f9c9c24fec755e485516f3b55d0707b4 (patch)
treeae99dc09b50a8d8de2428dbc6e6b57f51ef6776c /src/network
parent5482192e5774f52f2af0665a3b58539295e9c0a4 (diff)
sd-dhcp-client: support non-Ethernet hardware addresses
Like Infiniband. See RFC 4390 section 2.1 for details on DHCP and Infiniband; chaddr is zeroed, hlen is set to 0, and htype is set to ARPHRD_INFINIBAND because IB hardware addresses are 20 bytes in length.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-dhcp4.c4
-rw-r--r--src/network/networkd-link.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index e451af8643..63bfa86f99 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -599,7 +599,9 @@ int dhcp4_configure(Link *link) {
if (r < 0)
return r;
- r = sd_dhcp_client_set_mac(link->dhcp_client, &link->mac);
+ r = sd_dhcp_client_set_mac(link->dhcp_client,
+ (const uint8_t *) &link->mac,
+ sizeof (link->mac), ARPHRD_ETHER);
if (r < 0)
return r;
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index dcbe38a90a..c6e173fbc6 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -909,7 +909,9 @@ static void icmp6_router_handler(sd_icmp6_nd *nd, int event, void *userdata) {
return;
}
- r = sd_dhcp6_client_set_mac(link->dhcp6_client, &link->mac);
+ r = sd_dhcp6_client_set_mac(link->dhcp6_client,
+ (const uint8_t *) &link->mac,
+ sizeof (link->mac), ARPHRD_ETHER);
if (r < 0) {
link->dhcp6_client = sd_dhcp6_client_unref(link->dhcp6_client);
return;
@@ -1647,7 +1649,9 @@ int link_update(Link *link, sd_rtnl_message *m) {
if (link->dhcp_client) {
r = sd_dhcp_client_set_mac(link->dhcp_client,
- &link->mac);
+ (const uint8_t *) &link->mac,
+ sizeof (link->mac),
+ ARPHRD_ETHER);
if (r < 0) {
log_warning_link(link,
"Could not update MAC address in DHCP client: %s",
@@ -1658,7 +1662,9 @@ int link_update(Link *link, sd_rtnl_message *m) {
if (link->dhcp6_client) {
r = sd_dhcp6_client_set_mac(link->dhcp6_client,
- &link->mac);
+ (const uint8_t *) &link->mac,
+ sizeof (link->mac),
+ ARPHRD_ETHER);
if (r < 0) {
log_warning_link(link,
"Could not update MAC address in DHCPv6 client: %s",