diff options
author | Ben Pfaff <blp@nicira.com> | 2012-11-15 22:09:07 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-11-16 09:20:21 -0800 |
commit | e43928f2862b83a3c13e8662490a22fa25405be5 (patch) | |
tree | 60da2c09411816082da3d2c039c57700635628e3 /utilities | |
parent | 7cd903564fa4f64a815af311232213f0e770d012 (diff) |
ofp-util: Make ofputil_encode_set_protocol() able to return failure.
Soon, it's not going to be possible to switch between every possible
protocol on an established OpenFlow connection, yet
ofputil_encode_set_protocol() didn't have a documented way to report such
a problem. This commit adds a means for reporting and makes its callers
able to handle the problem.
Also, initially make ofputil_encode_set_protocol() fail when the current
and requested protocols are for different OpenFlow versions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-ofctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 914be984..08c3aa92 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -763,7 +763,7 @@ try_set_protocol(struct vconn *vconn, enum ofputil_protocol want, request = ofputil_encode_set_protocol(*cur, want, &next); if (!request) { - return true; + return *cur == want; } run(vconn_transact_noreply(vconn, request, &reply), |