From: Po Liu Date: Mon, 29 Jun 2020 02:04:20 +0000 (+0800) Subject: action police: make 'mtu' could be set independently in police action X-Git-Tag: v5.9.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc4d9f982f8d0bb00fb61e0f4633e98522af597a;p=thirdparty%2Fiproute2.git action police: make 'mtu' could be set independently in police action Current police action must set 'rate' and 'burst'. 'mtu' parameter set the max frame size and could be set alone without 'rate' and 'burst' in some situation. Offloading to hardware for example, 'mtu' could limit the flow max frame size. Signed-off-by: Po Liu Signed-off-by: David Ahern --- diff --git a/tc/m_police.c b/tc/m_police.c index 7eb47f8e3..83b25db49 100644 --- a/tc/m_police.c +++ b/tc/m_police.c @@ -161,8 +161,8 @@ action_ctrl_ok: return -1; /* Must at least do late binding, use TB or ewma policing */ - if (!rate64 && !avrate && !p.index) { - fprintf(stderr, "'rate' or 'avrate' MUST be specified.\n"); + if (!rate64 && !avrate && !p.index && !mtu) { + fprintf(stderr, "'rate' or 'avrate' or 'mtu' MUST be specified.\n"); return -1; }