lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] bind with link down


From: Simon Goldschmidt
Subject: Re: [lwip-users] bind with link down
Date: Tue, 31 Mar 2020 22:11:11 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0



On 31.03.2020 21:34, Massimiliano Cialdi wrote:
I have a process that polls the PHY to find out if the link is up or
down. It calls netif_set_link_up()/netif_set_link_down(). I also have
the link callback calling netif_set_up()/netif_set_down().

You're mixing link state with admin state here. That might work, but
might not work in some situations.


I wonder what happens if the functions:
   conn = netconn_new(NETCONN_UDP);
   netconn_bind(conn, IP_ADDR_ANY, 7);
are called when netif is still down. This happens because, for
example, the udpecho_thread() process starts before the netif is up.

Then when the link goes down while
    err = netconn_recv(conn, &buf);
is waiting, it doesn't exit with an error. Is that correct?

Correct or not depends on how you define it. There's currently no code
in lwIP to unblock on link loss. That could only work if you're bound to
a netif. I'm not sure if what you think of works in other stacks.

Regards,
Simon



reply via email to

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