Subject: Re: [PATCH net-next] rtnetlink: return ENODEV when ifname does not exist and group is given

From: Jakub Kicinski <[email-masked]>
Date: Fri, 1 Apr 2022 10:25:49 -0700

On Fri, 1 Apr 2022 15:57:52 +0200 Florent Fourcot wrote:
> > Would it be slightly cleaner to have a similar check in
> > validate_linkmsg()? Something like:
> > 
> > 	if (!dev && !ifm->ifi_index && tb[IFLA_GROUP] &&
> > 	    (tb[IFLA_IFNAME] || tb[IFLA_ALT_IFNAME]))  
> 
> 
> That will add some complexity in validate_linkmsg, since we will need to 
> check NLM_F_CREATE flag before (it's probably not an error when 
> NLM_F_CREATE is set), and to give ifm as argument to check ifi_index.
> 
> I do not have a strong opinion on this topic, and if you think your idea 
> is a better solution I can give a try in a v2.

Okay, fair. Please repost on Monday, tho, net-next is currently closed
(contrary to some status pages may be telling you...)