From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next v5 1/4] net/sched: user-space can't set unknown tcfa_action values Date: Mon, 30 Jul 2018 16:21:55 +0200 Message-ID: <20180730142155.GC10626@nanopsycho> References: <951ad078ad4d5ee108abcd85189460aed7948634.1532934532.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paolo Abeni , netdev@vger.kernel.org, Cong Wang , Daniel Borkmann , Marcelo Ricardo Leitner , Eyal Birger , "David S. Miller" To: Jamal Hadi Salim Return-path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:34321 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbeG3P7w (ORCPT ); Mon, 30 Jul 2018 11:59:52 -0400 Received: by mail-wm0-f65.google.com with SMTP id l2-v6so8532636wme.1 for ; Mon, 30 Jul 2018 07:24:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Mon, Jul 30, 2018 at 04:03:50PM CEST, jhs@mojatatu.com wrote: >On 30/07/18 08:30 AM, Paolo Abeni wrote: >> } >> + if (!tcf_action_valid(a->tcfa_action)) { >> + NL_SET_ERR_MSG(extack, "invalid action value, using TC_ACT_UNSPEC instead"); >> + a->tcfa_action = TC_ACT_UNSPEC; >> + } >> + >> return a; > > >I think it would make a lot more sense to just reject the entry than >changing it underneath the user to a default value. Least element of >suprise. It might break existing user who is incorrectly doing it. But I'm okay with both solutions. > >cheers, >jamal