16 Feb
2024
16 Feb
'24
11:55 a.m.
On Fri, Feb 16, 2024 at 11:13 AM Jon Maloy
There is also the following alternative:
if (flags & MSG_PEEK) sk_peek_offset_fwd(sk, used); else if (flags & MSG_TRUNC) sk_peek_offset_bwd(sk, used);
This is the way we use it, and probably the typical usage. It would force a user to drain the receive queue with MSG_TRUNC whenever he is using MSG_PEEK_OFF, but I don't really see that as a limitation.
Anyway, if Paolo's suggestion solves the problem this shouldn't be necessary.
I think the suggestion to move sk_peek_off came from my first message on this thread ;) "We need to move sk_peek_off in a better location before we accept this patch." Anyway, a complete reorg of 'struct sock' was overdue, I am working on it.