[ovs-dev] [PATCH] openvswitch: Fix alignment of struct sw_flow_key.

Jesse Gross jesse at nicira.com
Thu Sep 5 19:25:00 UTC 2013


On Thu, Sep 5, 2013 at 12:20 PM, Geert Uytterhoeven
<geert at linux-m68k.org> wrote:
> Why don't you abort the loop if a difference is found?
> Or is this a security-related struct where you want to protect against
> timing attacks?

It's more expensive to test for a difference on every iteration in the
common case where the comparison succeeds.

> Furthermore, as you compare the raw bytes, I hope you always
> initialize all gaps in the struct to zero.
> E.g. there's a 2-byte gap immediately after "ip", as the next member
> is 32-bit (except op m68k, where the 32-bit member will be 2-byte aligned).

It's initialized to zero.



More information about the dev mailing list