It's documented to return -1 if the version isn't yet known, but in fact
it returned 0.
Signed-off-by: Ben Pfaff <blp@nicira.com>
*
* A vconn that has successfully connected (that is, vconn_connect() or
* vconn_send() or vconn_recv() has returned 0) always negotiated a version. */
-enum ofp_version
+int
vconn_get_version(const struct vconn *vconn)
{
- return vconn->version;
+ return vconn->version ? vconn->version : -1;
}
static void
#include <stdbool.h>
#include "openvswitch/types.h"
+#include "openflow/openflow.h"
#ifdef __cplusplus
extern "C" {
ovs_be16 vconn_get_remote_port(const struct vconn *);
ovs_be32 vconn_get_local_ip(const struct vconn *);
ovs_be16 vconn_get_local_port(const struct vconn *);
-enum ofp_version vconn_get_version(const struct vconn *);
+int vconn_get_version(const struct vconn *);
int vconn_connect(struct vconn *);
int vconn_recv(struct vconn *, struct ofpbuf **);
int vconn_send(struct vconn *, struct ofpbuf *);