networkd: don't consider deprecated or tentative addresses when determining operstate

https://bugs.freedesktop.org/show_bug.cgi?id=81287
This commit is contained in:
Tom Gundersen
2014-08-19 19:01:38 +02:00
parent cf8bd44339
commit 81163121e6
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -1386,6 +1386,13 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message,
return 0;
}
r = sd_rtnl_message_addr_get_flags(message, &address->flags);
if (r < 0) {
log_warning_link(link,
"rtnl: received address with invalid flags, ignoring");
return 0;
}
switch (address->family) {
case AF_INET:
r = sd_rtnl_message_read_in_addr(message, IFA_LOCAL,
@@ -1658,6 +1665,9 @@ static void link_update_operstate(Link *link) {
/* if we have carrier, check what addresses we have */
LIST_FOREACH(addresses, address, link->addresses) {
if (address->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED))
continue;
if (address->scope < scope)
scope = address->scope;
}
+1
View File
@@ -126,6 +126,7 @@ struct Address {
int family;
unsigned char prefixlen;
unsigned char scope;
unsigned char flags;
char *label;
struct in_addr broadcast;