netlink: Log duplicate attributes in nl_policy_parse().
authorBen Pfaff <blp@nicira.com>
Tue, 11 Jan 2011 22:12:03 +0000 (14:12 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 27 Jan 2011 17:26:05 +0000 (09:26 -0800)
This made finding one particular bug slightly easier for me.

Reviewed by Justin Pettit.

lib/netlink.c

index 48a52ee..725bba0 100644 (file)
@@ -582,6 +582,9 @@ nl_policy_parse(const struct ofpbuf *msg, size_t nla_offset,
                 assert(n_required > 0);
                 --n_required;
             }
+            if (attrs[type]) {
+                VLOG_DBG_RL(&rl, "%zu: duplicate attr %"PRIu16, offset, type);
+            }
             attrs[type] = nla;
         } else {
             /* Skip attribute type that we don't care about. */