From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net, shemminger@vyatta.com
Cc: netdev@vger.kernel.org, gospo@redhat.com,
Mitch Williams <mitch.a.williams@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [iproute2 PATCH v2 2/4] libnetlink: Modify the parser to track first duplicated attributes
Date: Wed, 10 Feb 2010 03:46:47 -0800 [thread overview]
Message-ID: <20100210114646.14570.87012.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100210114617.14570.87620.stgit@localhost.localdomain>
From: Williams, Mitch A <mitch.a.williams@intel.com>
Modify the parser to keep track of the first of any duplicated attributes,
instead of the last. This is required for VF configuration reporting, where
multiple attributes of the same type are added sequentially.
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
lib/libnetlink.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 4ba6019..cfeb894 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -644,7 +644,7 @@ int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
{
memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
while (RTA_OK(rta, len)) {
- if (rta->rta_type <= max)
+ if ((rta->rta_type <= max) && (!tb[rta->rta_type]))
tb[rta->rta_type] = rta;
rta = RTA_NEXT(rta,len);
}
next prev parent reply other threads:[~2010-02-10 11:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-10 11:46 [iproute2 PATCH v2 1/4] if_link: Sync if_link header with kernel to get new VF configuration defines Jeff Kirsher
2010-02-10 11:46 ` Jeff Kirsher [this message]
2010-02-10 11:47 ` [iproute2 PATCH v2 3/4] ip: Add support for setting and showing SR-IOV virtual funtion link params Jeff Kirsher
2010-03-04 0:34 ` Stephen Hemminger
2010-02-10 11:47 ` [iproute2 PATCH v2 4/4] Update man page to indicate current options Jeff Kirsher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100210114646.14570.87012.stgit@localhost.localdomain \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=mitch.a.williams@intel.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).