Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Aug 2007 16:37:40 -0700 (PDT)
From:      Weiguang Shi <wgshizz@yahoo.com>
To:        Weiguang Shi <wgshizz@yahoo.com>, freebsd-net@freebsd.org
Subject:   Re: nc captures 1024 bytes
Message-ID:  <43862.94241.qm@web43132.mail.sp1.yahoo.com>

next in thread | raw e-mail | index | archive | help
To get the larger packets, I have to fix another hard-coded "1024" =0A=0A63=
0 readwrite(int nfd)=0A631 {=0A632         struct pollfd pfd[2];=0A633     =
    unsigned char buf[8192];=0A634         int n, wfd =3D fileno(stdin);=0A=
635         int lfd =3D fileno(stdout);=0A636         int plen;=0A637 =0A63=
8         plen =3D jflag ? 8192 : 1024;=0A639 =0A=0A----- Original Message =
----=0AFrom: Weiguang Shi <wgshizz@yahoo.com>=0ATo: freebsd-net@freebsd.org=
=0ASent: Monday, August 27, 2007 4:05:26 PM=0ASubject: nc captures 1024 byt=
es=0A=0AHi,=0A=0AMy system is FreeBSD 6.2. I sent a UDP datagram of 1464 by=
tes to port =0A1234 where nc was waiting=0A    % nc -n -u -l 1234 >tt=0A=0A=
Afterwards, the size of tt, however, was only 1024  bytes.=0A=0AI noticed t=
his piece of code in nc=0A=0A341                         if (uflag) {=0A342=
                                 int rv, plen;=0A343                       =
          char buf[8192];=0A344                                 struct sock=
addr_storage z;=0A345 =0A346                                 len =3D sizeof=
(z);=0A347                                 plen =3D jflag ? 8192 : 1024;=0A=
348                                 rv =3D recvfrom(s, buf, plen, MSG_PEEK,=
=0A349                                     (struct sockaddr *)&z, &len);=0A=
350                                 if (rv < 0)=0A351                      =
                   err(1, "recvfrom");=0A=0AWhy 1024 instead of something l=
ike 1500-20-8=3D1472?=0A=0AThanks.=0AWei=0A=0A=0A=0A=0A       =0A__________=
__________________________________________________________________________=
=0AMoody friends. Drama queens. Your life? Nope! - their life, your story. =
Play Sims Stories at Yahoo! Games.=0Ahttp://sims.yahoo.com/=0A_____________=
__________________________________=0Afreebsd-net@freebsd.org mailing list=
=0Ahttp://lists.freebsd.org/mailman/listinfo/freebsd-net=0ATo unsubscribe, =
send any mail to "freebsd-net-unsubscribe@freebsd.org"=0A=0A=0A=0A=0A=0A   =
    =0A____________________________________________________________________=
________________=0AGot a little couch potato? =0ACheck out fun summer activ=
ities for kids.=0Ahttp://search.yahoo.com/search?fr=3Doni_on_mail&p=3Dsumme=
r+activities+for+kids&cs=3Dbz 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43862.94241.qm>