From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid redundant multicast TT entries
Date: Sun, 04 Mar 2018 14:15:13 +0100 [thread overview]
Message-ID: <2380843.LR5gV1ucHm@sven-edge> (raw)
In-Reply-To: <20180304115837.4647-1-linus.luessing@c0d3.blue>
[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]
On Sonntag, 4. März 2018 12:58:37 CET Linus Lüssing wrote:
> If a node signals that it wants all traffic for a specific protocol
> family then there is no need to announce individual multicast addresses
> via TT.
>
> Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> ---
> net/batman-adv/multicast.c | 56 ++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 52 insertions(+), 4 deletions(-)
I cannot say much about the TT details but just some remarks about some coding
style details.
> +static bool batadv_mcast_addr_is_ipv4(unsigned char *addr)
We usually would use "const u8 *addr" here maybe I missed something
but I would expect that this is also used here.
> +{
> + const unsigned char prefix[] = { 0x01, 0x00, 0x5E };
All other single line array initializations in the code used "{" without
extra space after it and "}" without extra space before it.
> + return !memcmp(prefix, addr, sizeof(prefix));
> +}
Could you please use "== 0" here instead of "!". Every time I read !memcmp, I
am assuming for a short period of time that the memcpy must "fail" here.
> +static bool batadv_mcast_addr_is_ipv6(unsigned char *addr)
We usually would use "const u8 *addr" here maybe I missed something
but I would expect that this is also used here.
> +{
> + const unsigned char prefix[] = { 0x33, 0x33 };
All other single line array initializations in the code used "{" without
extra space after it and "}" without extra space before it.
> +
> + return !memcmp(prefix, addr, sizeof(prefix));
Could you please use "== 0" here instead of "!". Every time I read !memcmp, I
am assuming for a short period of time that the memcpy must "fail" here.
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-03-04 13:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-04 11:58 [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid redundant multicast TT entries Linus Lüssing
2018-03-04 13:15 ` Sven Eckelmann [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=2380843.LR5gV1ucHm@sven-edge \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox