Networking Forums

Networking Forums > Computer Networking > Linux Networking > Help with sendto()

Reply
Thread Tools Display Modes

Help with sendto()

 
 
B.r.K.o.N.j.A.
Guest
Posts: n/a

 
      12-11-2003, 09:07 PM
I've been having trouble with sendto function (I open a socket, bind it to
eth0, recvfrom works fine but when I execute following line I get sendto():
invalid argument)

if(sendto(sokit, buf, sizeof(buf), 0, (struct sockaddr *)&drugaadr,
sizeof(drugaadr))==-1){
perror("sendto()")
exit(-1)
}

sokit is int variable with socket handler (value 3)
buf is declared char[60]
drugaadr is struct sockaddr_in

drugaadr.sin_family=AF_INET;
drugaadr.sin_port=0;
drugaadr.sin_addr.s_addr=inet_addr("192.168.0.1");
and the drugaadr.sin_zero is filled with 8 zeros.

Please help (I'm trying to send an ARP packet, but that's within buf, and it
shouldn't have anything to do with sendto failure), I've searched the
internet but came empty-handed.

Thanks,

Vedran



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sendto() and structures ericunfuk Linux Networking 1 03-24-2007 12:22 PM
A throttle needed for UDP sendto()??? guuwwe@hotmail.com Linux Networking 6 03-09-2007 06:00 PM
outgoing packets with sendto() Tom Linux Networking 1 11-24-2006 02:20 PM
IP binding before sendto() Vinod Kumar P Linux Networking 0 10-30-2003 02:04 PM
RAW socket when sendto() always return -1(ENOBUFS) ??????? hzcl Linux Networking 0 08-15-2003 09:07 AM



1 2 3 4 5 6 7 8 9 10 11