mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 23:35:27 +00:00
ofp-actions: Enforce minimum length for packet truncation during parsing.
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. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user