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
/
rconn.c
diff --git
a/lib/rconn.c
b/lib/rconn.c
index
ba606fb
..
c8bddab
100644
(file)
--- a/
lib/rconn.c
+++ b/
lib/rconn.c
@@
-380,10
+380,14
@@
run_ACTIVE(struct rconn *rc)
{
if (timed_out(rc)) {
unsigned int base = MAX(rc->last_received, rc->state_entered);
{
if (timed_out(rc)) {
unsigned int base = MAX(rc->last_received, rc->state_entered);
- rconn_send(rc, make_echo_request(), NULL);
VLOG_DBG("%s: idle %u seconds, sending inactivity probe",
rc->name, (unsigned int) (time_now() - base));
VLOG_DBG("%s: idle %u seconds, sending inactivity probe",
rc->name, (unsigned int) (time_now() - base));
+
+ /* Ordering is important here: rconn_send() can transition to BACKOFF,
+ * and we don't want to transition back to IDLE if so, because then we
+ * can end up queuing a packet with vconn == NULL and then *boom*. */
state_transition(rc, S_IDLE);
state_transition(rc, S_IDLE);
+ rconn_send(rc, make_echo_request(), NULL);
return;
}
return;
}