From: Patrick McHardy <kaber@trash.net>
To: David Ward <david.ward@ll.mit.edu>
Cc: netdev@vger.kernel.org, Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH RFC v2 1/2] net/802: Implement Multiple Registration Protocol (MRP)
Date: Fri, 8 Feb 2013 09:37:56 +0100 [thread overview]
Message-ID: <20130208083750.GA6802@macbook.localnet> (raw)
In-Reply-To: <1360295457-5245-2-git-send-email-david.ward@ll.mit.edu>
On Thu, Feb 07, 2013 at 10:50:55PM -0500, David Ward wrote:
> Initial implementation of the Multiple Registration Protocol (MRP)
> from IEEE 802.1Q-2011, based on the existing implementation of the
> Generic Attribute Registration Protocol (GARP).
>
> Signed-off-by: David Ward <david.ward@ll.mit.edu>
> +enum mrp_vecattr_event {
> + MRP_NEW,
> + MRP_JOIN_IN,
> + MRP_IN,
> + MRP_JOIN_MT,
> + MRP_MT,
> + MRP_LV,
> +};
> +static int mrp_pdu_append_event(struct mrp_applicant *app,
> + const struct mrp_attr *attr,
> + enum mrp_vecattr_event event)
> +{
...
> + switch (pos) {
> + case 0:
> + *events = event * 36;
> + break;
> + case 1:
> + *events += event * 6;
> + break;
> + case 2:
> + *events += event;
> + break;
> + default:
> + WARN_ON(1);
> + }
Could you define a MRT_VAEVENT_MAX or something and use that instead of the
magic values? Took me a bit to figure out their meaning.
> +static int mrp_pdu_parse_vecattr(struct mrp_applicant *app,
> + struct sk_buff *skb, int *offset)
> +{
...
> + while (valen > 0) {
> + if (skb_copy_bits(skb, *offset, &vaevents,
> + sizeof(vaevents)) < 0)
> + return -1;
> + *offset += sizeof(vaevents);
> +
> + /* Extract and process the first event. */
> + vaevent = vaevents / 36;
> + if (vaevent >= 6) {
Same here.
Other than that:
Acked-by: Patrick McHardy <kaber@trash.net>
for all patches.
next prev parent reply other threads:[~2013-02-08 8:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-08 3:50 [PATCH RFC v2 0/2] Multiple VLAN Registration Protocol (IEEE 802.1Q-2011) David Ward
2013-02-08 3:50 ` [PATCH RFC v2 1/2] net/802: Implement Multiple Registration Protocol (MRP) David Ward
2013-02-08 8:37 ` Patrick McHardy [this message]
2013-02-08 23:01 ` David Miller
2013-02-08 3:50 ` [PATCH RFC v2 2/2] net/8021q: Implement Multiple VLAN Registration Protocol (MVRP) David Ward
2013-02-08 3:50 ` [PATCH RFC v2 iproute2] iplink_vlan: Add flag for " David Ward
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=20130208083750.GA6802@macbook.localnet \
--to=kaber@trash.net \
--cc=david.ward@ll.mit.edu \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.