]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netlink/attr.c
Merge branches 'irq/genirq' and 'linus' into irq/core
[linux-2.6-omap-h63xx.git] / net / netlink / attr.c
index 2d106cfe1d276bf5e234195753eb091cba7b7f1e..56c3ce7fe29af8b2bf47dd8bdc41edb93576c70a 100644 (file)
@@ -83,6 +83,12 @@ static int validate_nla(struct nlattr *nla, int maxtype,
                if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN + nla_len(nla))
                        return -ERANGE;
                break;
+       case NLA_NESTED:
+               /* a nested attributes is allowed to be empty; if its not,
+                * it must have a size of at least NLA_HDRLEN.
+                */
+               if (attrlen == 0)
+                       break;
        default:
                if (pt->len)
                        minlen = pt->len;
@@ -233,7 +239,7 @@ size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize)
  *
  * Returns the number of bytes copied.
  */
-int nla_memcpy(void *dest, struct nlattr *src, int count)
+int nla_memcpy(void *dest, const struct nlattr *src, int count)
 {
        int minlen = min_t(int, count, nla_len(src));