On 2022-04-13, Ian Abbott <[email protected]> wrote:
> On 13/04/2022 15:45, Grant Edwards wrote:
>
>> Where are the definitions for other SOL_xxxxx values (e.g. SOL_TCP)
>> supposed to come from?
>
> Use IPPROTO_TCP instead of SOL_TCP as the "level".

Thanks, that is indeed the right answer.

It appears that the other SOL_xxx values (like SOL_TCP) are a Linux
feature intended to insulate the setsockopt() "level" value from the
actual IP protocol numbers (e.g. IPPROTO_TCP). On Linux SOL_foo is
currently the same value as IPPROTO_foo, but somebody wanted to allow
for some future case where that wasn't true.

Initially all of the example code Google found (and all of my old
application code) used SOL_TCP. After I knew to search for setsockopt
using IPPROTO_TCP, I did find a few examples (apparently for Mac OSes)
that used IPPROTO_TCP instead of SOL_TCP.

--
Grant


_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to