#include "bus-util.h"
#include "network-internal.h"
+#include "network-util.h"
#include "dhcp-lease-internal.h"
static int ipv4ll_address_update(Link *link, bool deprecate);
static void link_enter_unmanaged(Link *link) {
assert(link);
- log_info_link(link, "unmanaged");
+ log_debug_link(link, "unmanaged");
link->state = LINK_STATE_UNMANAGED;
return 0;
}
-static bool link_has_carrier(unsigned flags, uint8_t operstate) {
- /* see Documentation/networking/operstates.txt in the kernel sources */
-
- if (operstate == IF_OPER_UP)
- return true;
-
- if (operstate == IF_OPER_UNKNOWN)
- /* operstate may not be implemented, so fall back to flags */
- if ((flags & IFF_LOWER_UP) && !(flags & IFF_DORMANT))
- return true;
-
- return false;
-}
-
static int link_update_flags(Link *link, sd_rtnl_message *m) {
unsigned flags, flags_added, flags_removed, generic_flags;
uint8_t operstate;
IFF_NOARP | IFF_MASTER | IFF_SLAVE);
if (flags_added & IFF_UP)
- log_info_link(link, "link is up");
+ log_debug_link(link, "link is up");
else if (flags_removed & IFF_UP)
- log_info_link(link, "link is down");
+ log_debug_link(link, "link is down");
if (flags_added & IFF_LOWER_UP)
log_debug_link(link, "link is lower up");
}
if (link_has_carrier(link->flags, link->operstate))
+ {
r = link_acquire_conf(link);
if (r < 0)
return r;
+ }
return link_enter_enslave(link);
}
link = *ret;
- log_info_link(link, "link added");
+ log_debug_link(link, "link added");
if (detect_container(NULL) <= 0) {
/* not in a container, udev will be around */