All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] netdev: only call connect_ok in station mode
@ 2021-04-27 23:08 James Prestwood
  2021-04-27 23:08 ` [PATCH 2/2] ap: set link/operstate on AP start/stop James Prestwood
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2021-04-27 23:08 UTC (permalink / raw)
  To: iwd

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

netdev_connect_ok is only for station mode but AP also
ends up on the same code path. Check the iftype before
calling netdev_connect_ok.
---
 src/netdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/netdev.c b/src/netdev.c
index 252ae78a..0feb9e66 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1337,7 +1337,8 @@ static void try_handshake_complete(struct netdev_handshake_state *nhs)
 		nhs->complete = true;
 		handshake_event(&nhs->super, HANDSHAKE_EVENT_COMPLETE);
 
-		netdev_connect_ok(nhs->netdev);
+		if (nhs->netdev->type == NL80211_IFTYPE_STATION)
+			netdev_connect_ok(nhs->netdev);
 	}
 }
 
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] ap: set link/operstate on AP start/stop
  2021-04-27 23:08 [PATCH 1/2] netdev: only call connect_ok in station mode James Prestwood
@ 2021-04-27 23:08 ` James Prestwood
  0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2021-04-27 23:08 UTC (permalink / raw)
  To: iwd

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

Prior to this netdev_connect_ok set setting this which really
only applies to station mode. In addition this happens for each
new station that connects to the AP. Instead set the operstate /
link mode when AP starts and stops.
---
 src/ap.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/ap.c b/src/ap.c
index 46821c04..89a05b8c 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -28,6 +28,7 @@
 #include <linux/if_ether.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <linux/if.h>
 
 #include <ell/ell.h>
 
@@ -3090,6 +3091,11 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data,
 		l_dbus_property_changed(dbus_get_bus(),
 					netdev_get_path(ap_if->netdev),
 					IWD_AP_INTERFACE, "Name");
+
+		l_rtnl_set_linkmode_and_operstate(rtnl,
+					netdev_get_ifindex(ap_if->netdev),
+					IF_LINK_MODE_DEFAULT, IF_OPER_UP,
+					NULL, NULL, NULL);
 		break;
 
 	case AP_EVENT_STOPPING:
@@ -3104,6 +3110,11 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data,
 					netdev_get_path(ap_if->netdev),
 					IWD_AP_INTERFACE, "Name");
 
+		l_rtnl_set_linkmode_and_operstate(rtnl,
+					netdev_get_ifindex(ap_if->netdev),
+					IF_LINK_MODE_DORMANT, IF_OPER_DOWN,
+					NULL, NULL, NULL);
+
 		if (!ap_if->pending)
 			ap_if->ap = NULL;
 
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-27 23:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 23:08 [PATCH 1/2] netdev: only call connect_ok in station mode James Prestwood
2021-04-27 23:08 ` [PATCH 2/2] ap: set link/operstate on AP start/stop James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.