chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: add and improve hashmap tests
[elogind.git]
/
src
/
network
/
networkd-link.c
diff --git
a/src/network/networkd-link.c
b/src/network/networkd-link.c
index 11ac1307d88ccb85302487a33debcf5745acf99c..c6e173fbc6160fc84d59a6abd5fb9672874a7eef 100644
(file)
--- a/
src/network/networkd-link.c
+++ b/
src/network/networkd-link.c
@@
-206,7
+206,7
@@
static int link_new(Manager *manager, sd_rtnl_message *message, Link **ret) {
if (r < 0)
return -ENOMEM;
if (r < 0)
return -ENOMEM;
- r = hashmap_ensure_allocated(&manager->links, NULL
, NULL
);
+ r = hashmap_ensure_allocated(&manager->links, NULL);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-725,8
+725,6
@@
static int set_hostname_handler(sd_bus *bus, sd_bus_message *m, void *userdata,
return 1;
r = sd_bus_message_get_errno(m);
return 1;
r = sd_bus_message_get_errno(m);
- if (r < 0)
- r = -r;
if (r > 0)
log_warning_link(link, "Could not set hostname: %s",
strerror(r));
if (r > 0)
log_warning_link(link, "Could not set hostname: %s",
strerror(r));
@@
-911,7
+909,9
@@
static void icmp6_router_handler(sd_icmp6_nd *nd, int event, void *userdata) {
return;
}
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;
if (r < 0) {
link->dhcp6_client = sd_dhcp6_client_unref(link->dhcp6_client);
return;
@@
-1477,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)",
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)",
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;
LIST_PREPEND(addresses, link->addresses, address);
address = NULL;
@@
-1493,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)",
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)",
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:
break;
default:
@@
-1653,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,
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",
if (r < 0) {
log_warning_link(link,
"Could not update MAC address in DHCP client: %s",
@@
-1664,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,
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",
if (r < 0) {
log_warning_link(link,
"Could not update MAC address in DHCPv6 client: %s",