}
static int
-pssl_open(const char *name, char *suffix, struct pstream **pstreamp)
+pssl_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp)
{
struct pssl_pstream *pssl;
+ struct sockaddr_in sin;
+ char bound_name[128];
int retval;
int fd;
if (fd < 0) {
return -fd;
}
+ sprintf(bound_name, "pssl:%"PRIu16":"IP_FMT,
+ ntohs(sin.sin_port), IP_ARGS(&sin.sin_addr.s_addr));
pssl = xmalloc(sizeof *pssl);
- pstream_init(&pssl->pstream, &pssl_pstream_class, name);
+ pstream_init(&pssl->pstream, &pssl_pstream_class, bound_name);
pssl->fd = fd;
*pstreamp = &pssl->pstream;
return 0;
static int
ptcp_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp)
{
+ struct sockaddr_in sin;
+ char bound_name[128];
int fd;
- fd = inet_open_passive(SOCK_STREAM, suffix, -1, NULL);
+ fd = inet_open_passive(SOCK_STREAM, suffix, -1, &sin);
if (fd < 0) {
return -fd;
- } else {
- return new_fd_pstream("ptcp", fd, ptcp_accept, NULL, pstreamp);
}
+
+ sprintf(bound_name, "ptcp:%"PRIu16":"IP_FMT,
+ ntohs(sin.sin_port), IP_ARGS(&sin.sin_addr.s_addr));
+ return new_fd_pstream(bound_name, fd, ptcp_accept, NULL, pstreamp);
}
static int