diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-06-22 10:37:18 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-06-23 12:21:13 -0700 |
| commit | c821124b25eb72b8c81894a5560e59c5cd5845f0 (patch) | |
| tree | fcd310c8c7044b48cf5b5af9bb42b07774ca7007 /utilities | |
| parent | b053c7c1a0c12669a4591e73893d4f426fef571f (diff) | |
| download | openvswitch-c821124b25eb72b8c81894a5560e59c5cd5845f0.tar.gz | |
ovs-ofctl: Accept only valid flow_mod and flow_stats_request fields.
OpenFlow commands have several idiosyncratic fields that are used in some
cases and ignored in others. Until now, ovs-ofctl has been lax about
allowing some of them in places where they are ignored. This commit
tightens the checks to exactly what is allowed.
Bug #5979.
Reported-by: Reid Price <reid@nicira.com>
Diffstat (limited to 'utilities')
| -rw-r--r-- | utilities/ovs-ofctl.8.in | 13 | ||||
| -rw-r--r-- | utilities/ovs-ofctl.c | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index c4fbed90b..433731cfe 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -553,8 +553,8 @@ Finally, field assignments to \fBduration\fR, \fBn_packets\fR, or command to be used as input for other commands that parse flows. . .PP -The \fBadd\-flow\fR and \fBadd\-flows\fR commands require an additional -field, which must be the final field specified: +The \fBadd\-flow\fR, \fBadd\-flows\fR, and \fBmod\-flows\fR commands +require an additional field, which must be the final field specified: . .IP \fBactions=\fR[\fItarget\fR][\fB,\fItarget\fR...]\fR Specifies a comma-separated list of actions to take on a packet when the @@ -738,14 +738,15 @@ support an additional optional field: . A cookie is an opaque identifier that can be associated with the flow. \fIvalue\fR can be any 64-bit number and need not be unique among -flows. +flows. If this field is omitted, these commands set a default cookie +value of 0. . .PP The following additional field sets the priority for flows added by the \fBadd\-flow\fR and \fBadd\-flows\fR commands. For \fBmod\-flows\fR and \fBdel\-flows\fR when \fB\-\-strict\fR is specified, priority must match along with the rest of the flow -specification. Other commands ignore the priority value. +specification. Other commands do not allow priority to be specified. . .IP \fBpriority=\fIvalue\fR The priority at which a wildcarded entry will match in comparison to @@ -778,10 +779,6 @@ and \fBdel\-flows\fR commands support one additional optional field: \fBout_port=\fIport\fR If set, a matching flow must include an output action to \fIport\fR. . -.PP -The \fBdump\-flows\fR and \fBdump\-aggregate\fR commands support an -additional optional field: -. .SS "Table Entry Output" . The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 7d3b7fbee..3d101789d 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1035,7 +1035,7 @@ read_flows_from_file(const char *filename, struct classifier *cls, int index) struct flow_mod fm; ofpbuf_init(&actions, 64); - parse_ofp_str(&fm, &actions, ds_cstr(&s), true); + parse_ofp_str(&fm, OFPFC_ADD, ds_cstr(&s), true); version = xmalloc(sizeof *version); version->cookie = fm.cookie; |
