From e52730d1fb92a99e43a12b935629f1f7aa1058e8 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sat, 20 Nov 2010 18:01:01 +0000 Subject: [PATCH] Fixed bug #31170: lwip_setsockopt() does not set socket number --- CHANGELOG | 3 +++ src/api/sockets.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5d4e4f2b..9e8564c2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -229,6 +229,9 @@ HISTORY ++ Bugfixes: + 2010-11-20: Simon Goldschmidt + * sockets.c: Fixed bug #31170: lwip_setsockopt() does not set socket number + 2010-11-20: Simon Goldschmidt * sockets.h: Fixed bug #31304: Changed SHUT_RD, SHUT_WR and SHUT_RDWR to resemble other stacks. diff --git a/src/api/sockets.c b/src/api/sockets.c index 6d1cc800..8cecb21e 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -105,8 +105,10 @@ struct lwip_select_cb { struct lwip_setgetsockopt_data { /** socket struct for which to change options */ struct lwip_sock *sock; +#ifdef LWIP_DEBUG /** socket index for which to change options */ int s; +#endif /* LWIP_DEBUG */ /** level of the option to process */ int level; /** name of the option to process */ @@ -1615,6 +1617,9 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) /* Now do the actual option processing */ data.sock = sock; +#ifdef LWIP_DEBUG + data.s = s; +#endif /* LWIP_DEBUG */ data.level = level; data.optname = optname; data.optval = optval; @@ -2022,6 +2027,9 @@ lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t opt /* Now do the actual option processing */ data.sock = sock; +#ifdef LWIP_DEBUG + data.s = s; +#endif /* LWIP_DEBUG */ data.level = level; data.optname = optname; data.optval = (void*)optval;