summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/basic/socket-util.c2
-rw-r--r--src/test/test-socket-util.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
index 77f81a60ba..c882b8a12a 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
@@ -887,7 +887,7 @@ bool ifname_valid(const char *p) {
if ((unsigned char) *p <= 32U)
return false;
- if (*p == ':' || *p == '/')
+ if (*p == '/')
return false;
numeric = numeric && (*p >= '0' && *p <= '9');
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c
index d80613dc84..e1f5fd5084 100644
--- a/src/test/test-socket-util.c
+++ b/src/test/test-socket-util.c
@@ -30,6 +30,7 @@
static void test_ifname_valid(void) {
assert(ifname_valid("foo"));
assert(ifname_valid("eth0"));
+ assert(ifname_valid("eth0:0"));
assert(!ifname_valid("0"));
assert(!ifname_valid("99"));
@@ -44,7 +45,7 @@ static void test_ifname_valid(void) {
assert(!ifname_valid("."));
assert(!ifname_valid(".."));
assert(ifname_valid("foo.bar"));
- assert(!ifname_valid("x:y"));
+ assert(ifname_valid("x:y"));
assert(ifname_valid("xxxxxxxxxxxxxxx"));
assert(!ifname_valid("xxxxxxxxxxxxxxxx"));