mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-05 06:39:52 +00:00
fixed compiling sockets.c with LWIP_UDP==0
This commit is contained in:
parent
676dd74140
commit
082fe71c0c
@ -1350,12 +1350,10 @@ ssize_t
|
||||
lwip_sendmsg(int s, const struct msghdr *msg, int flags)
|
||||
{
|
||||
struct lwip_sock *sock;
|
||||
int i;
|
||||
#if LWIP_TCP
|
||||
u8_t write_flags;
|
||||
size_t written;
|
||||
#endif
|
||||
ssize_t size = 0;
|
||||
err_t err = ERR_OK;
|
||||
|
||||
sock = get_socket(s);
|
||||
@ -1398,6 +1396,8 @@ lwip_sendmsg(int s, const struct msghdr *msg, int flags)
|
||||
#if LWIP_UDP || LWIP_RAW
|
||||
{
|
||||
struct netbuf chain_buf;
|
||||
int i;
|
||||
ssize_t size = 0;
|
||||
|
||||
LWIP_UNUSED_ARG(flags);
|
||||
LWIP_ERROR("lwip_sendmsg: invalid msghdr name", (((msg->msg_name == NULL) && (msg->msg_namelen == 0)) ||
|
||||
@ -2562,7 +2562,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_TOS) = %d\n",
|
||||
s, *(int *)optval));
|
||||
break;
|
||||
#if LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS
|
||||
#if LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS && LWIP_UDP
|
||||
case IP_MULTICAST_TTL:
|
||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, u8_t);
|
||||
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_UDP) {
|
||||
@ -2593,7 +2593,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_MULTICAST_LOOP) = %d\n",
|
||||
s, *(int *)optval));
|
||||
break;
|
||||
#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS */
|
||||
#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS && LWIP_UDP */
|
||||
default:
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, UNIMPL: optname=0x%x, ..)\n",
|
||||
s, optname));
|
||||
@ -2992,7 +2992,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
||||
}
|
||||
break;
|
||||
#endif /* LWIP_NETBUF_RECVINFO */
|
||||
#if LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS
|
||||
#if LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS && LWIP_UDP
|
||||
case IP_MULTICAST_TTL:
|
||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP);
|
||||
udp_set_multicast_ttl(sock->conn->pcb.udp, (u8_t)(*(const u8_t*)optval));
|
||||
@ -3013,7 +3013,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
||||
udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) & ~UDP_FLAGS_MULTICAST_LOOP);
|
||||
}
|
||||
break;
|
||||
#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS */
|
||||
#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS && LWIP_UDP */
|
||||
#if LWIP_IGMP
|
||||
case IP_ADD_MEMBERSHIP:
|
||||
case IP_DROP_MEMBERSHIP:
|
||||
|
Loading…
x
Reference in New Issue
Block a user