1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-14 19:33:59 +02:00
openwrt-packages/net/libreswan/patches/010-nanosleep.patch
Rosen Penev c1a9e69fef
libreswan: Replace usleep with nanosleep
usleep is optionally unavailable with uClibc-ng.

Added PKG_LICENSE_FILES

Added PKG_CPE_ID for proper CVE tracking.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-07-19 00:42:32 -07:00

22 lines
653 B
Diff

--- a/programs/pluto/send.c
+++ b/programs/pluto/send.c
@@ -26,7 +26,7 @@
*
*/
-#include <unistd.h> /* for usleep() */
+#include <time.h> /* for nanosleep() */
#include <errno.h>
#include "defs.h"
@@ -173,7 +173,8 @@ bool send_chunks(const char *where, bool just_a_keepalive,
/* Send a duplicate packet when this impair is enabled - used for testing */
if (IMPAIR(JACOB_TWO_TWO)) {
/* sleep for half a second, and second another packet */
- usleep(500000);
+ const struct timespec req = {0, 500 * 1000 * 1000};
+ nanosleep(&req, NULL);
ip_endpoint_buf b;
DBG_log("JACOB 2-2: resending %zu bytes for %s through %s:%d to %s:",