]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/socket-util.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / basic / socket-util.c
index e8d39674cc50fdca99a1b777b420429a50849db9..b02af357adef2dc9210fe6424a49674cc0db1b0a 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -48,7 +49,7 @@
 #include "utf8.h"
 #include "util.h"
 
-#ifdef ENABLE_IDN
+#if ENABLE_IDN
 #  define IDN_FLAGS (NI_IDN|NI_IDN_USE_STD3_ASCII_RULES)
 #else
 #  define IDN_FLAGS 0
@@ -892,7 +893,7 @@ bool ifname_valid(const char *p) {
                 if ((unsigned char) *p <= 32U)
                         return false;
 
-                if (*p == ':' || *p == '/')
+                if (IN_SET(*p, ':', '/'))
                         return false;
 
                 numeric = numeric && (*p >= '0' && *p <= '9');