chiark / gitweb /
link-config: match length for kernel commandline option
authorDave Reisner <dreisner@archlinux.org>
Fri, 8 Nov 2013 14:17:08 +0000 (09:17 -0500)
committerDave Reisner <dreisner@archlinux.org>
Fri, 8 Nov 2013 14:25:19 +0000 (09:25 -0500)
This prevents enable_name_policy() from invariably returning false when
it matches a zero length string at the end of /proc/cmdline.

src/udev/net/link-config.c

index 7269458..cb4af14 100644 (file)
@@ -202,7 +202,7 @@ static bool enable_name_policy(void) {
                 return true;
 
         FOREACH_WORD_QUOTED(w, l, line, state)
-                if (strneq(w, "net.ifnames=0", l))
+                if (l == sizeof("net.ifnames=0") - 1 && strneq(w, "net.ifnames=0", l))
                         return false;
 
         return true;