From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [iproute2 PATCH] flower: Represent HW traffic classes as classid values Date: Tue, 7 Nov 2017 10:57:54 +0900 Message-ID: <20171107105754.45b0449d@shemminger-XPS-13-9360> References: <150969924183.26117.13696607595033656049.stgit@anamdev.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, alexander.h.duyck@intel.com, jiri@resnulli.us, jhs@mojatatu.com, alexander.duyck@gmail.com, xiyou.wangcong@gmail.com To: Amritha Nambiar Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:49057 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752307AbdKGB6e (ORCPT ); Mon, 6 Nov 2017 20:58:34 -0500 Received: by mail-pg0-f66.google.com with SMTP id v78so9762619pgb.5 for ; Mon, 06 Nov 2017 17:58:34 -0800 (PST) In-Reply-To: <150969924183.26117.13696607595033656049.stgit@anamdev.jf.intel.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 03 Nov 2017 01:54:01 -0700 Amritha Nambiar wrote: > + tc = strtoul(*argv, &end, 0); > + if (*end) { > + fprintf(stderr, "Illegal TC index\n"); > + return -1; > + } I will apply this, looks fine. While looking at the flower parsing I noticed that the code should have been using the function invarg() in utils rather than calling fprintf(stderr,...). This is for a couple of reasons the first is that its good to print the offending argument as well as the reason, and the other one is that if a bad argument is given then exit should be called rather than returning -1. If -1 is returned and batch mode is used, the batch continues. For the case of bogus arguments it is better to die right away.