From 8345e9035fcf3dc026b91117a10081b92b86a9a8 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 12 May 2017 20:33:57 +0200 Subject: [PATCH] gesockopt: fall-through in switch/case only if a case contains no code at all --- src/api/sockets.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index 73aecf02..d6cee222 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -2448,14 +2448,15 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt /* The option flags */ case SO_BROADCAST: - if (NETCONNTYPE_GROUP(sock->conn->type) != NETCONN_UDP) { - done_socket(sock); - return ENOPROTOOPT; - } case SO_KEEPALIVE: #if SO_REUSE case SO_REUSEADDR: #endif /* SO_REUSE */ + if ((optname == SO_BROADCAST) && + (NETCONNTYPE_GROUP(sock->conn->type) != NETCONN_UDP)) { + done_socket(sock); + return ENOPROTOOPT; + } LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int); *(int*)optval = ip_get_option(sock->conn->pcb.ip, optname); LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, optname=0x%x, ..) = %s\n",