]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/route: make the route section invalid when an invalid MTUBytes= is specified
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Jan 2024 19:42:22 +0000 (04:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 4 Jan 2024 14:18:28 +0000 (23:18 +0900)
We usually set the invalid flag for a section if a setting in the section has
an invalid value. Let's also do the same thing for MTUBytes= in [Route].

src/network/networkd-route.c
src/shared/conf-parser.c

index e7cc252243b7f76bcbb61e99c6acb49f062cfa28..72dbf9ed0675179315cf2add7e1fa2eaf2ae04a5 100644 (file)
@@ -2814,7 +2814,7 @@ int config_parse_route_mtu(
         }
 
         r = config_parse_mtu(unit, filename, line, section, section_line, lvalue, ltype, rvalue, &n->mtu, userdata);
-        if (r < 0)
+        if (r <= 0)
                 return r;
 
         TAKE_PTR(n);
index 5d4500cb05bf320a572d0b9940a2c482afaef976..1d201528ace4bc50a4256bbb5f27c652a983d219 100644 (file)
@@ -1592,7 +1592,7 @@ int config_parse_mtu(
                 return 0;
         }
 
-        return 0;
+        return 1;
 }
 
 int config_parse_rlimit(