]> git.proxmox.com Git - ovs.git/commit
odp-util: Don't try to parse geneve data if not provided.
authorIlya Maximets <i.maximets@samsung.com>
Tue, 18 Dec 2018 15:56:16 +0000 (18:56 +0300)
committerBen Pfaff <blp@ovn.org>
Tue, 18 Dec 2018 23:45:28 +0000 (15:45 -0800)
commit0f6379e7fa4dfba56d6825c55bff97f9cd340519
tree5fb56686040db718fd3ef7a01ed5aca7f114c1cd
parent20be3a7294ed6abe99a8e0f6f9fbe3c7d2dd8c10
odp-util: Don't try to parse geneve data if not provided.

Despite of linux, 'strtoull' on FreeBSD sets errno to EINVAL in case
of no digits found. This causes odp_flow parsing failure if
there is no geneve data inside it. For example, ovs fails to parse
following flow on FreeBSD:

  tunnel(<...>,geneve({class=0xffff,type=1,len=0}),<...>)

Moving the parsing attempt under the if condition fixes the following
unit test failure:

  tunnel.at:780: testing tunnel - Geneve option present ...
  ./tunnel.at:810: ovs-appctl ofproto/trace ovs-dummy \
      'tunnel(<...>,geneve({class=0xffff,type=1,len=0}), ...'
  --- /dev/null 2018-12-18 13:24:55.001110000 +0000
  +++ /tmp/cirrus-ci-build/tests/testsuite.dir/at-groups/848/stderr
  @@ -0,0 +1,2 @@
  +ovs-dummy: unknown bridge
  +ovs-appctl: ovs-vswitchd: server returned an error

CC: Jesse Gross <jesse@kernel.org>
Fixes: 622a0a8e764d ("odp-util: Geneve netlink decoding.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/odp-util.c