From: Thomas Graf <tgraf@infradead.org>
To: Tony Zelenoff <antonz@parallels.com>
Cc: xemul@parallels.com, devel@openvz.org, davem@davemloft.net,
kuznet@ms2.inr.ac.ru, netdev@vger.kernel.org
Subject: Re: [PATCH rhel6] Allow ipv6 proxies and arp proxies be shown with iproute2
Date: Thu, 26 Jan 2012 14:16:55 -0500 [thread overview]
Message-ID: <20120126191655.GA8376@canuck.infradead.org> (raw)
In-Reply-To: <1327589392-10852-1-git-send-email-antonz@parallels.com>
On Thu, Jan 26, 2012 at 06:49:52PM +0400, Tony Zelenoff wrote:
> + /* check for full ndmsg structure presence, family member is
> + * the same for both structures */
> + if (nlmsg_len(cb->nlh) == sizeof(struct ndmsg) &&
> + ((struct ndmsg *) nlmsg_data(cb->nlh))->ndm_flags == NTF_PROXY)
> + proxy = 1;
> +
Please change this check to nlmsg_len(cb->nlh) >= sizeof(struct ndmsg) so
we have the possibility to extend the request message in the future
without breaking backwards compatibility.
> s_t = cb->args[0];
>
> - for (tbl = neigh_tables, t = 0; tbl; tbl = tbl->next, t++) {
> + for (tbl = neigh_tables, t = 0; tbl && (err >= 0);
> + tbl = tbl->next, t++) {
> if (t < s_t || (family && tbl->family != family))
> continue;
> if (t > s_t)
> memset(&cb->args[1], 0, sizeof(cb->args) -
> sizeof(cb->args[0]));
> - if (neigh_dump_table(tbl, skb, cb) < 0)
> - break;
> + if (proxy) {
> + err = pneigh_dump_table(tbl, skb, cb);
> + continue;
> + }
> + err = neigh_dump_table(tbl, skb, cb);
Personally I would call neigh_dump_table() in the else branch and avoid
the continue statement.
prev parent reply other threads:[~2012-01-26 19:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 14:49 [PATCH rhel6] Allow ipv6 proxies and arp proxies be shown with iproute2 Tony Zelenoff
2012-01-26 15:03 ` Tony Zelenoff
2012-01-26 18:14 ` David Miller
2012-01-26 19:16 ` Thomas Graf [this message]
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=20120126191655.GA8376@canuck.infradead.org \
--to=tgraf@infradead.org \
--cc=antonz@parallels.com \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=xemul@parallels.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).