diff options
author | Tom Gundersen <teg@jklm.no> | 2015-09-28 17:16:12 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-21 02:35:31 +0200 |
commit | 36c32f6120a0c3fe19be5aeaa1926e179e8c29ba (patch) | |
tree | c10e5f502a2757fa9e1bf1499063ec272a5c7039 /src/network/networkd-address.c | |
parent | 8012cd391932d58b44332df106d426a360faf0a6 (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-address.c')
-rw-r--r-- | src/network/networkd-address.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index f1b364f40e..98ff027536 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -282,6 +282,24 @@ static int address_release(Address *address, Link *link) { return 0; } +int address_update(Address *address, unsigned char flags, unsigned char scope, struct ifa_cacheinfo *cinfo) { + bool ready; + + assert(address); + assert(cinfo); + + ready = address_is_ready(address); + + address->flags = flags; + address->scope = scope; + address->cinfo = *cinfo; + + if (!ready && address_is_ready(address) && address->link) + link_check_ready(address->link); + + return 0; +} + int address_drop(Address *address) { Link *link; bool ready; @@ -359,7 +377,7 @@ int address_remove(Address *address, Link *link, return 0; } -int address_update(Address *address, Link *link, +int address_change(Address *address, Link *link, sd_netlink_message_handler_t callback) { _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL; int r; |