Skip to content

Commit

Permalink
[TA1487] Passing correct size to getnameinfo() (#77)
Browse files Browse the repository at this point in the history
* [TA1487] Passing correct size to getnameinfo()

Signed-off-by: satbir <[email protected]>
  • Loading branch information
satbirchhikara authored Jul 2, 2018
1 parent dc8e605 commit ab66b53
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/libzrepl/data_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,18 +723,18 @@ uzfs_zvol_io_conn_acceptor(void *arg)
continue;
}
#ifdef DEBUG
hbuf = kmem_alloc(sizeof (NI_MAXHOST), KM_SLEEP);
sbuf = kmem_alloc(sizeof (NI_MAXSERV), KM_SLEEP);
rc = getnameinfo(&in_addr, in_len, hbuf, sizeof (hbuf),
sbuf, sizeof (sbuf), NI_NUMERICHOST |
NI_NUMERICSERV);
hbuf = kmem_alloc(NI_MAXHOST, KM_SLEEP);
sbuf = kmem_alloc(NI_MAXSERV, KM_SLEEP);
rc = getnameinfo(&in_addr, in_len, hbuf,
NI_MAXHOST, sbuf, NI_MAXSERV,
NI_NUMERICHOST | NI_NUMERICSERV);
if (rc == 0) {
LOG_DEBUG("Accepted connection from %s:%s",
hbuf, sbuf);
}

kmem_free(hbuf, sizeof (NI_MAXHOST));
kmem_free(sbuf, sizeof (NI_MAXSERV));
kmem_free(hbuf, NI_MAXHOST);
kmem_free(sbuf, NI_MAXSERV);
#endif
if (events[i].data.fd == io_sfd) {
LOG_INFO("Connection req for data IO");
Expand Down

0 comments on commit ab66b53

Please sign in to comment.