1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-21 18:03:41 +03:00

network: NHA_ID should be always set

This commit is contained in:
Yu Watanabe 2021-02-05 11:51:21 +09:00
parent c004cd2bbe
commit ccbd74f602

View File

@ -415,9 +415,15 @@ int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message,
}
r = sd_netlink_message_read_u32(message, NHA_ID, &tmp->id);
if (r < 0 && r != -ENODATA) {
if (r == -ENODATA) {
log_link_warning_errno(link, r, "rtnl: received nexthop message without NHA_ID attribute, ignoring: %m");
return 0;
} else if (r < 0) {
log_link_warning_errno(link, r, "rtnl: could not get NHA_ID attribute, ignoring: %m");
return 0;
} else if (tmp->id == 0) {
log_link_warning(link, "rtnl: received nexthop message with invalid nexthop ID, ignoring: %m");
return 0;
}
(void) nexthop_get(link, tmp, &nexthop);