This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Help reqd for TCP/IP stack on ecos
- To: sujith k <sujith at c4 dot com>
- Subject: [ECOS] Re: Help reqd for TCP/IP stack on ecos
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Date: Tue, 30 Oct 2001 13:32:56 +0100
- Cc: eCos Disuss <ecos-discuss at sourceware dot cygnus dot com>
- References: <20011030112801.15018.qmail@meowmix.chek.com>
On Tue, Oct 30, 2001 at 11:28:01AM -0000, sujith k wrote:
> Hi ,
> I have a query on TCP/IP stack initialization.
>
> Say , that I have 2 physical interfaces eth0 and eth1.
> But, I have only one IP address for the box. This is nothing but, only one IP interface and 2 ethernet interfaces.
>
> I am using the function init_net to init eth0 and eth1.
> i.e. init_net(eth0, bootp);
> init_net(eth1, bootp);
> Here , the bootp record is updated with the IP address, say
> 192.168.1.150. I am ignoring the error message from ioctl() for
> setting the IP address for eth1 interface. I am not checking the
> return value of ioctl(). So, my init_net for eth0 and init_net for
> eth1 is a success.
Its returning an error for a reason. You cannot do this! Each
interface to the IP stack has to have a different IP address. Maybe
what you want is that the node acts as an ethernet bridge with two
ethernet ports? You then have one interface to the IP stack and so can
have one IP address. Just be careful of loops.
Andrew