X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Frconn.c;h=5e5533ffa5cbf40311ee8930af7720f81c6ad34c;hb=7a25bd99246a548891427d62ccefb65f765bbc48;hp=eae6a7e8faaea82b11c97f240e48620284ffd395;hpb=133f2dc95454bc3052efdb58e4e26dce4860285e;p=openvswitch diff --git a/lib/rconn.c b/lib/rconn.c index eae6a7e8..5e5533ff 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -354,7 +354,7 @@ reconnect(struct rconn *rc) VLOG_INFO("%s: connecting...", rc->name); } rc->n_attempted_connections++; - retval = vconn_open(rc->target, OFP10_VERSION, &rc->vconn, rc->dscp); + retval = vconn_open(rc->target, 0, &rc->vconn, rc->dscp); if (!retval) { rc->remote_ip = vconn_get_remote_ip(rc->vconn); rc->local_ip = vconn_get_local_ip(rc->vconn); @@ -446,14 +446,19 @@ run_ACTIVE(struct rconn *rc) { if (timed_out(rc)) { unsigned int base = MAX(rc->last_activity, rc->state_entered); + int version; + VLOG_DBG("%s: idle %u seconds, sending inactivity probe", rc->name, (unsigned int) (time_now() - base)); + version = rconn_get_version(rc); + assert(version >= 0 && version <= 0xff); + /* 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); - rconn_send(rc, make_echo_request(), NULL); + rconn_send(rc, make_echo_request(version), NULL); return; }