errno = ENOSYS;
-#ifndef NDEBUG
+ /*
+ * Clang analyzer doesn't see that getsockname initialises
+ * the memory passed to it.
+ */
+#ifdef __clang_analyzer__
memset(&si, 0, sizeof(si));
#endif
proto = SOL_IP;
flag = IP_PKTINFO;
#else
-#ifdef IP_RECVDSTADDR
+# ifdef IP_RECVDSTADDR
/*
* Set the IP_RECVDSTADDR option (BSD). Note:
*/
proto = IPPROTO_IP;
flag = IP_RECVDSTADDR;
-#else
+# else
return -1;
-#endif
+# endif
#endif
#ifdef AF_INET6
*/
flag = FR_IPV6_RECVPKTINFO;
#else
+# ifdef EPROTONOSUPPORT
+ errno = EPROTONOSUPPORT;
+# endif
return -1;
# endif
#endif
if (!to || !tolen) return recvfrom(s, buf, len, flags, from, fromlen);
/*
+ * Clang analyzer doesn't see that getsockname initialises
+ * the memory passed to it.
+ */
+#ifdef __clang_analyzer__
+ memset(&si, 0, sizeof(si));
+#endif
+
+ /*
* recvmsg doesn't provide sin_port so we have to
* retrieve it using getsockname().
*/
struct sockaddr_in from, to, in;
char buf[TESTLEN];
char *destip = DESTIP;
- int port = DEF_PORT;
+ uint16_t port = DEF_PORT;
int n, server_socket, client_socket, fl, tl, pid;
if (argc > 1) destip = argv[1];