From e1bd3bee5cd7065e019b4b6736918b2fda95fa49 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 7 Jan 2010 11:12:36 -0800 Subject: socket-util: Allow binding without a port number in inet_open_passive(). The test-vconn program binds a socket to a nonspecific port number. To add SSL support to this program, it needs to be able to use SSL, and the stream library is the easiest way to do that. But the stream library can't bind to a nonspecific port. This commit adds that feature, by adding it to the function that the stream SSL library uses as a building block. --- lib/stream-tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/stream-tcp.c') diff --git a/lib/stream-tcp.c b/lib/stream-tcp.c index bfcf35c7..94ff74cb 100644 --- a/lib/stream-tcp.c +++ b/lib/stream-tcp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ ptcp_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp) { int fd; - fd = inet_open_passive(SOCK_STREAM, suffix, 0); + fd = inet_open_passive(SOCK_STREAM, suffix, -1); if (fd < 0) { return -fd; } else { -- cgit v1.2.3