[ovs-dev] [netlink v4 06/52] netlink: Log duplicate attributes in nl_policy_parse().

Ben Pfaff blp at nicira.com
Wed Jan 12 05:49:18 UTC 2011


This made finding one particular bug slightly easier for me.
---
 lib/netlink.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/netlink.c b/lib/netlink.c
index bc04f74..2b5188f 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -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. */
-- 
1.7.1





More information about the dev mailing list