diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-10-18 11:18:10 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-10-18 11:18:23 -0700 |
| commit | 27bcf966b4057623f7b4d856c0348a1e0eb452e0 (patch) | |
| tree | 9ec65e3a4fdc6d16a039841a594e9a180ca95898 /lib/ofp-util.c | |
| parent | e97a10342018f992634fa90d25c007eb60c25662 (diff) | |
| download | openvswitch-27bcf966b4057623f7b4d856c0348a1e0eb452e0.tar.gz | |
datapath: Simplify ODPAT_SET_DL_TCI action.
There's no need to have a mask in this action, because both parts of the
TCI are part of the flow structure.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'lib/ofp-util.c')
| -rw-r--r-- | lib/ofp-util.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/ofp-util.c b/lib/ofp-util.c index d8d3ced58..99e5943c5 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -587,7 +587,25 @@ check_action(const union ofp_action *a, unsigned int len, int max_ports) return check_output_port(ntohs(a->output.port), max_ports); case OFPAT_SET_VLAN_VID: + error = check_action_exact_len(a, len, 8); + if (error) { + return error; + } + if (a->vlan_vid.vlan_vid & ~htons(0xfff)) { + return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT); + } + return 0; + case OFPAT_SET_VLAN_PCP: + error = check_action_exact_len(a, len, 8); + if (error) { + return error; + } + if (a->vlan_vid.vlan_vid & ~7) { + return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT); + } + return 0; + case OFPAT_STRIP_VLAN: case OFPAT_SET_NW_SRC: case OFPAT_SET_NW_DST: |
