Subject: Controlling source IP address
To: None <netbsd-help@NetBSD.ORG>
From: David Maxwell <david@vex.net>
List: netbsd-help
Date: 09/18/1996 13:27:29
Well, after driving myself crazy for a few hours I decided to do the 
intelligent thing and check the return code on the bind I was doing... :-(

guess what? -1 and errno is EFAULT. 

So everything I've looked at in Stevens Vol II indicates that I'm headed in
the right direction, but bind is saying that my name argument is not valid.

-------------------------------------
	hisctladdr.sin_port = port;

{
char ipr[100] = "205.206.248.72" ;
u_long adr2;
int r,z;
struct sockaddr_in myadr;

inet_aton(ipr,&myadr.sin_addr);

r= bind(s,(caddr_t)myadr.sin_addr.s_addr,sizeof(myadr.sin_addr.s_addr));

}

	while (connect(s, (struct sockaddr *)&hisctladdr, sizeof (hisctladdr)) < 0) {
-------------------------------------

I've changed this a bit from my previous message - now I'm using
(caddr_t)myadr.sin_addr.s_addr as the second argument instead of myadr.

Can someone please tell me how mistaken I am? ;-)

							David Maxwell
							david@vex.net