From 33cada0cf1f24beb79c23328acb2bf9860c34679 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 11 Jan 2011 14:12:03 -0800 Subject: [PATCH] netlink: Log duplicate attributes in nl_policy_parse(). This made finding one particular bug slightly easier for me. Reviewed by Justin Pettit. --- lib/netlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/netlink.c b/lib/netlink.c index 48a52ee3..725bba02 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. */ -- 2.30.2