nc captures 1024 bytes



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"



Relevant Pages

  • Re: Your smokes, or your job? Unbelievable. The Sheep Look Up
    ... Bill and Melinda Gates are on track to improve more lives -- via ... If you're waiting, ... >>> I have to select the bias set which works, ... I prefer to accept life as it is. ...
    (alt.smokers.cigars)
  • Re: Im going to murder the King of Thailand & Steve Kramer
    ... Still waiting for the Kleestone Klops and the Thai internet police to show up! ... would you like to bring your shiny new gun up to the ... at you on this ng and in the real life. ...
    (soc.culture.thai)
  • Re: port scanning withing the US: legal?
    ... medical example someones life truly could be at stake. ... consider a port scan a threat to myself. ... a person of a security hole that involved front page ... And in that day will I make Jerusalem a burdensome stone ...
    (comp.security.unix)
  • Re: Update - long!
    ... U of M hospital to have the port assessed and to try to figure out why ... The doctor that put the new ... the only social life I have any more is doctors appointments and I am ... Besides the health issues, caring for parents who both have health ...
    (alt.support.arthritis)
  • Re: Gun lovers are secretly rejoicing
    ... Cower and beg for your life whilst waiting for him ... to shoot you in the head? ... taking responsibility for your own life as ... opposed to waiting for the cops to come in and cart out the bodies. ...
    (talk.politics.guns)