# HG changeset patch # User Matt Johnston # Date 1424356950 -28800 # Node ID 1fff5d7163f6574be0c823799f2af8182223f077 # Parent ea4676b840ef46c8d936eb4ae2cce87649455406# Parent 5ad81aa19c2d3b92d6825aa47baf866d5ac50e2c merge diff -r ea4676b840ef -r 1fff5d7163f6 dbutil.c --- a/dbutil.c Thu Feb 19 22:41:51 2015 +0800 +++ b/dbutil.c Thu Feb 19 22:42:30 2015 +0800 @@ -1070,9 +1070,10 @@ #endif #else { - struct msghdr message = {0}; + struct msghdr message; int flags; int res; + memset(&message, 0x0, sizeof(message)); message.msg_name = r->ai_addr; message.msg_namelen = r->ai_addrlen; diff -r ea4676b840ef -r 1fff5d7163f6 dbutil.h --- a/dbutil.h Thu Feb 19 22:41:51 2015 +0800 +++ b/dbutil.h Thu Feb 19 22:42:30 2015 +0800 @@ -80,6 +80,13 @@ #if defined(__linux__) && HAVE_SENDMSG #define DROPBEAR_TCP_FAST_OPEN void set_listen_fast_open(int sock); +/* may be supported by kernel but not libc */ +#ifndef TCP_FASTOPEN +#define TCP_FASTOPEN 23 +#endif +#ifndef MSG_FASTOPEN +#define MSG_FASTOPEN 0x20000000 +#endif #endif int dropbear_listen(const char* address, const char* port,