[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sendto syscall problems?

idiot@altavista.net writes:

 > here's a dump of the offending line, 
 > ktrace :
 > CALL  sendto(0x3,0x17000,0xb0,0x40,0xefbfdbb4,0x10)
 > RET   sendto -1 errno 22 Invalid argument
 > and the line from the source is:
 > sendto(sock, packet, sizeof(struct ip) + sizeof(struct icmp) + psize,0, (str
 > uct sockaddr *) & sin,sizeof(struct sockaddr));

No it isnt.   Let me combine the two bits of info

	sendto( sock = 0x3,
		packet = 0x17000,
		sizeof(struct ip) + sizeof(struct icmp) + psize = 0xb0,
		0 = 0x40,
		(struct sockaddr *) & sin = 0xefbfdbb4,
		sizeof(struct sockaddr) = 0x10 )

In my book 0 does NOT equal 0x40.  It also explains the EINVAL return:
>From the man page:

     The flags parameter may include one or more of the following:

     #define MSG_OOB        0x1  /* process out-of-band data */
     #define MSG_DONTROUTE  0x4  /* bypass routing, use direct interface */


     [EINVAL]      The flags parameter is invalid.

Now this could be a compiler error, I suppose.   make clean and then make
with -O0 and see if the problem still occurs.

// marc