network: split link_ipv4ll_enabled() into two

And move it from networkd-link.[ch] to relevant files.
This commit is contained in:
Yu Watanabe
2022-08-02 03:02:48 +09:00
parent 2d3d0e8f7d
commit 29104ded1c
6 changed files with 49 additions and 39 deletions
+16
View File
@@ -5,12 +5,28 @@
#include "netif-util.h"
#include "networkd-address.h"
#include "networkd-ipv4acd.h"
#include "networkd-ipv4ll.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
#include "parse-util.h"
bool link_ipv4ll_enabled(Link *link) {
assert(link);
if (!link_ipv4acd_supported(link))
return false;
if (!link->network)
return false;
if (link->network->bond)
return false;
return link->network->link_local & ADDRESS_FAMILY_IPV4;
}
static int address_new_from_ipv4ll(Link *link, Address **ret) {
_cleanup_(address_freep) Address *address = NULL;
struct in_addr addr;