network: check that received ifindex is valid

This commit is contained in:
Yu Watanabe 2020-06-25 13:13:47 +09:00
parent b18573e16f
commit 25b831bac8
1 changed files with 3 additions and 0 deletions

View File

@ -1272,6 +1272,9 @@ int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message,
if (r < 0 && r != -ENODATA) {
log_warning_errno(r, "rtnl: could not get NHA_OIF attribute, ignoring: %m");
return 0;
} else if (tmp->oif <= 0) {
log_warning("rtnl: received nexthop message with invalid ifindex %d, ignoring.", tmp->oif);
return 0;
}
r = link_get(m, tmp->oif, &link);