[ovs-dev] [PATCH 1/2] ofctrl: Fix version check in ofctrl_inject_packet().

Ben Pfaff blp at ovn.org
Fri Jan 6 01:03:05 UTC 2017


"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 <jpettit at ovn.org>
Fixes: 714651c7db6a ("ovn-controller: Introduce "inject-pkt" ovs-appctl command.")
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 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



More information about the dev mailing list