[Devel] [PATCH rh7] netlink: Don't manipulate @sk_peek_off if data fetching failed

Cyrill Gorcunov gorcunov at virtuozzo.com
Thu Dec 22 22:59:28 PST 2016


On Thu, Dec 22, 2016 at 04:45:10PM -0800, Andrey Vagin wrote:
> 
> Actually, this patch breaks the old behaviour even when MSG_PEEK isn't set.
> 
> I was thinking a bit more and I don't understand why it is a problem. If
> we can't fill a buffer, an error will be returned and a user will be able
> to set peek_offset to get these data again.

A user doesn't have to set peek again, without the patch the internal state
of sk is context-dependant, which is broken design. Take a look on unix
sockets code, they DON'T modify offset if something earlier failed for
exactly same reason.


More information about the Devel mailing list