From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: don't rely on positions in struct for hashing
Date: Thu, 30 Aug 2012 18:46:27 +0200 [thread overview]
Message-ID: <20120830164627.GL29563@ritirata.org> (raw)
In-Reply-To: <20120830163352.GK29563@ritirata.org>
[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]
On Thu, Aug 30, 2012 at 06:33:52PM +0200, Antonio Quartulli wrote:
> On Thu, Aug 30, 2012 at 06:22:27PM +0200, Simon Wunderlich wrote:
> > The hash functions in the bridge loop avoidance code expects the
> > VLAN vid to be right after the mac address, but this is not guaranteed.
> >
> > Fix this by explicitly hashing over the right fields of the struct.
> >
>
> What about creating a new structure like
>
> struct {
> uint8_t mac[ETH_ALEN];
> short vid;
> }
>
> to be used as first field in the batadv_claim object? Then you can easily hash
> the first 10 bytes in one shot.
> This would also help to avoid code duplication in the future (TT will support
> VLAN tagging sooner or later and will need the same trick).
Sorry,
but my proposal is wrong. In the new structure we could still have some padding
between the two fields (and we can't know), therefore we cannot hash 10bytes in
one shot as I said.
Drop my idea :)
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-08-30 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 16:22 [B.A.T.M.A.N.] [PATCH] batman-adv: don't rely on positions in struct for hashing Simon Wunderlich
2012-08-30 16:33 ` Antonio Quartulli
2012-08-30 16:46 ` Antonio Quartulli [this message]
2012-09-09 8:34 ` Marek Lindner
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=20120830164627.GL29563@ritirata.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=siwu@hrz.tu-chemnitz.de \
/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