Allow more than one socket entry for a file descriptor. This is needed

for supporting 1-to-many style SCTP sockets. For other sochets, there
is no functional change.

MFC after: 3 days
This commit is contained in:
Michael Tuexen 2015-06-13 20:01:54 +00:00
parent baa7f281a3
commit 7e80c6b0e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=284352

View File

@ -669,10 +669,8 @@ display(void)
if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid))
continue;
hash = (int)((uintptr_t)xf->xf_data % HASHSIZE);
for (s = sockhash[hash]; s != NULL; s = s->next)
if ((void *)s->socket == xf->xf_data)
break;
if (s == NULL)
for (s = sockhash[hash]; s != NULL; s = s->next) {
if ((void *)s->socket != xf->xf_data)
continue;
if (!check_ports(s))
continue;
@ -693,6 +691,7 @@ display(void)
pos += xprintf("%d ", xf->xf_fd);
displaysock(s, pos);
}
}
if (opt_j >= 0)
return;
for (hash = 0; hash < HASHSIZE; hash++) {