network: Parse whole RTM_NEWROUTE msg before interpreting it
The check to figure out if we have the default route should be after the for loop that parses the route attributes, to avoid acting on incomplete information. We are going to use more fields from the message.
This commit is contained in:
parent
5444a66e71
commit
23b9923eeb
|
@ -623,10 +623,9 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If this is the default route, and we know the interface index,
|
||||
* we can stop parsing this message.
|
||||
*/
|
||||
// Check if we have a default route.
|
||||
if (has_gateway && !has_destination && temp_idx != -1) {
|
||||
if (!is_del_event) {
|
||||
net->ifid_ = temp_idx;
|
||||
|
@ -667,7 +666,6 @@ int waybar::modules::Network::handleEvents(struct nl_msg *msg, void *data) {
|
|||
net->askForStateDump();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue