[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha4-55-g5b01206

Stefan Metzmacher metze at samba.org
Tue Jun 10 06:46:28 GMT 2008


The branch, v4-0-test has been updated
       via  5b01206f1bb2e62c08bda34b45904ec4f83ac5de (commit)
      from  1d52d9cc70158dbe30325220aa5c1e6203c8b72b (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 5b01206f1bb2e62c08bda34b45904ec4f83ac5de
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jun 10 08:33:24 2008 +0200

    socket_wrapper: truncate packets to a 1500 byte payload
    
    Truncate sendto(), recvfrom(), send() and recv() to 1500 bytes
    so that're getting a correctly formatted pcap file and the result
    look more like real network traffic.
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source/lib/socket_wrapper/socket_wrapper.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/socket_wrapper/socket_wrapper.c b/source/lib/socket_wrapper/socket_wrapper.c
index 86d9f7a..981df52 100644
--- a/source/lib/socket_wrapper/socket_wrapper.c
+++ b/source/lib/socket_wrapper/socket_wrapper.c
@@ -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) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list