gesockopt: fall-through in switch/case only if a case contains no code at all

This commit is contained in:
goldsimon 2017-05-12 20:33:57 +02:00
parent 5c35bab26c
commit 8345e9035f

View File

@ -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",