From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Ricardo Leitner Subject: Re: [PATCH v3 net-next] net:sched: add action inheritdsfield to skbedit Date: Sat, 9 Jun 2018 19:51:39 -0300 Message-ID: <20180609225136.GE31423@localhost.localdomain> References: <38C2B0E3-E108-433B-906A-A2D72CEE4CAE@bu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "davem@davemloft.net" , "netdev@vger.kernel.org" , "jhs@mojatatu.com" , Michel Machado , "xiyou.wangcong@gmail.com" To: "Fu, Qiaobin" Return-path: Received: from mail-qt0-f195.google.com ([209.85.216.195]:37228 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbeFIWwQ (ORCPT ); Sat, 9 Jun 2018 18:52:16 -0400 Received: by mail-qt0-f195.google.com with SMTP id q13-v6so17029981qtp.4 for ; Sat, 09 Jun 2018 15:52:16 -0700 (PDT) Content-Disposition: inline In-Reply-To: <38C2B0E3-E108-433B-906A-A2D72CEE4CAE@bu.edu> Sender: netdev-owner@vger.kernel.org List-ID: On Sat, Jun 09, 2018 at 10:35:48PM +0000, Fu, Qiaobin wrote: ... > @@ -73,6 +100,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, > struct tc_skbedit *parm; > struct tcf_skbedit *d; > u32 flags = 0, *priority = NULL, *mark = NULL, *mask = NULL; > + u64 *pure_flags = NULL; > u16 *queue_mapping = NULL, *ptype = NULL; > bool exists = false; > int ret = 0, err; > @@ -114,6 +142,11 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, > mask = nla_data(tb[TCA_SKBEDIT_MASK]); > } > > + if (tb[TCA_SKBEDIT_FLAGS] != NULL) { > + pure_flags = nla_data(tb[TCA_SKBEDIT_FLAGS]); > + flags |= *pure_flags; It shouldn't allow setting flags other than the expected ones. > + } > + > parm = nla_data(tb[TCA_SKBEDIT_PARMS]); > > exists = tcf_idr_check(tn, parm->index, a, bind);