From: Alan T. DeKok Date: Thu, 9 Nov 2017 18:32:53 +0000 (-0500) Subject: initialize 'when', too X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=147747c321d45272aefcae8a0ea7cd0233324c25;p=thirdparty%2Ffreeradius-server.git initialize 'when', too --- diff --git a/src/lib/util/udp.c b/src/lib/util/udp.c index dd2e562bbe5..930562c1659 100644 --- a/src/lib/util/udp.c +++ b/src/lib/util/udp.c @@ -187,6 +187,11 @@ ssize_t udp_recv(int sockfd, void *data, size_t data_len, int flags, if ((flags & UDP_FLAGS_PEEK) != 0) sock_flags |= MSG_PEEK; + if (when) { + when->tv_sec = 0; + when->tv_usec = 0; + } + /* * Connected sockets already know src/dst IP/port */ @@ -195,11 +200,6 @@ ssize_t udp_recv(int sockfd, void *data, size_t data_len, int flags, goto done; } - if (when) { - when->tv_sec = 0; - when->tv_usec = 0; - } - /* * Receive the packet. The OS will discard any data in the * packet after "len" bytes.