1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

network: route: check validity of interface name in MultiPathRoute=

This commit is contained in:
Yu Watanabe 2021-05-13 16:47:42 +09:00
parent 8ed87c4983
commit 70a2d9dd31

View File

@ -2757,6 +2757,12 @@ int config_parse_multipath_route(
if (r > 0)
m->ifindex = r;
else {
if (!ifname_valid_full(dev, IFNAME_VALID_ALTERNATIVE)) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Invalid interface name '%s' in %s=, ignoring: %s", dev, lvalue, rvalue);
return 0;
}
m->ifname = strdup(dev);
if (!m->ifname)
return log_oom();