SO_BROADCAST is valid for SOCK_DGRAM only

This commit is contained in:
goldsimon 2017-05-08 21:18:40 +02:00
parent 9dee346000
commit 79bd47736c

View File

@ -2448,6 +2448,10 @@ 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) != SOCK_DGRAM) {
done_socket(sock);
return ENOPROTOOPT;
}
case SO_KEEPALIVE:
#if SO_REUSE
case SO_REUSEADDR: