* David Preece <[EMAIL PROTECTED]> [010920 17:35] wrote:
> 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 :(

It would help if you'd provided what you think you're sending and
what the other end is actually seeing.  Without that I can't help
much except to suggest that you make sure you're using htons/htonl
in the right spot and on the right size types.  I used htons instead
of htonl on a 32 bit datum and it took me a good half a day to
figure out what i had done wrong.

> PS. No, not a packet kiddie.

none of us are... really. >;)

-- 
-Alfred Perlstein [[EMAIL PROTECTED]]
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to