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
(This used to be commit
5b01206f1bb2e62c08bda34b45904ec4f83ac5de)
return real_recvfrom(s, buf, len, flags, from, fromlen);
}
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);
/* 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);
return real_sendto(s, buf, len, flags, to, tolen);
}
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);
switch (si->type) {
case SOCK_STREAM:
ret = real_send(s, buf, len, flags);
return real_recv(s, buf, len, 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);
ret = real_recv(s, buf, len, flags);
if (ret == -1 && errno != EAGAIN && errno != ENOBUFS) {
swrap_dump_packet(si, NULL, SWRAP_RECV_RST, NULL, 0);
return real_send(s, buf, len, flags);
}
return real_send(s, buf, len, flags);
}
+ len = MIN(len, 1500);
+
ret = real_send(s, buf, len, flags);
if (ret == -1) {
ret = real_send(s, buf, len, flags);
if (ret == -1) {