X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-ofctl.c;fp=utilities%2Fovs-ofctl.c;h=deba9dd78f73243939df4ba6b07d61b758fbea18;hb=6dc5374435cc25bc4051b27bd52635e609a8872a;hp=91c7f28fed5935df2d388f39cfef3448b2c647e8;hpb=2f486d4c80dada4194b170ebed0bcf77454b5404;p=sliver-openvswitch.git diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 91c7f28fe..deba9dd78 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -174,6 +174,23 @@ parse_options(int argc, char *argv[]) uint32_t versions; enum ofputil_protocol version_protocols; + /* For now, ovs-ofctl only enables OpenFlow 1.0 by default. This is + * because ovs-ofctl implements command such as "add-flow" as raw OpenFlow + * requests, but those requests have subtly different semantics in + * different OpenFlow versions. For example: + * + * - In OpenFlow 1.0, a "mod-flow" operation that does not find any + * existing flow to modify adds a new flow. + * + * - In OpenFlow 1.1, a "mod-flow" operation that does not find any + * existing flow to modify adds a new flow, but only if the mod-flow + * did not match on the flow cookie. + * + * - In OpenFlow 1.2 and a later, a "mod-flow" operation never adds a + * new flow. + */ + set_allowed_ofp_versions("OpenFlow10"); + for (;;) { unsigned long int timeout; int c;