"enum ofp_version" is unsigned in the System V ABI used by Linux, so
it will never be less than 0, so an rconn with an unnegotiated version will
never be found properly.  This fixes the problem.

CC: Justin Pettit <[email protected]>
Fixes: 714651c7db6a ("ovn-controller: Introduce "inject-pkt" ovs-appctl 
command.")
Signed-off-by: Ben Pfaff <[email protected]>
---
 ovn/controller/ofctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index ceff138..44c2210 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2016 Nicira, Inc.
+/* Copyright (c) 2015, 2016, 2017 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1119,7 +1119,7 @@ char *
 ofctrl_inject_pkt(const struct ovsrec_bridge *br_int, const char *flow_s,
                   const struct shash *addr_sets)
 {
-    enum ofp_version version = rconn_get_version(swconn);
+    int version = rconn_get_version(swconn);
     if (version < 0) {
         return xstrdup("OpenFlow channel not ready.");
     }
-- 
2.10.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to