ofp-util: Make make_echo_request() aware of different OpenFlow versions.
[openvswitch] / lib / rconn.c
index eae6a7e8faaea82b11c97f240e48620284ffd395..ddf578c185aded6b2440d9b18e5b8141c46b41a8 100644 (file)
@@ -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;
     }