pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/28647 )
Change subject: stream: getsockopt ret socklen_t is unsigned ......................................................................
stream: getsockopt ret socklen_t is unsigned
Found out by following gcc warning: """ libosmo-netif/src/stream.c:147:11: warning: argument to variable-length array may be too large due to conversion from ‘int’ to ‘unsigned int’ [-Wvla-larger-than=] 147 | uint8_t buf[sctp_sockopt_event_subscribe_size]; | ^~~ """
Change-Id: I181ae5c0480788fc96abd2bb1edf003244884c8f --- M src/stream.c 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/47/28647/1
diff --git a/src/stream.c b/src/stream.c index e6b731c..cdd0eae 100644 --- a/src/stream.c +++ b/src/stream.c @@ -87,7 +87,7 @@ return -1; }
-static int sctp_sockopt_event_subscribe_size = 0; +static unsigned int sctp_sockopt_event_subscribe_size = 0;
static int determine_sctp_sockopt_event_subscribe_size(void) { @@ -96,7 +96,7 @@ int sd, rc;
/* only do this once */ - if (sctp_sockopt_event_subscribe_size != 0) + if (sctp_sockopt_event_subscribe_size > 0) return 0;
sd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); @@ -108,7 +108,7 @@ if (rc < 0) return rc;
- sctp_sockopt_event_subscribe_size = buf_len; + sctp_sockopt_event_subscribe_size = (unsigned int)buf_len;
LOGP(DLINP, LOGL_INFO, "sizes of 'struct sctp_event_subscribe': compile-time %zu, kernel: %u\n", sizeof(struct sctp_event_subscribe), sctp_sockopt_event_subscribe_size);