Signed-off-by: Simon Horman <[email protected]>
---
v4
* Initial post
---
lib/ofp-util.c | 4 ++--
lib/ofp-util.h | 2 +-
lib/rconn.c | 7 ++++++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 1efa466..4baae73 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -3483,12 +3483,12 @@ ofputil_decode_stats_msg_flags(const struct ofp_header
*oh)
/* Creates and returns an OFPT_ECHO_REQUEST message with an empty payload. */
struct ofpbuf *
-make_echo_request(void)
+make_echo_request(uint8_t ofp_version)
{
struct ofp_header *rq;
struct ofpbuf *out = ofpbuf_new(sizeof *rq);
rq = ofpbuf_put_uninit(out, sizeof *rq);
- rq->version = OFP10_VERSION;
+ rq->version = ofp_version;
rq->type = OFPT_ECHO_REQUEST;
rq->length = htons(sizeof *rq);
rq->xid = htonl(0);
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index a1a5150..538278f 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -570,7 +570,7 @@ uint32_t ofputil_decode_stats_msg_subtype(const struct
ofp_header *);
uint16_t ofputil_decode_stats_msg_flags(const struct ofp_header *);
/* Encoding simple OpenFlow messages. */
-struct ofpbuf *make_echo_request(void);
+struct ofpbuf *make_echo_request(uint8_t ofp_version);
struct ofpbuf *make_echo_reply(const struct ofp_header *rq);
struct ofpbuf *ofputil_encode_barrier_request(uint8_t ofp_version);
diff --git a/lib/rconn.c b/lib/rconn.c
index 2ddfc69..c4cf371 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -434,14 +434,19 @@ run_ACTIVE(struct rconn *rc)
{
if (timed_out(rc)) {
unsigned int base = MAX(rc->last_received, 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;
}
--
1.7.10.2.484.gcd07cc5
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev