Skip to contentSkip to conversation

station: Add missing netconfig_reset()

PATCH In review Andrew Zaborowski 2 participants 2 messages Sep 29, 2021

lore
Share & tools
lore

Andrew Zaborowski

author
#0 lore raw

PATCH 1/1 station: Add missing netconfig_reset()

On NETDEV_EVENT_DISCONNECT_BY_* events during netconfig, we'd forget to call netconfig_reset() before trying a new netconfig_configure() resulting in the "netconfig: Failed to start DHCPv4 client for interface %u" warning and a L_WARN_ON. Add the missing call.

---
 src/station.c | 3 +++
 1 file changed, 3 insertions(+)
src/station.c +3 -0
index 934815f2..1c073fc1 100644
@@ -2810,6 +2810,9 @@ static void station_disconnect_event(struct station *station, void *event_data)
 	switch (station->state) {
 	case STATION_STATE_CONNECTING:
 	case STATION_STATE_CONNECTING_AUTO:
+		if (station->netconfig)
+			netconfig_reset(station->netconfig);
+
 		station_connect_cb(station->netdev,
 					NETDEV_RESULT_HANDSHAKE_FAILED,
 					event_data, station);
Signature · 1 line
2.30.2
#1 lore raw

Hi Andrew,

Quoted 4 lines · Andrew Zaborowski

On NETDEV_EVENT_DISCONNECT_BY_* events during netconfig, we'd forget to call netconfig_reset() before trying a new netconfig_configure() resulting in the "netconfig: Failed to start DHCPv4 client for interface %u" warning and a L_WARN_ON. Add the missing call.

So you're still not including the useful information that would be very useful that was mentioned in the earlier thread...

Quoted 9 lines
---
  src/station.c | 3 +++
  1 file changed, 3 insertions(+)
src/station.c +0 -0
index 934815f2..1c073fc1 100644

src/station.c static void station_disconnect_event(struct station *station, void *event_data) · line 2815

Quoted 6 lines
src/station.c +3 -0
@@ -2810,6 +2810,9 @@ static void station_disconnect_event(struct station *station, void *event_data)
  	switch (station->state) {
  	case STATION_STATE_CONNECTING:
  	case STATION_STATE_CONNECTING_AUTO:
+		if (station->netconfig)
+			netconfig_reset(station->netconfig);
+

NAK. This is still not addressing the underlying bug. It should not go via the station_connect_cb path at all. Perhaps you need to add a new CONNECTED_NETCONFIG state instead.

src/station.c static void station_disconnect_event(struct station *station, void *event_data) · line 2818

Quoted 4 lines
src/station.c +0 -0
  		station_connect_cb(station->netdev,
  					NETDEV_RESULT_HANDSHAKE_FAILED,
  					event_data, station);

Regards,
-Denis