mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
sysctl-util: make sysctl_write_ip_property() a wrapper around sysctl_write()
It does the same stuff, let's use the same codepaths as much as we can. And while we are at it, let's generate good error codes in case we are called with unsupported parameters/let's validate stuff more that might originate from user input.
This commit is contained in:
@@ -793,7 +793,7 @@ bool ifname_valid_full(const char *p, IfnameValidFlags flags) {
|
||||
|
||||
/* Let's refuse "all" and "default" as interface name, to avoid collisions with the special sysctl
|
||||
* directories /proc/sys/net/{ipv4,ipv6}/conf/{all,default} */
|
||||
if (STR_IN_SET(p, "all", "default"))
|
||||
if (!FLAGS_SET(flags, IFNAME_VALID_SPECIAL) && STR_IN_SET(p, "all", "default"))
|
||||
return false;
|
||||
|
||||
for (const char *t = p; *t; t++) {
|
||||
|
||||
Reference in New Issue
Block a user