nc captures 1024 bytes
- From: Weiguang Shi <wgshizz@xxxxxxxxx>
- Date: Mon, 27 Aug 2007 16:05:26 -0700 (PDT)
Hi,
My system is FreeBSD 6.2. I sent a UDP datagram of 1464 bytes to port
1234 where nc was waiting
% nc -n -u -l 1234 >tt
Afterwards, the size of tt, however, was only 1024 bytes.
I noticed this piece of code in nc
341 if (uflag) {
342 int rv, plen;
343 char buf[8192];
344 struct sockaddr_storage z;
345
346 len = sizeof(z);
347 plen = jflag ? 8192 : 1024;
348 rv = recvfrom(s, buf, plen, MSG_PEEK,
349 (struct sockaddr *)&z, &len);
350 if (rv < 0)
351 err(1, "recvfrom");
Why 1024 instead of something like 1500-20-8=1472?
Thanks.
Wei
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: nc captures 1024 bytes
- From: Bruce M. Simpson
- Re: nc captures 1024 bytes
- Prev by Date: Bug in vr(4) driver
- Next by Date: Re: nc captures 1024 bytes
- Previous by thread: Bug in vr(4) driver
- Next by thread: Re: nc captures 1024 bytes
- Index(es):
Relevant Pages
|
|