lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] New netif link_up/up behaviour and PPP


From: Sylvain Rochet
Subject: Re: [lwip-devel] New netif link_up/up behaviour and PPP
Date: Sat, 7 Mar 2015 11:39:49 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hello Simon,


On Sat, Mar 07, 2015 at 09:57:31AM +0100, Simon Goldschmidt wrote:
> Sylvain Rochet wrote:
> 
> > I wonder what should I do for the PPP netif interface about link up and 
> > up status now, do you have a clue ? :)
> 
> I admit I have forgotten to adapt ppp, but I would have thought to 
> just set it up when ppp is started and down when it ends (so it is up 
> all the time, effectively). You still have the guards of link status 
> and valid (IPv4) addresses to prevent it being used for routing.
> 
> Regarding link up status, there have not been any changes there. I 
> would have expected ppp to set the link up when the connection is 
> established and down when it is disturbed. Isn't that done already?

I don't think so, currently it is, and always was, I never changed that 
(except adding IPv6 of course ;-) :

Init netif callback:
  netif->flags = NETIF_FLAG_LINK_UP;

IPv4 UP:
  netif_set_addr()
  netif_set_up(pcb->netif);

IPv6 UP:
  ip6_addr_copy()
  netif_ip6_addr_set_state()
  netif_set_up(pcb->netif);

IPv4 DOWN && IPv6 DOWN:
  netif_set_down(pcb->netif);


If I understand correctly I should call netif_set_up() once for all in 
the init netif callback and call netif_set_down() in the ppp_free() 
function.  Is doing netif->flags = NETIF_FLAG_UP; and netif->flags = 0; 
instead is ok for the PPP case ?

Once a protocol is running (IPv4 or IPv6), I should now call 
netif_set_link_up() and when all protocols are stopped I should now call 
netif_set_link_down().

Are netif->output and netif->output_ip6 callbacks are guaranteed to 
never ever be called on a netif currently in link down state ?  If true, 
I can remove some checks in the PPP ip4 and ip6 netif output callbacks.


Sylvain

Attachment: signature.asc
Description: Digital signature


reply via email to

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