lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] manage pbuf using multiple netif on the same hw


From: Kieran Mansley
Subject: Re: [lwip-devel] manage pbuf using multiple netif on the same hw
Date: Wed, 20 Feb 2008 14:53:07 +0000

On Wed, 2008-02-20 at 14:58 +0100, Piero 74 wrote:
> What do you think???

I don't like it.  I think to do it that way you'll have to have two
separate pbufs and either make sure they have their own copy of the
data.  You can't be sure that, if they share the data, that one path
won't modify the packet data and so confuse the other one.

However, to achieve what you want to do, you don't need to worry about
sending the packet to all the netifs.  The IP layer will look at the
netif you give it, and if the packet is not destined for that one it
will search all the others it knows about and use those instead.  For
reference see the code in src/core/ipv4/ip.c:ip_input()  The only
disadvantage of this is that the packet will only go to one of the two
netifs, not both, but this should only be a problem for broadcasts or
multicasts.

I question the usefulness of what you're trying to do with multiple
netifs and different IP addresses on one IP network through one physical
interface.  How will you be sure for example that there won't be
anything else on the network with the 192.168.0.1 address that you want
to assign statically to one of the interfaces?

A more normal way of doing what you want would be to have a single
interface with multiple IP addresses configured on it.  However, I think
at the moment that lwIP doesn't allow this as it would need a bit more
sophisticated routing, and that might go against its goal to be
lightweight.

Kieran





reply via email to

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