\f
/* Creates and returns an OFPT_ECHO_REQUEST message with an empty payload. */
struct ofpbuf *
-make_echo_request(void)
+make_echo_request(enum ofp_version ofp_version)
{
- return ofpraw_alloc_xid(OFPRAW_OFPT_ECHO_REQUEST, OFP10_VERSION,
+ return ofpraw_alloc_xid(OFPRAW_OFPT_ECHO_REQUEST, ofp_version,
htonl(0), 0);
}
struct list *replies);
/* Encoding simple OpenFlow messages. */
-struct ofpbuf *make_echo_request(void);
+struct ofpbuf *make_echo_request(enum ofp_version);
struct ofpbuf *make_echo_reply(const struct ofp_header *rq);
struct ofpbuf *ofputil_encode_barrier_request(enum ofp_version);
{
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;
}
struct vconn *vconn;
struct ofpbuf *reply;
- request = make_echo_request();
open_vconn(argv[1], &vconn);
+ request = make_echo_request(vconn_get_version(vconn));
run(vconn_transact(vconn, request, &reply), "talking to %s", argv[1]);
if (reply->size != sizeof(struct ofp_header)) {
ovs_fatal(0, "reply does not match request");