Re: [PATCH net-next V2 12/13] selftests: drv-net: psp: Fix responder parsing

Cosmin Ratiu <[email protected]>
Newsgroups org.kernel.vger.linux-rdma,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.netdev
Message-ID <[email protected]>
On Fri, 2026-08-07 at 17:58 -0700, Jakub Kicinski wrote:
> On Tue, 4 Aug 2026 11:35:34 +0300 Tariq Toukan wrote:
> >  			off += n;
> > -			n = off;
> 
> > +#define cmd(_name,
> > _extra_sz)						\
> >  		({						
> > 	\
> >  			ssize_t sz =
> > sizeof(_name);			\
> > -			bool match = n >= sz
> > &&	!memcmp(buf, _name, sz); \
> > +			bool match = off >= sz + (_extra_sz)
> > &&		\
> > +				!memcmp(buf, _name,
> > sz);		\
> 
> Please don't replace off by n.

I actually replaced n by off. Did you mean "don't replace n by off"?

Because the two are identical after the recv error checking. I don't
see the point of maintaining two variables when one suffices. Either n
or off can describe the number of bytes in buf. off is static and
persists across chunks, while n is temporary.

So to clarify, do you want to keep both?

Cosmin.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.