summaryrefslogtreecommitdiff
path: root/lib/stream-unix.c
diff options
context:
space:
mode:
authorGurucharan Shetty <gshetty@nicira.com>2014-10-22 15:35:18 -0700
committerGurucharan Shetty <gshetty@nicira.com>2014-10-23 11:07:32 -0700
commitb7cefbf7e52eb0262adb8447409d6ee52eb68a59 (patch)
treeabb2f004882e47ffebf969ddb1870972d4bcde3a /lib/stream-unix.c
parent0e55eddc30506f269412becae7254647630c4140 (diff)
downloadopenvswitch-b7cefbf7e52eb0262adb8447409d6ee52eb68a59.tar.gz
stream-tcp: Call setsockopt TCP_NODELAY after TCP is connected.
On Windows platform, TCP_NODELAY can only be set when TCP is established. (This is an observed behavior and not written in any MSDN documentation.) The current code does not create any problems while running unit tests (because connections get established immediately) but is reportedly observed while connecting to a different machine. commit 8b76839(Move setsockopt TCP_NODELAY to when TCP is connected.) made changes to call setsockopt with TCP_NODELAY after TCP is connected only in lib/stream-ssl.c. We need the same change for stream-tcp too and this commit does that. Currently, a failure of setting TCP_NODELAY results in reporting the error and then closing the socket. This commit changes that behavior such that an error is reported if setting TCP_NODELAY fails, but the connection itself is not torn down. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/stream-unix.c')
-rw-r--r--lib/stream-unix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/stream-unix.c b/lib/stream-unix.c
index ab5252b29..29077c6a2 100644
--- a/lib/stream-unix.c
+++ b/lib/stream-unix.c
@@ -57,7 +57,8 @@ unix_open(const char *name, char *suffix, struct stream **streamp,
}
free(connect_path);
- return new_fd_stream(name, fd, check_connection_completion(fd), streamp);
+ return new_fd_stream(name, fd, check_connection_completion(fd),
+ AF_UNIX, streamp);
}
const struct stream_class unix_stream_class = {
@@ -117,7 +118,7 @@ punix_accept(int fd, const struct sockaddr_storage *ss, size_t ss_len,
} else {
strcpy(name, "unix");
}
- return new_fd_stream(name, fd, 0, streamp);
+ return new_fd_stream(name, fd, 0, AF_UNIX, streamp);
}
const struct pstream_class punix_pstream_class = {