projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
in-band: Fix memory leak in in_band_destroy().
[openvswitch]
/
lib
/
stream-tcp.c
diff --git
a/lib/stream-tcp.c
b/lib/stream-tcp.c
index dd55845fc6f751cf91b7a8cd89a20070fcf03a49..a9bcaeb475ce2f91829d466a3537921969021c96 100644
(file)
--- a/
lib/stream-tcp.c
+++ b/
lib/stream-tcp.c
@@
-101,16
+101,20
@@
static int ptcp_accept(int fd, const struct sockaddr *sa, size_t sa_len,
struct stream **streamp);
static int
struct stream **streamp);
static int
-ptcp_open(const char *name UNUSED, char *suffix, struct pstream **pstreamp)
+ptcp_open(const char *name
OVS_
UNUSED, char *suffix, struct pstream **pstreamp)
{
{
+ struct sockaddr_in sin;
+ char bound_name[128];
int fd;
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;
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
}
static int