autoip/dhcp_start in lwip_bindings not always called Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
beco
Posts: 1
Joined: Mon Mar 07, 2022 12:48 pm
Been thanked: 1 time

autoip/dhcp_start in lwip_bindings not always called  Topic is solved

Postby beco » Mon Mar 07, 2022 1:28 pm

autoip_start and dhcp_start are called in lwipDefaultLinkUpCB. That function is invoked whenever the NETIF_FLAG_LINK_UP-flag changes.

The flag is initially set to true in low_level_init. If macPollLinkStatus in the main loop of the lwip_thread always returns true, then the callbacks, and therefore autoip/dhcp_start, are never called.

That's why I would suggest to not set the flag NETIF_FLAG_LINK_UP in low_level_init.

Code: Select all

diff --git i/os/various/lwip_bindings/lwipthread.c w/os/various/lwip_bindings/lwipthread.c
index ee4303fcc..b2868c84d 100644
--- i/os/various/lwip_bindings/lwipthread.c
+++ w/os/various/lwip_bindings/lwipthread.c
@@ -104,7 +104,7 @@ static void low_level_init(struct netif *netif) {

   /* device capabilities */
   /* don't set NETIF_FLAG_ETHARP if this device is not an Ethernet one */
-  netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP;
+  netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP;

   /* Do whatever else is needed to initialize interface. */
 }

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: autoip/dhcp_start in lwip_bindings not always called

Postby Giovanni » Mon Mar 07, 2022 2:47 pm

Hi,

Thanks, open for comments for those who know lwIP well.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: autoip/dhcp_start in lwip_bindings not always called

Postby Giovanni » Fri Mar 18, 2022 9:25 am

No comments? going for this then.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: autoip/dhcp_start in lwip_bindings not always called

Postby Giovanni » Fri Mar 18, 2022 9:43 am

Hi,

Fixed as bug #1227.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 25 guests