[ovs-git] [openvswitch/ovs] cfef5a: socket-util: Report POLLHUP as an error while conn...

GitHub noreply at github.com
Mon Dec 24 20:03:25 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: cfef5ae8f0e3954b829a60df702ffea4cd02d4d6
      https://github.com/openvswitch/ovs/commit/cfef5ae8f0e3954b829a60df702ffea4cd02d4d6
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-24 (Mon, 24 Dec 2018)

  Changed paths:
    M lib/socket-util.c
    M python/ovs/socket_util.py
    M tests/.gitignore
    M tests/automake.mk
    M tests/ovsdb-idl.at
    A tests/test-stream.c

  Log Message:
  -----------
  socket-util: Report POLLHUP as an error while connection completion checking.

Otherwise failed non-blocking connection could be reported as
connected. This causes errors in all following operations with the
socket.

At least this is true on FreeBSD, where POLLHUP could be set without
POLLERR.

For example, stream_open_block() tests fails with the following error
reporting successful connection to the 'WRONG_PORT':

  ./ovsdb-idl.at:1817:
       $PYTHON2 $srcdir/test-stream.py tcp:127.0.0.1:$WRONG_PORT
  stdout:
  ./ovsdb-idl.at:1817: exit code was 0, expected 1
  2399. ovsdb-idl.at:1817:  FAILED (ovsdb-idl.at:1817)

Also added new tests to track this issue in C library:
  'Check Stream open block - C - tcp'
  'Check Stream open block - C - tcp6'

CC: Numan Siddique <nusiddiq at redhat.com>
Fixes: c1aa16d191d2 ("ovs python: ovs.stream.open_block() returns success even if the remote is unreachable")
Fixes: d6cedfd9d29d ("socket-util: Avoid using SO_ERROR.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: b481a4cc93c6ce3530b2a338e5167b200c592996
      https://github.com/openvswitch/ovs/commit/b481a4cc93c6ce3530b2a338e5167b200c592996
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-24 (Mon, 24 Dec 2018)

  Changed paths:
    M tests/ovsdb-idl.at

  Log Message:
  -----------
  ovsdb-idl.at: Add IDL tests for C library with TCP connection.

Unlike Python IDL, C library tested only with unix sockets.
These tests enlarges the coverage.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/05aec0e5a7a4...b481a4cc93c6
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the git mailing list