implemented API functions to access so_options of IP pcbs (UDP, TCP, RAW) (fixes bug #35061)

This commit is contained in:
goldsimon
2011-12-17 22:12:01 +01:00
parent 8114627d6a
commit c8647c0396
7 changed files with 31 additions and 20 deletions

View File

@@ -1761,7 +1761,7 @@ lwip_getsockopt_internal(void *arg)
case SO_REUSEPORT:
#endif /* SO_REUSE */
/*case SO_USELOOPBACK: UNIMPL */
*(int*)optval = sock->conn->pcb.ip->so_options & optname;
*(int*)optval = ip_get_option(sock->conn->pcb.ip, optname);
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, optname=0x%x, ..) = %s\n",
s, optname, (*(int*)optval?"on":"off")));
break;
@@ -2178,9 +2178,9 @@ lwip_setsockopt_internal(void *arg)
#endif /* SO_REUSE */
/* UNIMPL case SO_USELOOPBACK: */
if (*(int*)optval) {
sock->conn->pcb.ip->so_options |= optname;
ip_set_option(sock->conn->pcb.ip, optname);
} else {
sock->conn->pcb.ip->so_options &= ~optname;
ip_reset_option(sock->conn->pcb.ip, optname);
}
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, SOL_SOCKET, optname=0x%x, ..) -> %s\n",
s, optname, (*(int*)optval?"on":"off")));