[ovs-dev] [PATCH v3 1/2] OF support and translation of generic encap and decap
Ben Pfaff
blp at ovn.org
Tue Aug 1 15:26:07 UTC 2017
On Tue, Aug 01, 2017 at 12:32:20PM +0000, Yang, Yi Y wrote:
> #2.
> [Ben] I suspect that decode_NXAST_RAW_DECAP() should report an error if properties are present, since it doesn't support properties.
>
> [Yi] It is impossible.
What is impossible? It is easy to detect that properties are present
and report an error:
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index d0437f20922a..7be302a4005d 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -4263,6 +4263,11 @@ decode_NXAST_RAW_DECAP(const struct nx_action_decap *nad,
enum ofp_version ofp_version OVS_UNUSED,
struct ofpbuf *ofpacts)
{
+ if (ntohs(nad->len) > sizeof *nad) {
+ /* No properties supported yet. */
+ return OFPERR_OFPBPC_BAD_TYPE;
+ }
+
struct ofpact_decap * decap;
decap = ofpact_put_DECAP(ofpacts);
More information about the dev
mailing list