[ECOS] ecos with lwip and 2 interfaces

Mandeep Sandhu mandeepsandhu.chd@gmail.com
Wed Sep 23 11:12:00 GMT 2009

On Tue, Sep 22, 2009 at 12:58 PM, Simon Kallweit
<simon.kallweit@intefo.ch> wrote:
> Mandeep Sandhu wrote:
>> Hi All,
>> I've been running my application with Simon's recent port of lwIP
>> (1.3.1) with ecos with the linux synthetic target.
>> Things have been running fine with the app only using 1 net i/f, i.e
>> et0. et0 maps to my linux tap device.
>> synth_device ethernet {
>>   eth0 ethertap tap0
>> }
>> Now I need to use a second interface. So 'et1' will map to the real
>> eth0 on my PC. For this I modified my tdf file as such:
>> synth_device ethernet {
>>   eth0 ethertap tap0
>>   eth1 real eth0
>> }
>> In the lwIP config, I've enabled "eth1".
>> However, in the app a call to cyg_lwip_sequential_init() only
>> initializes et0 and I don't see any init for et1. I've tried using
>> both, a static as well as DHCP IP addr for it. But that does not help.
>> Has anybody used to 2 interfaces with the recent port of lwIP? Is
>> there anything else that I need to do, either in configuration or in
>> my app?
> I have not really tested with multiple interfaces myself. But it seems to me
> that you did not enable the second synth eth device
> (CYGVAR_DEVS_ETH_ECOSYNTH_ETH1) in your configuration. Please make sure that
> you have two synth eth devices configured and report back if it still does
> not work.

You're right Simon. Enabling the second interface there made things
work (to some extent).

However, I'm facing a new problem now.

Previously I was using only a single interface (the Linux tap0
device). I have implemented a DHCP server which was working fine until

Now, my socket writes on the first interface (the tap0 interface) have
started failing! That is, without changing _any_ code! :( The return
value of sendto is coming as '-1' and the error string is set to 'No
error'. Actually this problem starts even if I don't enable support
for eth1 in the lwIP config. Just enabling the second interface under
"Common ethernet support -> Synthetic target ethernet driver" causes
this problem to surface.

Any clues as to what could be going wrong?

I've tried using the second interface with static IP as well as DHCP.
There's no issues here. DHCP client also works fine and configures
this interface with the right IP addr.


> Simon

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list