Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH v2 2/8] station: netconfig devices based on station state
Date: Mon, 30 Sep 2019 09:35:52 -0700	[thread overview]
Message-ID: <20190930163558.28123-2-tim.a.kourt@linux.intel.com> (raw)
In-Reply-To: <20190930163558.28123-1-tim.a.kourt@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

---
 src/station.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/station.c b/src/station.c
index 02c5260b..0666287b 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1158,8 +1158,23 @@ static void station_enter_state(struct station *station,
 				IWD_NETWORK_INTERFACE, "Connected");
 		/* fall through */
 	case STATION_STATE_DISCONNECTED:
+		periodic_scan_stop(station);
+
+		break;
 	case STATION_STATE_CONNECTED:
 		periodic_scan_stop(station);
+
+		if (station->state == STATION_STATE_ROAMING) {
+			netconfig_reconfigure(station->netconfig);
+
+			break;
+		}
+
+		netconfig_configure(station->netconfig,
+					network_get_settings(
+						station->connected_network),
+					netdev_get_address(
+							station->netdev));
 		break;
 	case STATION_STATE_DISCONNECTING:
 	case STATION_STATE_ROAMING:
@@ -1247,6 +1262,8 @@ static void station_disassociated(struct station *station)
 {
 	l_debug("%u", netdev_get_ifindex(station->netdev));
 
+	netconfig_reset(station->netconfig);
+
 	station_reset_connection_state(station);
 
 	station_enter_state(station, STATION_STATE_DISCONNECTED);
@@ -2327,6 +2344,8 @@ static void station_disconnect_onconnect(struct station *station,
 		return;
 	}
 
+	netconfig_reset(station->netconfig);
+
 	station_reset_connection_state(station);
 
 	station_enter_state(station, STATION_STATE_DISCONNECTING);
@@ -2562,6 +2581,8 @@ int station_disconnect(struct station *station)
 					station_disconnect_cb, station) < 0)
 		return -EIO;
 
+	netconfig_reset(station->netconfig);
+
 	/*
 	 * If the disconnect somehow fails we won't know if we're still
 	 * connected so we may as well indicate now that we're no longer
-- 
2.13.6

  reply	other threads:[~2019-09-30 16:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 16:35 [PATCH v2 1/8] netconfig: Decouple from station state Tim Kourt
2019-09-30 16:35 ` Tim Kourt [this message]
2019-09-30 16:35 ` [PATCH v2 3/8] netconfig: Switch to internal active network settings Tim Kourt
2019-09-30 16:35 ` [PATCH v2 4/8] netconfig: Subscribe for IPv6 address changes Tim Kourt
2019-09-30 20:13   ` Denis Kenzior
2019-09-30 16:35 ` [PATCH v2 5/8] netconfig: Request all known IPv6 addresses Tim Kourt
2019-09-30 16:35 ` [PATCH v2 6/8] netconfig: Add IPv6 static address installation/removal Tim Kourt
2019-09-30 16:35 ` [PATCH v2 7/8] netconfig: Install IPv6 default route Tim Kourt
2019-09-30 16:35 ` [PATCH v2 8/8] netconfig: Install IPv6 DNS Tim Kourt
2019-09-30 20:12 ` [PATCH v2 1/8] netconfig: Decouple from station state Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190930163558.28123-2-tim.a.kourt@linux.intel.com \
    --to=tim.a.kourt@linux.intel.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox