[ovs-git] [openvswitch/ovs] c05c01: odp-util: Fix alignment when scanning Geneve attri...

GitHub noreply at github.com
Fri May 29 17:53:32 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: c05c01cd86bdb26be1c107741c3ede2659e51a29
      https://github.com/openvswitch/ovs/commit/c05c01cd86bdb26be1c107741c3ede2659e51a29
  Author: Jesse Gross <jesse at nicira.com>
  Date:   2015-05-29 (Fri, 29 May 2015)

  Changed paths:
    M lib/odp-util.c

  Log Message:
  -----------
  odp-util: Fix alignment when scanning Geneve attributes.

Clang complains about the fact that we use a byte array to scan
Geneve attributes into since there are different alignment requirements:

lib/odp-util.c:2936:30: error: cast from 'uint8_t *' (aka 'unsigned char *') to

      'struct geneve_opt *' increases required alignment from 1 to 2

      [-Werror,-Wcast-align]

    struct geneve_opt *opt = (struct geneve_opt *)key->d;
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~

We can instead treat this as an array of Geneve option headers to
ensure we get the right alignment and then there are no need for
casts.

Reported-by: Joe Stringer <joestringer at nicira.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Joe Stringer <joestringer at nicira.com>




More information about the git mailing list