From owner-freebsd-net Fri Jan 24 0:24:29 2003 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F0E637B401 for ; Fri, 24 Jan 2003 00:24:28 -0800 (PST) Received: from hotmail.com (f117.law15.hotmail.com [64.4.23.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DDDC43F1E for ; Fri, 24 Jan 2003 00:24:28 -0800 (PST) (envelope-from soheil_hh@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 24 Jan 2003 00:20:50 -0800 Received: from 81.12.18.2 by lw15fd.law15.hotmail.msn.com with HTTP; Fri, 24 Jan 2003 08:20:49 GMT X-Originating-IP: [81.12.18.2] From: "soheil soheil" To: freebsd-net@freebsd.org Subject: The socket sendto INVALID ARGUMENT ERROR returned Date: Fri, 24 Jan 2003 08:20:49 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 24 Jan 2003 08:20:50.0274 (UTC) FILETIME=[81076C20:01C2C381] Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Dear all I wrote a code to send a tcp packet on a raw socket, but the sendto function return some errors on argument what can make this error occur ??? thanx the code : char datagram[4096]; ..... socket(s, SOCK_RAW, IPPROTO_TCP); .....//filling the tcp/ip header int one = 1; const int *val = &one; if (setsockopt(s, IPPROTO_IP, IP_HDRINCL, val, sizeof(one)) < 0) printf("Warning: Cannot set HDRINCL!\n"); if(sendto(s,datagram, sizeof(struct tcphdr), 0,(struct sockaddr *)&sin, sizeof(sin)) < 0) perror("error on send"); _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message