From owner-freebsd-net@FreeBSD.ORG Mon Aug 27 23:37:42 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A81D816A468 for ; Mon, 27 Aug 2007 23:37:42 +0000 (UTC) (envelope-from wgshizz@yahoo.com) Received: from web43132.mail.sp1.yahoo.com (web43132.mail.sp1.yahoo.com [216.252.121.62]) by mx1.freebsd.org (Postfix) with SMTP id 9336D13C442 for ; Mon, 27 Aug 2007 23:37:42 +0000 (UTC) (envelope-from wgshizz@yahoo.com) Received: (qmail 94567 invoked by uid 60001); 27 Aug 2007 23:37:42 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=hfzwIeHl+NfUYunSP21KqwoNjhY7nD6JwNNWQorlPWsvjoFaVFnaP9JuLSFw5a2Pen5AzZAYC0c2DcqnLWAOpO4VtJXD43DKy38qhAzdP9knqlqDeIpQcd42IjtkRoTVPbPfbsGAx66ZJheQGXMPAMCE159B7XTOiVmVgFe5Qsc=; X-YMail-OSG: wus33TkVM1mMSXNJAapcmAk_JgIlFd78.8kcY0rhXwzhlbbx3CvRmys664VeqsMHbUzSfbgXjYbwE0ytSRUd8gmE1qTfmGmYOfF5E6qAICboq7kuK2Q8YOcnUQwsEQ-- Received: from [69.147.84.254] by web43132.mail.sp1.yahoo.com via HTTP; Mon, 27 Aug 2007 16:37:40 PDT X-Mailer: YahooMailRC/651.48 YahooMailWebService/0.7.134 Date: Mon, 27 Aug 2007 16:37:40 -0700 (PDT) From: Weiguang Shi To: Weiguang Shi , freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <43862.94241.qm@web43132.mail.sp1.yahoo.com> Cc: Subject: Re: nc captures 1024 bytes X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2007 23:37:42 -0000 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 =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