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).
Cheers,