From e397f116c3375b97948f1dca780a2c5f29a9ad26 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sat, 6 Aug 2011 19:20:17 +0000 Subject: [PATCH] Properly initialise the "len" argument to getsockname(2) in the tcpdrop regression test so that it works (more) consistently. Approved by: re (bz) Sponsored by: Juniper Networks --- tools/regression/netinet/tcpdrop/tcpdrop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/regression/netinet/tcpdrop/tcpdrop.c b/tools/regression/netinet/tcpdrop/tcpdrop.c index e6b7f436d3a3..7cfc65860d71 100644 --- a/tools/regression/netinet/tcpdrop/tcpdrop.c +++ b/tools/regression/netinet/tcpdrop/tcpdrop.c @@ -233,6 +233,7 @@ main(int argc, char *argv[]) bzero(&sin, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); + len = sizeof(sin); if (getsockname(listen_fd, (struct sockaddr *)&sin, &len) < 0) err(-1, "getsockname"); port = sin.sin_port;