Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Feb 2020 22:59:36 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Kristof Provost <kp@FreeBSD.org>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: Does sosend() need CURVNET_SET/CURVNET_RESTORE?
Message-ID:  <YTBPR01MB3374372120674C746D75F504DD000@YTBPR01MB3374.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <E4E34E8E-0EE1-41FC-A365-1070DF16B076@FreeBSD.org>
References:  <YTBPR01MB337446173B7D480145BBB6C6DD010@YTBPR01MB3374.CANPRD01.PROD.OUTLOOK.COM>, <E4E34E8E-0EE1-41FC-A365-1070DF16B076@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTBPR01MB3374372120674C746D75F504DD000>