Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v3 3/3] ap: set link/operstate on AP start/stop
Date: Tue, 27 Apr 2021 16:34:52 -0700	[thread overview]
Message-ID: <20210427233452.97024-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20210427233452.97024-1-prestwoj@gmail.com>

[-- 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

      parent reply	other threads:[~2021-04-27 23:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 23:34 [PATCH v3 1/3] station: transition to disconnected on station_free James Prestwood
2021-04-27 23:34 ` [PATCH v3 2/3] netdev: only call connect_ok in station/p2p_client mode James Prestwood
2021-04-28 16:36   ` Denis Kenzior
2021-04-27 23:34 ` James Prestwood [this message]

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=20210427233452.97024-3-prestwoj@gmail.com \
    --to=prestwoj@gmail.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