git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rconn: Fix segfault when the idle timeout races with connection failure.
[sliver-openvswitch.git]
/
lib
/
vconn-tcp.c
diff --git
a/lib/vconn-tcp.c
b/lib/vconn-tcp.c
index
be4cd95
..
79d8332
100644
(file)
--- a/
lib/vconn-tcp.c
+++ b/
lib/vconn-tcp.c
@@
-44,7
+44,8
@@
#include "packets.h"
#include "socket-util.h"
#include "util.h"
#include "packets.h"
#include "socket-util.h"
#include "util.h"
-#include "openflow.h"
+#include "openflow/openflow.h"
+#include "vconn-provider.h"
#include "vconn-stream.h"
#include "vlog.h"
#include "vconn-stream.h"
#include "vlog.h"
@@
-87,7
+88,7
@@
tcp_open(const char *name, char *suffix, struct vconn **vconnp)
host_name = strtok_r(suffix, "::", &save_ptr);
port_string = strtok_r(NULL, "::", &save_ptr);
if (!host_name) {
host_name = strtok_r(suffix, "::", &save_ptr);
port_string = strtok_r(NULL, "::", &save_ptr);
if (!host_name) {
- error(0, "%s: bad peer name format", name);
+
ofp_
error(0, "%s: bad peer name format", name);
return EAFNOSUPPORT;
}
return EAFNOSUPPORT;
}
@@
-126,8
+127,13
@@
tcp_open(const char *name, char *suffix, struct vconn **vconnp)
}
struct vconn_class tcp_vconn_class = {
}
struct vconn_class tcp_vconn_class = {
- .name = "tcp",
- .open = tcp_open,
+ "tcp", /* name */
+ tcp_open, /* open */
+ NULL, /* close */
+ NULL, /* connect */
+ NULL, /* recv */
+ NULL, /* send */
+ NULL, /* wait */
};
\f
/* Passive TCP. */
};
\f
/* Passive TCP. */
@@
-136,7
+142,7
@@
static int ptcp_accept(int fd, const struct sockaddr *sa, size_t sa_len,
struct vconn **vconnp);
static int
struct vconn **vconnp);
static int
-ptcp_open(const char *name, char *suffix, struct
vconn **
vconnp)
+ptcp_open(const char *name, char *suffix, struct
pvconn **p
vconnp)
{
struct sockaddr_in sin;
int retval;
{
struct sockaddr_in sin;
int retval;
@@
-166,7
+172,7
@@
ptcp_open(const char *name, char *suffix, struct vconn **vconnp)
return error;
}
return error;
}
- return new_pstream_
vconn("ptcp", fd, ptcp_accept,
vconnp);
+ return new_pstream_
pvconn("ptcp", fd, ptcp_accept, p
vconnp);
}
static int
}
static int
@@
-187,8
+193,8
@@
ptcp_accept(int fd, const struct sockaddr *sa, size_t sa_len,
return new_tcp_vconn(name, fd, 0, sin, vconnp);
}
return new_tcp_vconn(name, fd, 0, sin, vconnp);
}
-struct
vconn_class ptcp_
vconn_class = {
-
.name =
"ptcp",
-
.open =
ptcp_open,
+struct
pvconn_class ptcp_p
vconn_class = {
+ "ptcp",
+ ptcp_open,
};
};