From owner-freebsd-hackers Thu Sep 20 15:33:31 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from q1-rme.xtra.co.nz (q1-rme.xtra.co.nz [203.96.92.29]) by hub.freebsd.org (Postfix) with ESMTP id 3771637B417 for ; Thu, 20 Sep 2001 15:33:25 -0700 (PDT) Received: from development.wgtn.csg.co.nz ([210.86.1.68]) by q1-rme.xtra.co.nz with SMTP id <20010920223323.WKQ147022.q1-rme.xtra.co.nz@development.wgtn.csg.co.nz> for ; Fri, 21 Sep 2001 10:33:23 +1200 Content-Type: text/plain; charset="iso-8859-1" From: David Preece Reply-To: davep@afterswish.com To: hackers@freebsd.org Subject: sendto not sending what I asked... Date: Fri, 21 Sep 2001 10:33:38 +1200 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01092110333803.36513@development.wgtn.csg.co.nz> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I'm trying to write a raw (SYN) packet with sendto. I've opened the socket with socket(AF_INET, SOCK_RAW, IPPROTO_RAW), the result is checked and it is unbound. A buffer and a sockaddr_in are formed then sent down the socket with sendto(sck,pBuffer,40,0,(struct sockaddr *)&sin,sizeof(sin)) and the packet captured using ethereal. While the packet does send, with the correct source and destination addresses, the buffer I pass is appended as data on the end of an IP packet with unknown protocol, rather than replacing the IP and TCP headers (i.e. appending the ethernet header) as I had hoped. Has anyone seen this before? Is there a socket option I have missed? I've R'dTFM till I'm blue in the face, and all the examples I can find seem to be for Linux on big endian machines :( Cheers, Dave PS. No, not a packet kiddie. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message