chiark / gitweb /
test: add and improve hashmap tests
[elogind.git] / src / network / networkd-link.c
index 427f6953c5f1ccef7597c1704ecb8a1bee9355f0..c6e173fbc6160fc84d59a6abd5fb9672874a7eef 100644 (file)
@@ -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;
@@ -1475,12 +1477,10 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message,
         case RTM_NEWADDR:
                 if (!address_dropped)
                         log_debug_link(link, "added address: %s/%u (valid for %s)",
-                                       buf, address->prefixlen,
-                                       strna(valid_str));
+                                       buf, address->prefixlen, valid_str);
                 else
                         log_debug_link(link, "updated address: %s/%u (valid for %s)",
-                                       buf, address->prefixlen,
-                                       strna(valid_str));
+                                       buf, address->prefixlen, valid_str);
 
                 LIST_PREPEND(addresses, link->addresses, address);
                 address = NULL;
@@ -1491,15 +1491,13 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message,
         case RTM_DELADDR:
                 if (address_dropped) {
                         log_debug_link(link, "removed address: %s/%u (valid for %s)",
-                                       buf, address->prefixlen,
-                                       strna(valid_str));
+                                       buf, address->prefixlen, valid_str);
 
                         link_save(link);
                 } else
                         log_warning_link(link,
                                          "removing non-existent address: %s/%u (valid for %s)",
-                                         buf, address->prefixlen,
-                                         strna(valid_str));
+                                         buf, address->prefixlen, valid_str);
 
                 break;
         default:
@@ -1651,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",
@@ -1662,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",