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: Piero 74
Subject: Re: [lwip-devel] manage pbuf using multiple netif on the same hw
Date: Wed, 20 Feb 2008 16:35:29 +0100



2008/2/20, Kieran Mansley <address@hidden>:
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.

ok... i understood what you think...

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.

very interesting... i don't need  broadcasts or multicasts for this situation.
My problem is that after the first net_add() call, the driver task will run for getting packet and he know only the first netif.
So, packets are sent ONLY to this netif. But if i understood, in ip_input this code:

    /* start trying with inp. if that's not acceptable, start walking the
       list of configured netifs.
       'first' is used as a boolean to mark whether we started walking the list */
    int first = 1;
    netif = inp;
    do {
    ....
    } while(netif != NULL);

find a correct netif depending on IP address... so,
i have ONLY use two netif_add() with two different IP in application task

CAN YOU CONFIRM if i'm right?


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?

As i said in other  thread, i have a particular request from our customer: http://lists.gnu.org/archive/html/lwip-users/2008-02/msg00105.html
Anyway, it will be a responsibility of our customer to choose fixed IP which is not used and is in different family address used for DHCP network.


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.

I think  that an actual routing is already veru usefull! (as i said... if i understood)

Thanks a lot Kieran, please confirm my understanding above.

Bye,
Piero

reply via email to

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