stream-unix: only use path-based socket names
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>
Tue, 19 Jul 2016 20:05:51 +0000 (17:05 -0300)
committerBen Pfaff <blp@ovn.org>
Wed, 20 Jul 2016 03:06:45 +0000 (20:06 -0700)
commitdd23522f68ad5081b8816dc27bd0727ebe0d9576
tree9dd995de58edd998cc91f57b8eb59f7bf931c8cc
parent70c7cfef188b5ae9940abd5b7d9fe46b1fa88c8e
stream-unix: only use path-based socket names

FreeBSD returns a socklen of sockaddr_storage when doing an accept on an unix
STREAM socket. The current code will assume it means a sun_path larger than 0.

That breaks some tests like the one below which don't expect to find "unix::" on
the logs.

As a Linux abstract address would not have a more useful name either, it's
better to check that sun_path starts with a non-zero byte and return 0 length in
case it doesn't.

402: ovs-ofctl replace-flows with --bundle      FAILED (ovs-ofctl.at:2928)
2016-07-08T12:44:30.068Z|00020|vconn|DBG|unix:: sent (Success): OFPT_HELLO (OF1.6) (xid=0x1):

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/socket-util-unix.c
lib/socket-util.h
lib/stream-unix.c