Otherwise, specifying something like output(port=1,max_len=5) would parse OK and then cause a failure when it was received by the switch.
Signed-off-by: Ben Pfaff <[email protected]> --- lib/ofp-actions.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index c2cef769e839..405b7c7eff81 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -640,6 +640,12 @@ parse_truncate_subfield(const char *arg_, if (err) { return err; } + + if (output_trunc->max_len < ETH_HEADER_LEN) { + return xasprintf("max_len %"PRIu32" is less than the minimum " + "value %d", + output_trunc->max_len, ETH_HEADER_LEN); + } } else { return xasprintf("invalid key '%s' in output_trunc argument", key); -- 2.20.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
