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 [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message
- Re: The socket sendto INVALID ARGUMENT ERROR returned soheil soheil