Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jan 1999 12:29:35 +0100 (MET)
From:      Milan Kopacka <mkop5230@ss1000.ms.mff.cuni.cz>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Specifying local IP in connect()
Message-ID:  <Pine.SGI.3.96.990107113222.24719C-100000@beta.ms.mff.cuni.cz>
In-Reply-To: <Pine.SGI.3.96.990106230659.10874B-100000@beta.ms.mff.cuni.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 7 Jan 1999, Milan Kopacka wrote:

Hi,

I'm sorry. I was taught by authorities, that the right way to specify
local IP is to use bind() call. Please forget my connect() extensions :)

However, the rest remained. I still need to open connections from IP x
which my system regulerly doesn't have while still being able to
communicate with machine x. From my point of view, the specified
information (local IP) only moves to other call. 

Using bind() disallows me to specify local adress other from adresses
assigned to one of my interfaces. 

netinet/in_pcb.c: (in_pcbbind())

  if (ifa_ifwithaddr((struct sockaddr *)sin) == 0)
    return (EADDRNOTAVAIL);

I think a change here + ip_input() modification will do all what I need. 

Adresses used in such a way don't show under any of machine interfaces, so
traffic out for them is not affected and doesn't remain on my machine. 

The application, which needs such features is described in my previous
message.

  Milan Kopacka

--
<Milan.Kopacka@st.mff.cuni.cz>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SGI.3.96.990107113222.24719C-100000>