chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
localectl: fix localectl set-x11-keymap syntax description
[elogind.git]
/
src
/
network
/
networkd-link.c
diff --git
a/src/network/networkd-link.c
b/src/network/networkd-link.c
index a88cf48d9da7b6a9f8a3b3cdc1ceedf1983bb879..26ef0feaae2d6c635d9fe6284e0db28adfb6b635 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;
@@
-344,15
+344,6
@@
static int link_stop_clients(Link *link) {
}
}
}
}
- if (link->dhcp_server) {
- k = sd_dhcp_server_stop(link->dhcp_server);
- if (k < 0) {
- log_warning_link(link, "Could not stop DHCPv4 server: %s",
- strerror(-r));
- r = k;
- }
- }
-
if(link->icmp6_router_discovery) {
if (link->dhcp6_client) {
if(link->icmp6_router_discovery) {
if (link->dhcp6_client) {
@@
-725,8
+716,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
+900,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
+1468,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
+1482,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
+1640,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
+1653,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",
@@
-1785,6
+1776,8
@@
int link_save(Link *link) {
char **address, **domain;
bool space;
char **address, **domain;
bool space;
+ fprintf(f, "NETWORK_FILE=%s\n", link->network->filename);
+
fputs("DNS=", f);
space = false;
STRV_FOREACH(address, link->network->dns) {
fputs("DNS=", f);
space = false;
STRV_FOREACH(address, link->network->dns) {