diff options
Diffstat (limited to 'source4/lib/socket_wrapper')
-rw-r--r-- | source4/lib/socket_wrapper/config.m4 | 7 | ||||
-rw-r--r-- | source4/lib/socket_wrapper/socket_wrapper.c | 12 |
2 files changed, 10 insertions, 9 deletions
diff --git a/source4/lib/socket_wrapper/config.m4 b/source4/lib/socket_wrapper/config.m4 index 8ff91075bb..f3ffb895a9 100644 --- a/source4/lib/socket_wrapper/config.m4 +++ b/source4/lib/socket_wrapper/config.m4 @@ -20,10 +20,3 @@ fi AC_SUBST(DEFAULT_TEST_OPTIONS) AC_SUBST(HAVE_SOCKET_WRAPPER) AC_SUBST(SOCKET_WRAPPER_OBJS) - -# Look for the vdeplug library -AC_CHECK_HEADERS(libvdeplug.h) -if test x"$ac_cv_header_libvdeplug_h" = xyes; then - AC_DEFINE(HAVE_VDEPLUG, 1, [Whether the VDE plug library is available]) - SMB_EXT_LIB(VDEPLUG,[-lvdeplug],[],[],[]) -fi diff --git a/source4/lib/socket_wrapper/socket_wrapper.c b/source4/lib/socket_wrapper/socket_wrapper.c index 86d9f7a312..336179d837 100644 --- a/source4/lib/socket_wrapper/socket_wrapper.c +++ b/source4/lib/socket_wrapper/socket_wrapper.c @@ -697,8 +697,8 @@ static const char *socket_wrapper_pcap_file(void) { static int initialized = 0; static const char *s = NULL; - static const struct swrap_file_hdr h; - static const struct swrap_packet p; + static const struct swrap_file_hdr h = { 0, }; + static const struct swrap_packet p = { { 0, }, { { 0, }, { { 0, } } } }; if (initialized == 1) { return s; @@ -1643,6 +1643,8 @@ _PUBLIC_ ssize_t swrap_recvfrom(int s, void *buf, size_t len, int flags, struct return real_recvfrom(s, buf, len, flags, from, fromlen); } + len = MIN(len, 1500); + /* irix 6.4 forgets to null terminate the sun_path string :-( */ memset(&un_addr, 0, sizeof(un_addr)); ret = real_recvfrom(s, buf, len, flags, (struct sockaddr *)&un_addr, &un_addrlen); @@ -1671,6 +1673,8 @@ _PUBLIC_ ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, con return real_sendto(s, buf, len, flags, to, tolen); } + len = MIN(len, 1500); + switch (si->type) { case SOCK_STREAM: ret = real_send(s, buf, len, flags); @@ -1764,6 +1768,8 @@ _PUBLIC_ ssize_t swrap_recv(int s, void *buf, size_t len, int flags) return real_recv(s, buf, len, flags); } + len = MIN(len, 1500); + ret = real_recv(s, buf, len, flags); if (ret == -1 && errno != EAGAIN && errno != ENOBUFS) { swrap_dump_packet(si, NULL, SWRAP_RECV_RST, NULL, 0); @@ -1786,6 +1792,8 @@ _PUBLIC_ ssize_t swrap_send(int s, const void *buf, size_t len, int flags) return real_send(s, buf, len, flags); } + len = MIN(len, 1500); + ret = real_send(s, buf, len, flags); if (ret == -1) { |