Re: [PATCH net-next] selftests: add selftest for UDP SO_PEEK_OFF support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Xing wrote:
> On Mon, Sep 2, 2024 at 11:02 PM Willem de Bruijn
> <willemdebruijn.kernel@xxxxxxxxx> wrote:
> >
> > Jason Xing wrote:
> > > From: Jason Xing <kernelxing@xxxxxxxxxxx>
> > >
> > > Add the SO_PEEK_OFF selftest for UDP. In this patch, I mainly do
> > > three things:
> > > 1. rename tcp_so_peek_off.c
> > > 2. adjust for UDP protocol
> > > 3. add selftests into it
> > >
> > > Suggested-by: Jon Maloy <jmaloy@xxxxxxxxxx>
> > > Signed-off-by: Jason Xing <kernelxing@xxxxxxxxxxx>
> >
> > A few minor comments. Nothing important.
> >
> > Subject to Stan's point about .gitignore:
> >
> > Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>
> 
> Thanks for your review!
> 
> >
> > > -int tcp_peek_offset_probe(sa_family_t af)
> > > +int sk_peek_offset_probe(sa_family_t af, int proto)
> > >  {
> > > +     int type = (proto == IPPROTO_TCP ? SOCK_STREAM : SOCK_DGRAM);
> > >       int optv = 0;
> > >       int ret = 0;
> > >       int s;
> > >
> > > -     s = socket(af, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
> > > +     s = socket(af, type, proto);
> >
> > Removing the SOCK_CLOEXEC because not relevant to this single thread
> > process, I suppose?
> 
> Yep. We don't need this one.
> 
> >
> > Not important, but no need for proto, can just be 0.
> 
> You're right. I wonder if it is better if we explicitly pass the proto
> here? I would like not to touch it here.

It's not better or worse. Just not needed. So either way.
 




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux