mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
socket-util: Log the kernel assigned port number when asked.
So far, we log the kernel assigned port number when the port number is not specified. On Windows, this happens multiple times because "unix" sockets are implemented internally via TCP ports. This means that many tests, specially the ovs-ofctl monitor tests, need to filter out the additional messages. Doing that is not a big deal, but I think it will keep manifesting in future tests added by Linux developers. With this commit, we simply don't print the kernel assigned TCP ports on Windows when done for "unix" sockets. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -552,10 +552,14 @@ inet_parse_passive(const char *target_, int default_port,
|
||||
*
|
||||
* 'dscp' becomes the DSCP bits in the IP headers for the new connection. It
|
||||
* should be in the range [0, 63] and will automatically be shifted to the
|
||||
* appropriately place in the IP tos field. */
|
||||
* appropriately place in the IP tos field.
|
||||
*
|
||||
* If 'kernel_print_port' is true and the port is dynamically assigned by
|
||||
* the kernel, print the chosen port. */
|
||||
int
|
||||
inet_open_passive(int style, const char *target, int default_port,
|
||||
struct sockaddr_storage *ssp, uint8_t dscp)
|
||||
struct sockaddr_storage *ssp, uint8_t dscp,
|
||||
bool kernel_print_port)
|
||||
{
|
||||
bool kernel_chooses_port;
|
||||
struct sockaddr_storage ss;
|
||||
@@ -616,7 +620,7 @@ inet_open_passive(int style, const char *target, int default_port,
|
||||
VLOG_ERR("%s: getsockname: %s", target, sock_strerror(error));
|
||||
goto error;
|
||||
}
|
||||
if (kernel_chooses_port) {
|
||||
if (kernel_chooses_port && kernel_print_port) {
|
||||
VLOG_INFO("%s: listening on port %"PRIu16,
|
||||
target, ss_get_port(&ss));
|
||||
}
|
||||
|
Reference in New Issue
Block a user