summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-09-28 17:16:12 +0200
committerTom Gundersen <teg@jklm.no>2015-10-21 02:35:31 +0200
commit36c32f6120a0c3fe19be5aeaa1926e179e8c29ba (patch)
treec10e5f502a2757fa9e1bf1499063ec272a5c7039 /src/network/networkd-manager.c
parent8012cd391932d58b44332df106d426a360faf0a6 (diff)
networkd: address - factor out address_update()
Call back into link_check_ready() whenever an address state change may have made a link ready.
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 2cd4f4fef7..9a7e71fce8 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -397,29 +397,19 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message,
switch (type) {
case RTM_NEWADDR:
- if (address) {
+ if (address)
log_link_debug(link, "Updating address: %s/%u (valid for %s)", buf, prefixlen, valid_str);
-
- address->scope = scope;
- address->flags = flags;
- address->cinfo = cinfo;
-
- link_check_ready(link);
- } else {
+ else {
r = address_add(link, family, &in_addr, prefixlen, &address);
if (r < 0) {
log_link_warning_errno(link, r, "Failed to add address %s/%u: %m", buf, prefixlen);
return 0;
} else
log_link_debug(link, "Adding address: %s/%u (valid for %s)", buf, prefixlen, valid_str);
-
- address->scope = scope;
- address->flags = flags;
- address->cinfo = cinfo;
-
- link_check_ready(link);
}
+ address_update(address, scope, flags, &cinfo);
+
break;
case RTM_DELADDR: