socket-util: Work around Unix domain socket path name limits on Linux.
authorBen Pfaff <blp@nicira.com>
Tue, 9 Nov 2010 23:58:36 +0000 (15:58 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 10 Nov 2010 18:56:01 +0000 (10:56 -0800)
commit6e170b4c7802f4f388ec63d4c1146de830d98669
tree9156b13a42a07e4f872fb5bde1764556e5645648
parente61c056cb94aeffc86cb314ea32726be9b666724
socket-util: Work around Unix domain socket path name limits on Linux.

Many Open vSwitch tests fail on Debian's automatic build machines because
the builds occur in deeply nested directories with long names.  OVS tries
to bind and connect to Unix domain sockets using absolute path names, which
in combination with long directory names means that the socket's name
exceeds the limit for Unix domain socket names (108 bytes on Linux).

This commit works around the problem on Linux by indirecting through
/proc/self/fd/<dirfd>/<basename> when names exceed the maximum that can be
used directly.

Reported-by: Hector Oron <hector.oron@gmail.com>
Reported-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reported-by: Roger Leigh <rleigh@codelibre.net>
Debian bug #602891.
Debian bug #602911.
AUTHORS
lib/socket-util.c
tests/.gitignore
tests/automake.mk
tests/library.at
tests/test-unix-socket.c [new file with mode: 0644]