From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Berg Subject: Re: [PATCH 1/2] netlink: add NLA_REJECT policy type Date: Mon, 17 Sep 2018 11:39:54 +0200 Message-ID: <1537177194.2957.7.camel@sipsolutions.net> References: <20180913084603.7979-1-johannes@sipsolutions.net> <20180913.155934.742447935316828936.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, mkubecek-AlSwsSmVLrQ@public.gmane.org To: David Miller Return-path: In-Reply-To: <20180913.155934.742447935316828936.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> Sender: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Thu, 2018-09-13 at 15:59 -0700, David Miller wrote: > From: Johannes Berg > Date: Thu, 13 Sep 2018 10:46:02 +0200 > > > + NL_SET_BAD_ATTR(extack, nla); > > + if (extack && !extack->_msg) > > + NL_SET_ERR_MSG(extack, > > + "Attribute failed policy validation"); > > Given the lively discussion that resulted from this conditional I am > pretty sure we want to override existing messages. > > If we have an existing message, and we continued to process and > parse anyways, then the existing message was informational or > a warning. > > The message should be overridden when the action will be to fail, as > it will be here when we return -EINVAL. Not just -EINVAL, but yeah, I've just reworked the patch to do this. johannes