diff options
author | Ben Pfaff <blp@nicira.com> | 2013-11-07 09:39:03 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-12-13 14:59:02 -0800 |
commit | 2b4cca6fc24ece6c727f877a9f17dd5f32da7f84 (patch) | |
tree | c0cf05a622b3a23214214c1a008fccf20fe4b52f /lib/vconn.c | |
parent | 61eae43774eeb57d2dbe442b29220ed7ef2c3d03 (diff) | |
download | openvswitch-2b4cca6fc24ece6c727f877a9f17dd5f32da7f84.tar.gz |
vconn: Reply with OFPBRC_BAD_VERSION for bad version.
Testers keep wanting to know why this doesn't work. I think it's a silly
test, but it's easy enough to make them happy.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/vconn.c')
-rw-r--r-- | lib/vconn.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/vconn.c b/lib/vconn.c index 5708987d5..2a83eda47 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -631,11 +631,25 @@ vconn_recv(struct vconn *vconn, struct ofpbuf **msgp) type != OFPTYPE_ERROR && type != OFPTYPE_ECHO_REQUEST && type != OFPTYPE_ECHO_REPLY)) { + struct ofpbuf *reply; + VLOG_ERR_RL(&bad_ofmsg_rl, "%s: received OpenFlow version " "0x%02"PRIx8" != expected %02x", vconn->name, oh->version, vconn->version); + + /* Send a "bad version" reply, if we can. */ + reply = ofperr_encode_reply(OFPERR_OFPBRC_BAD_VERSION, oh); + retval = vconn_send(vconn, reply); + if (retval) { + VLOG_INFO_RL(&bad_ofmsg_rl, + "%s: failed to queue error reply (%s)", + vconn->name, ovs_strerror(retval)); + ofpbuf_delete(reply); + } + + /* Suppress the received message, as if it had not arrived. */ + retval = EAGAIN; ofpbuf_delete(msg); - retval = EPROTO; } } } |