> On linux side I can see there is IP_HDRINCL option which configures
> this. In the CHANGELOG I can see that support is added to LWIP in 2017
> but I can't see any usage in the code.

That changelog entry is a bit misleading. Support was only added to the
core/callback/raw/native API, not the socket API. See [1] and [2].

From the last patch in the series:
> This patch adds a new RAW_FLAGS_HDRINCL flag to the raw core
> implementation. When this flag is set on a RAW PCB, [...]
>
> This feature allows the IP_HDRINCL socket option to be implemented
> in higher layers with no further effort. [...]

If you want to use the socket API, it sounds like all that's needed to
add support is to define IP_HDRINCL (in lwip/sockets.h) and have
lwip_setsockopt_impl call `raw_setflags(sock->conn->pcb.raw,
RAW_FLAGS_HDRINCL)` for it. lwip_getsockopt_impl should also be able to
retrieve the flag. If you aren't able to submit a patch, you could use
the LWIP_HOOK_SOCKETS_SETSOCKOPT/GETSOCKOPT hooks.

[1]: 
https://git.savannah.nongnu.org/cgit/lwip.git/log/?qt=range&q=52f448978f...e3435401f1
[2]: https://savannah.nongnu.org/patch/?9208

-Billy

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to