Date: Fri, 21 Sep 2001 10:33:38 +1200 From: David Preece <davep@afterswish.com> To: hackers@freebsd.org Subject: sendto not sending what I asked... Message-ID: <01092110333803.36513@development.wgtn.csg.co.nz>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01092110333803.36513>