Does sosend() need CURVNET_SET/CURVNET_RESTORE?

Rick Macklem rmacklem at uoguelph.ca
Mon Feb 3 23:02:56 UTC 2020


Hans Petter Selasky wrote:
>On 2020-02-02 22:22, Rick Macklem wrote:
>> Hi,
>>
>> The current krpc code calls sosend() and soreceive() without any
>> CURVNET_SET()/CURVNET_RESTORE() wrapped around them.
>>
>> When I recently used sosend_generic(), it panic'd without them.
>>
>> Do they need to be added around sosend()/soreceive()?
>>
>> I'll admit to knowing nothing about vnet.
>>
>> Thanks, rick
>
>What is the panic backtrace?
I'd have to do it again to find out...

>Usually one of these tree variants is used:
>
>CURVNET_SET(TD_TO_VNET(td));
>CURVNET_SET(ifp->if_vnet);
>CURVNET_SET(so->so_vnet);
I got rid of the panic by adding the third one, which is what I now see
sosend() uses.
However, if sosend() is calling sosend_generic(), I'll just call sosend(),
which takes care of it.

Thanks for your help, rick

--HPS




More information about the freebsd-net mailing list