Re: [PATCH v1] rtnetlink: let rtnl_bridge_setlink checks IFLA_BRIDGE_MODE length

From: Lin Ma
Date: Tue Jul 25 2023 - 01:48:30 EST


Hello Hangbin,

>
> If we got attr tIFLA_BRIDGE_FLAGS first, it will break here and not check
> the later IFLA_BRIDGE_MODE.
>
> > +
> > + if (nla_type(attr) == IFLA_BRIDGE_MODE) {
> > + if (nla_len(attr) < sizeof(u16))
> > + return -EINVAL;
> > + }
> > }
> > }
>
> Thanks
> Hangbin

Yeah, you are soooo right, will fix this ASAP

Regards
Lin