From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Ricardo Leitner Subject: Re: [PATCH net-next v4 1/4] net/sched: user-space can't set unknown tcfa_action values Date: Thu, 26 Jul 2018 21:28:59 -0300 Message-ID: <20180727002857.GC20482@localhost.localdomain> References: <2717eb1db9f7b89905809d00391bdab2ad123c00.1532611319.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, Jamal Hadi Salim , Cong Wang , Jiri Pirko , Daniel Borkmann , Eyal Birger , "David S. Miller" To: Paolo Abeni Return-path: Received: from mail-qt0-f196.google.com ([209.85.216.196]:38577 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731829AbeG0BsR (ORCPT ); Thu, 26 Jul 2018 21:48:17 -0400 Received: by mail-qt0-f196.google.com with SMTP id y19-v6so3485708qto.5 for ; Thu, 26 Jul 2018 17:29:03 -0700 (PDT) Content-Disposition: inline In-Reply-To: <2717eb1db9f7b89905809d00391bdab2ad123c00.1532611319.git.pabeni@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: Hi, On Thu, Jul 26, 2018 at 04:34:57PM +0200, Paolo Abeni wrote: ... > @@ -895,6 +904,14 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, > } > } > > + if (!tcf_action_valid(a->tcfa_action)) { > + net_warn_ratelimited("invalid %d action value, using " > + "TC_ACT_UNSPEC instead", a->tcfa_action); Now that it is reporting the error via extack, do we really need this warn net_warn? extack will be shown as a warning by iproute2 even if the command succeeds. > + NL_SET_ERR_MSG(extack, "invalid action value, using " > + "TC_ACT_UNSPEC instead"); Quoted strings shouldn't be broken down into multiple lines.. > + a->tcfa_action = TC_ACT_UNSPEC; > + } > + > return a; > > err_mod: > -- > 2.17.1 >