From owner-freebsd-hackers Thu Jan 25 22: 1:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from modemcable101.200-201-24.mtl.mc.videotron.ca (modemcable140.61-201-24.mtl.mc.videotron.ca [24.201.61.140]) by hub.freebsd.org (Postfix) with SMTP id 6118737B400 for ; Thu, 25 Jan 2001 22:01:16 -0800 (PST) Received: (qmail 49155 invoked from network); 26 Jan 2001 06:01:15 -0000 Received: from cognac.local.mindstep.com (HELO cognac) (192.168.10.9) by jacuzzi.local.mindstep.com with SMTP; 26 Jan 2001 06:01:15 -0000 From: "Patrick Bihan-Faou" To: Cc: Subject: Re: Divert Sockets & Fragmentation revisited Date: Fri, 26 Jan 2001 01:02:33 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, Sorry to state something that is obvious, but when you bind your socket to the port, you have the port in the correct (network) order ? i.e. do you use htons(DIVERTPort) ? If you have lsof installed, run it and look at the port number that your program listens on. Patrick. > Here is the important code fragments: > > Note: I have played with the MAX_PACKET_SIZE in hopes that it would make some > difference but to no avail. > > #define MAX_PACKET_SIZE 300000 > #define DIVERTPort 4422 > #define ACTIVE_UDP_PORT 3322 > > > if ((divert_sock = socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT)) < 0) > sys_error("divert socket error"); > set_sock_data(&server_divert,PF_INET,DIVERTPort,INADDR_ANY); > printf("Step 1 \n"); /* Register address and port with the system */ > if (bind(divert_sock, (struct sockaddr*) &server_divert,sizeof(server_divert)) < 0) > sys_error("server_divert bind error"); > for ( ; ; ) { > > n = recvfrom (divert_sock,encaped_pkt,MAX_PACKET_SIZE,0, > ( struct sockaddr * ) &client_add,&clilen); > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message