Correct VERIFY_NUL_STRING back-port that required a "0" instead of a null.
authorJustin Pettit <jpettit@nicira.com>
Fri, 2 Jan 2009 19:04:21 +0000 (11:04 -0800)
committerJustin Pettit <jpettit@nicira.com>
Fri, 2 Jan 2009 19:04:21 +0000 (11:04 -0800)
The VERIFY_NUL_STRING back-port to older kernels was looking for an ASCII
zero instead of the null-string terminator.

datapath/linux-2.6/compat-2.6/include/net/netlink.h

index 0be53157ba7d568cc395105df8d353e1573b4102..e0d594d78f7bac91351b2ac215778b8ce11d031e 100644 (file)
@@ -9,7 +9,7 @@
 static inline int VERIFY_NUL_STRING(struct nlattr *attr)
 {
        return (!attr || (nla_len(attr)
-                         && memchr(nla_data(attr), '0', nla_len(attr)))
+                         && memchr(nla_data(attr), '\0', nla_len(attr)))
                ? 0 : EINVAL);
 }
 #else