[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Missing SOL_TCP?
From: |
Grant Edwards |
Subject: |
Re: [lwip-users] Missing SOL_TCP? |
Date: |
Wed, 13 Apr 2022 16:06:53 -0000 (UTC) |
User-agent: |
slrn/1.0.3 (Linux) |
On 2022-04-13, Ian Abbott <abbotti@mev.co.uk> 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