summaryrefslogtreecommitdiff
path: root/src/network/networkd-route-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-09 05:50:01 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-12-09 09:06:41 +0100
commitd2d602f4b4c1614c35000dd6a5c351c482902ee4 (patch)
treeddada1e55b24ba3a812777498d06c053925e3a10 /src/network/networkd-route-util.c
parent283f7c9872d2fb29612bfa767568965e67c5ee80 (diff)
downloadsystemd-d2d602f4b4c1614c35000dd6a5c351c482902ee4.tar.gz
network: refuse empty or numeric route table names
Diffstat (limited to 'src/network/networkd-route-util.c')
-rw-r--r--src/network/networkd-route-util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/networkd-route-util.c b/src/network/networkd-route-util.c
index f5b502f464..c202078f07 100644
--- a/src/network/networkd-route-util.c
+++ b/src/network/networkd-route-util.c
@@ -360,9 +360,19 @@ int config_parse_route_table_names(
*num++ = '\0';
+ if (isempty(name)) {
+ log_syntax(unit, LOG_WARNING, filename, line, 0,
+ "Route table name cannot be empty. Ignoring assignment: %s:%s", name, num);
+ continue;
+ }
+ if (in_charset(name, DIGITS)) {
+ log_syntax(unit, LOG_WARNING, filename, line, 0,
+ "Route table name cannot be numeric. Ignoring assignment: %s:%s", name, num);
+ continue;
+ }
if (STR_IN_SET(name, "default", "main", "local")) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
- "Route table name %s already predefined. Ignoring assignment: %s:%s", name, name, num);
+ "Route table name %s is already predefined. Ignoring assignment: %s:%s", name, name, num);
continue;
}