I'm in the process of trying to use RAW IP sockets (not RAW Ethernet) and have come across an issue with the way setsockopt() is handled in the NDK (current version is 2.20.04.26)
Basically the SockSet() handler in sock.c ORs SOCK_IP_HDRINCL into ps->IpFlags if IP_HDRINCL is set.
Now, in SockCreatePacket() in sockint.c, ps->IpFlags is checked (ANDed) with IP_HDRINCL.
Not only is this not great practice, but the #defines are actually 2 and 1 for IP_HDRINCL and SOCK_IP_HDRINCL respectively. Therefore this never (and can) never works.
Can someone please take a look and make sure I've not missed anything and if this is a known issue?
For now I am going to progress with flipping the private SOCK_xxx defines around such that they match the public IP_xxx defines....... but this is not really a great solution.