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
This commit is contained in:
Robert Watson 2011-08-06 19:20:17 +00:00
parent 39c5320dad
commit e397f116c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224688

View File

@ -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;