From 32788f2c74debed5b3878e7babc8d544d3dd352a Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 23 Nov 2017 22:12:41 +0100 Subject: [PATCH] sockets.c: use udp_is_flag_set() instead of udp_flags() Signed-off-by: goldsimon --- src/api/sockets.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index d8d79057..beafa0c3 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -2941,13 +2941,13 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt case SO_NO_CHECK: LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, *optlen, int, NETCONN_UDP); #if LWIP_UDPLITE - if ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0) { + if (udp_is_flag_set(sock->conn->pcb.udp, UDP_FLAGS_UDPLITE)) { /* this flag is only available for UDP, not for UDP lite */ done_socket(sock); return EAFNOSUPPORT; } #endif /* LWIP_UDPLITE */ - *(int *)optval = (udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_NOCHKSUM) ? 1 : 0; + *(int *)optval = udp_is_flag_set(sock->conn->pcb.udp, UDP_FLAGS_NOCHKSUM) ? 1 : 0; break; #endif /* LWIP_UDP*/ default: @@ -3339,7 +3339,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_ case SO_NO_CHECK: LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, int, NETCONN_UDP); #if LWIP_UDPLITE - if ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0) { + if (udp_is_flag_set(sock->conn->pcb.udp, UDP_FLAGS_UDPLITE)) { /* this flag is only available for UDP, not for UDP lite */ done_socket(sock); return EAFNOSUPPORT;