lwip-users
[Top][All Lists]
Advanced

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

Re: AW: [lwip-users] LWIP and second IP feasible?


From: Tyrel Newton
Subject: Re: AW: [lwip-users] LWIP and second IP feasible?
Date: Mon, 7 Mar 2011 08:20:13 -0800

>> 
> 
> I don't think there's a way to achieve this easily with lwIP at the moment.  
> WIth separate interfaces it would work, but with two IP addresses on the same 
> interface we'd need to do some work as I think at the moment each netif is 
> assumed to have a single address.  You might get somewhere by arranging to 
> have two netifs on the same physical interface, but I'm not sure how that 
> would work with the driver when it receives a packet as both netifs would 
> need to be involved.
> 

I don't have a need for this myself, but I have written multiple drivers for 
lwip, so I'll throw in my 0.02.

AFAIK, this would require a pretty thorough redesign of the netif structure and 
associated code since it only contains one set of ip/gateway/netmask addresses. 
It would also require modifying the IP routing code that searches for an 
outgoing interface.

On the other hand, supporting this on the driver should be much simpler. A 
"global" driver that:
- doesn't store its state information in the netif->state field
- provides a locking mechanism (i.e mutex)
should be enough. This would allow you to multiplex two netifs using the same 
driver. And it shouldn't matter which netif you pass incoming packets to either.

I'm not sure how this would affect the etharp module and the storage of the 
hardware address in the netif structure though, since you would have a 
one-to-many mapping . . .

Tyrel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]