~xnox/ubuntu-z-systems/+git/ovs:branch-2.3

Last commit made on 2019-02-04
Get this branch:
git clone -b branch-2.3 https://git.launchpad.net/~xnox/ubuntu-z-systems/+git/ovs

Branch merges

Branch information

Name:
branch-2.3
Repository:
lp:~xnox/ubuntu-z-systems/+git/ovs

Recent commits

b8eb5b2... by Yifeng Sun

odp-util: Stop parse odp actions if nlattr is overflow

`encap = nl_msg_start_nested(key, OVS_KEY_ATTR_ENCAP)` ensures that
key->size >= (encap + NLA_HDRLEN), so the `if` statement is safe.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11306
Signed-off-by: Yifeng Sun <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>

12eaec7... by Ilya Maximets

python: Escape backslashes while formatting logs.

Since python version 3.7 (and some 3.6+ versions) regexp engine
changed to treat the wrong escape sequences as errors. Previously,
if the replace string had something like '\u0000', '\u' was
qualified as a bad escape sequence and treated just as a sequence
of characters '\' and 'u'. But know this triggers an error:

  Traceback (most recent call last):
    File "/usr/lib/python3.7/sre_parse.py", line 1021, in parse_template
      this = chr(ESCAPES[this][1])
  KeyError: '\\u'

From the documentation [1]:

  Unknown escapes consisting of '\' and an ASCII letter in replacement
  templates for re.sub() were deprecated in Python 3.5, and will now
  cause an error.

[1] https://docs.python.org/3/whatsnew/3.7.html#api-and-feature-removals

We need to escape the backslash by another one to keep regexp engine
from errors. In case of '\\u000', '\\' is a valid escape sequence
and the 'u' is a simple character.

To be 100% safe we need to use 're.escape(replace)', but it escapes
too many characters making the logs hard to read.

This change fixes Python 3 tests on systems with python 3.7.
Should be backward compatible.

Reported-by: Ben Pfaff <email address hidden>
Signed-off-by: Ilya Maximets <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>

884c3c2... by Ilya Maximets

python: Catch setsockopt exceptions for TCP stream.

'sock.setsockopt' could throw exceptions. For example, if non-blocking
connection failed before the call:

  Traceback (most recent call last):
    File "../.././test-ovsdb.py", line 896, in <module>
      main(sys.argv)
    File "../.././test-ovsdb.py", line 891, in main
      func(*args)
    File "../.././test-ovsdb.py", line 604, in do_idl
      ovs.stream.Stream.open(r))
    File "/root/git_/ovs/python/ovs/stream.py", line 190, in open
      error, sock = cls._open(suffix, dscp)
    File "/root/git_/ovs/python/ovs/stream.py", line 744, in _open
      sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
    File "/usr/local/lib/python2.7/socket.py", line 228, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 54] Connection reset by peer

This fixes tests on FreeBSD.

Signed-off-by: Ilya Maximets <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>

5c20430... by Ben Pfaff <email address hidden>

Revert "bridge: Fix ovs-appctl qos/show repeated queue information"

This reverts commit 6b4d0211e84a ("bridge: Fix ovs-appctl qos/show
repeated queue information"), which is no longer necessary now that
commit 65f3c34c7417 ("netdev: Properly clear 'details' when iterating
in NETDEV_QOS_FOR_EACH.") has been applied. The former commit fixed
a symptom of the root cause fixed by the latter.

Signed-off-by: Ben Pfaff <email address hidden>
Acked-by: Eelco Chaudron <email address hidden>
Acked-by: Flavio Leitner <email address hidden>

d058e61... by Ben Pfaff <email address hidden>

netdev: Properly clear 'details' when iterating in NETDEV_QOS_FOR_EACH.

The function comment for netdev_queue_dump_next() said that it cleared its
'detail' argument, but it didn't actually do that, which meant that details
could be incorrectly carried along from one queue to the next.

Reported-by: Flavio Leitner <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>
Acked-by: Eelco Chaudron <email address hidden>
Acked-by: Flavio Leitner <email address hidden>

e142aa4... by Eelco Chaudron <email address hidden>

bridge: Fix ovs-appctl qos/show repeated queue information

The patch below would stop qos/show to repeat information from the previous queues.
See below an example before and after the fix:

Before:

  $ ovs-appctl qos/show p5p2
  QoS: p5p2 linux-htb
  max-rate: 2428800

  Default:
    burst: 12512
    min-rate: 12000
    max-rate: 2428800
    tx_packets: 0
    tx_bytes: 0
    tx_errors: 0

  Queue 20:
    burst: 12512
    burst: 12512
    min-rate: 12000
    min-rate: 12000
    max-rate: 607200
    max-rate: 2428800
    tx_packets: 28780
    tx_bytes: 43572920
    tx_errors: 17611

  Queue 10:
    burst: 12512
    burst: 12512
    burst: 12512
    max-rate: 2428800
    max-rate: 607200
    max-rate: 2428800
    min-rate: 12000
    min-rate: 12000
    min-rate: 12000
    tx_packets: 71751
    tx_bytes: 108631014
    tx_errors: 18503

After:

  $ ovs-appctl qos/show p5p2
  QoS: p5p2 linux-htb
  max-rate: 2428800

  Default:
    burst: 12512
    min-rate: 12000
    max-rate: 2428800
    tx_packets: 0
    tx_bytes: 0
    tx_errors: 0

  Queue 20:
    burst: 12512
    min-rate: 12000
    max-rate: 607200
    tx_packets: 28780
    tx_bytes: 43572920
    tx_errors: 17611

  Queue 10:
    burst: 12512
    min-rate: 12000
    max-rate: 2428800
    tx_packets: 71751
    tx_bytes: 108631014
    tx_errors: 18503

Signed-off-by: Eelco Chaudron <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>

323792f... by Ben Pfaff <email address hidden>

netdev-linux: Avoid division by 0 if kernel reports bad scheduler data.

If the kernel reported a value of 0 for the second value in
/proc/net/psched, it would cause a division-by-zero fault in
read_psched(). I don't know of a kernel that would actually do that, but
it's still better to be safe.

Found by clang static analyzer.

Reported-by: Bhargava Shastry <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>
Reviewed-by: Yifeng Sun <email address hidden>

3d55b5c... by Ben Pfaff <email address hidden>

pcap-file: Fix formatting of log message.

Signed-off-by: Ben Pfaff <email address hidden>
Acked-by: Alin Gabriel Serdean <email address hidden>

ebc9e74... by aconole

ovs-tcpundump: fix a conversion issue

When I tried using ovs-tcpundump, I got the following error message:
Traceback (most recent call last):
  File ./ovs-tcpundump, line 64, in <module>
    if m is None or int(m.group(1)) == 0:
ValueError: invalid literal for int() with base 10: '00a0'

Signed-off-by: Aaron Conole <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>

97c814e... by Yifeng Sun

bond: Fix bug that writes to freed memory

pr_op->pr_rule is pointing to memory in bond->hash. It shouldn't be written
if bond->hash is already freed.

This bug is reported by running kernel path testsuite under valgrind:
Invalid write of size 8
   at 0x413D16: update_recirc_rules__ (bond.c:392)
   by 0x414CA0: bond_unref (bond.c:290)
   by 0x427E3C: bundle_destroy (ofproto-dpif.c:3002)
   by 0x429EF4: bundle_set (ofproto-dpif.c:3023)
   by 0x40858B: port_destroy (bridge.c:4087)
   by 0x40BD04: bridge_destroy (bridge.c:3266)
   by 0x410528: bridge_exit (bridge.c:506)
   by 0x4072EE: main (ovs-vswitchd.c:135)
 Address 0xb5a85f0 is 5,360 bytes inside a block of size 12,288 free'd
   at 0x4C2EDEB: free (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x414C8D: bond_unref (bond.c:288)
   by 0x427E3C: bundle_destroy (ofproto-dpif.c:3002)
   by 0x429EF4: bundle_set (ofproto-dpif.c:3023)
   by 0x40858B: port_destroy (bridge.c:4087)
   by 0x40BD04: bridge_destroy (bridge.c:3266)
   by 0x410528: bridge_exit (bridge.c:506)
   by 0x4072EE: main (ovs-vswitchd.c:135)
 Block was alloc'd at
   at 0x4C2DB8F: malloc (/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x516C04: xmalloc (util.c:120)
   by 0x414FD1: bond_entry_reset (bond.c:1651)
   by 0x414FD1: bond_reconfigure (bond.c:470)
   by 0x41507D: bond_create (bond.c:245)
   by 0x429D5D: bundle_set (ofproto-dpif.c:3194)
   by 0x408AC8: port_configure (bridge.c:1052)
   by 0x40CD87: bridge_reconfigure (bridge.c:682)
   by 0x410775: bridge_run (bridge.c:2998)
   by 0x407244: main (ovs-vswitchd.c:119)

Signed-off-by: Yifeng Sun <email address hidden>
Signed-off-by: Ben Pfaff <email address hidden>
Tested-by: Greg Rose <email address hidden>
Reviewed-by: Greg Rose <email address hidden>