Jason Xing wrote:
On Mon, Sep 2, 2024 at 11:02 PM Willem de Bruijn willemdebruijn.kernel@gmail.com wrote:
Jason Xing wrote:
From: Jason Xing kernelxing@tencent.com
Add the SO_PEEK_OFF selftest for UDP. In this patch, I mainly do three things:
- rename tcp_so_peek_off.c
- adjust for UDP protocol
- add selftests into it
Suggested-by: Jon Maloy jmaloy@redhat.com Signed-off-by: Jason Xing kernelxing@tencent.com
A few minor comments. Nothing important.
Subject to Stan's point about .gitignore:
Reviewed-by: Willem de Bruijn willemb@google.com
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.