Does sosend() need CURVNET_SET/CURVNET_RESTORE?

Rick Macklem rmacklem at uoguelph.ca
Mon Feb 3 22:59:38 UTC 2020


Kristof Provost wrote:
>On 2 Feb 2020, at 13:22, Rick Macklem wrote:
>> The current krpc code calls sosend() and soreceive() without any
>> CURVNET_SET()/CURVNET_RESTORE() wrapped around them.
>>
>sosend() and soreceive() do the CURVENT_SET()/CURVNET_RESTORE() dance
>for you.
Duh, I'm getting old. When I looked at sosend(), I didn't spot the CURVNET calls
in it.

>> When I recently used sosend_generic(), it panic'd without them.
>>
>sosend_generic() does not, because usually sosend() calls it, so it’d
>already be set.
Ok, I had thought the
                error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio,
1706	                    top, control, flags, td);
call in sosend() was calling tcp_usr_send().
If it is just calling sosend_generic(), then I can just call sosend() for the
KERN_TLS case. I'll check to see if sosend()  is calling sosend_generic().

Thanks for your help, rick

Best regards,
Kristof


More information about the freebsd-net mailing list