[ovs-git] [openvswitch/ovs] 3476ce: flow: Add flow_compose_size().

GitHub noreply at github.com
Tue Jul 25 21:42:25 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 3476ce3ad7832e88e039893da96fa956a2aae18e
      https://github.com/openvswitch/ovs/commit/3476ce3ad7832e88e039893da96fa956a2aae18e
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2017-07-25 (Tue, 25 Jul 2017)

  Changed paths:
    M lib/flow.c
    M lib/flow.h

  Log Message:
  -----------
  flow: Add flow_compose_size().

This allows to compose packets with different real lenghts from
odp flows i.e. memory will be allocated for requested packet
size and all required headers like ip->tot_len filled correctly.

Will be used in netdev-dummy to properly handle '--len' option.

Suggested-by: Andy Zhou <azhou at ovn.org>
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Andy Zhou <azhou at ovn.org>


  Commit: 1e2eecbbf727456b93acc4901c3d61d8a95f6fbb
      https://github.com/openvswitch/ovs/commit/1e2eecbbf727456b93acc4901c3d61d8a95f6fbb
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2017-07-25 (Tue, 25 Jul 2017)

  Changed paths:
    M lib/netdev-dummy.c

  Log Message:
  -----------
  netdev-dummy: Fix setting length in recieve command.

Currently, if '--len' option passed to 'netdev-dummy/receive' command,
only 'size' field of dp_packet will changes.

This is incorrect behaviour, because memory for that size is not
allocated and also packet headers not fixed to reflect the new size.
This leads to flow_extract() failure, because it checks the
'ip->tot_len' and stops further parsing if it doesn't match the
dp_packet_size(). As a result packets created while processing of the
'receive' command can't be parsed to the same flow.
Additionally this may lead to wrong memory accesses in case someone
will try to read or modify packets data.

Fix that by creating right packets using recently introduced
'flow_compose_size()'.

CC: Andy Zhou <azhou at ovn.org>
Fixes: d8ada2368cbe ("netdev-dummy: Add --len option for netdev-dummy/receive command")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Andy Zhou <azhou at ovn.org>


  Commit: fa10e59a6b9a894644c99f39035afc427d09a490
      https://github.com/openvswitch/ovs/commit/fa10e59a6b9a894644c99f39035afc427d09a490
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2017-07-25 (Tue, 25 Jul 2017)

  Changed paths:
    M tests/dpif-netdev.at

  Log Message:
  -----------
  dpif-netdev.at: Add netdev-dummy/receive test.

Regression test for 'netdev-dummy/receive' appctl command.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Andy Zhou <azhou at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/fc1771786947...fa10e59a6b9a


More information about the git mailing list