From patchwork Tue Jan 15 23:28:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: julanhsu@google.com X-Patchwork-Id: 10765245 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FABE91E for ; Tue, 15 Jan 2019 23:28:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28D422CC68 for ; Tue, 15 Jan 2019 23:28:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 184602D20C; Tue, 15 Jan 2019 23:28:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F53A2CC68 for ; Tue, 15 Jan 2019 23:28:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387957AbfAOX2u (ORCPT ); Tue, 15 Jan 2019 18:28:50 -0500 Received: from mail-ua1-f73.google.com ([209.85.222.73]:43540 "EHLO mail-ua1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728841AbfAOX2u (ORCPT ); Tue, 15 Jan 2019 18:28:50 -0500 Received: by mail-ua1-f73.google.com with SMTP id b8so301805uaq.10 for ; Tue, 15 Jan 2019 15:28:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=npBabNpBkRgqHSIZ+VHvx/8PxItQscO9L+CieWJnhro=; b=aCVYKIfdIsqdCC0yBFdBZ9BD2t0kjj7MJ0KYScnsmgZlwa0MLiS39kMgBWMQe5j+1R /IEYUhoEUD+v+0k6PYB0QMYddBG2ph+MMLIpRQJFfH7GyODbkzlTlwR9Zy+EJ5Wsl47D xm6W63ew5FQD4q3N5oUlRQixylITtSULjNAmqVGAnXVWrItdzET64JsAGT4yYNdd0SaM NOskjVR1YYJL7eY316KxQJdeAYFv1n6Y+BORNCsulYBW4JnY6xFgB7pEOVA/QQU+AoeX M2ybCV5Tj41+WmjdekpbYpPKGCsWL1RV5xuL6chtigwmXdqyUQlE1cz79P4qEzQEN745 11EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=npBabNpBkRgqHSIZ+VHvx/8PxItQscO9L+CieWJnhro=; b=FQmPlTE89nedKo1mQr03y+fd4FVMsvJuaazbhqBZwzbA53dAghwpW2rD++Lbi48g7d jjLB99RNaTTCyi6008fMXnjI5dJgAo+YAbLAiCzR9s7lwag8iNCE+12aj1Py6HAP8xqI FHC9yv5SvVgB65yS7g509+7FmhLGcA0hxJRiaDJBqx+LAeeubF1edOJV6zKgWaVb34ye BB448c/CWn+h46+c5bjNzfDXWQg9s5/MsorrPadpVpS9TwIegZKhJshycvZj5hBN8NS5 5s/fhFIwdCGBobC7fzM7ZHtZKtATvKmLNVQ0qAg9HZ/Qec2R5OJ7tGqx9T2spPTSlVNv yDug== X-Gm-Message-State: AJcUukfk/GoH0Gpd7F/tnWp4WYTZbN6vPbkKufHGwfwM47nczWa7hhls 8xao03gU7c5ZjB44GkO0U7KYRUEiBiO3SQ== X-Google-Smtp-Source: ALg8bN43ycOehrCngriNedsoRafkPnCXA0MWKYFom2K/HmG63cVaiEdsk2wdzV+5svmds0S3cAUttrxpm7mTRw== X-Received: by 2002:a1f:10a5:: with SMTP id 37mr3842750vkq.16.1547594928846; Tue, 15 Jan 2019 15:28:48 -0800 (PST) Date: Tue, 15 Jan 2019 15:28:42 -0800 Message-Id: <20190115232843.223532-1-julanhsu@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog Subject: [PATCH 1/2] mac80211: mesh: add hop count to mpath info From: julanhsu@google.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Julan Hsu Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julan Hsu Expose hop count to destination information in mpath info Signed-off-by: Julan Hsu --- include/net/cfg80211.h | 4 ++++ include/uapi/linux/nl80211.h | 2 ++ net/mac80211/cfg.c | 4 +++- net/mac80211/mesh_hwmp.c | 5 +++++ net/wireless/nl80211.c | 5 ++++- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1fa41b7a1be3..6be50a550a13 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1417,6 +1417,7 @@ enum monitor_flags { * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled * @MPATH_INFO_FLAGS: @flags filled + * @MPATH_INFO_HOP_COUNT: @hop_count filled */ enum mpath_info_flags { MPATH_INFO_FRAME_QLEN = BIT(0), @@ -1426,6 +1427,7 @@ enum mpath_info_flags { MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), MPATH_INFO_DISCOVERY_RETRIES = BIT(5), MPATH_INFO_FLAGS = BIT(6), + MPATH_INFO_HOP_COUNT = BIT(7) }; /** @@ -1445,6 +1447,7 @@ enum mpath_info_flags { * This number should increase every time the list of mesh paths * changes, i.e. when a station is added or removed, so that * userspace can tell whether it got a consistent snapshot. + * @hop_count: hops to destination */ struct mpath_info { u32 filled; @@ -1455,6 +1458,7 @@ struct mpath_info { u32 discovery_timeout; u8 discovery_retries; u8 flags; + u8 hop_count; int generation; }; diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 6d610bae30a9..fcfca197be59 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -3225,6 +3225,7 @@ enum nl80211_mpath_flags { * &enum nl80211_mpath_flags; * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries + * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number * currently defind * @__NL80211_MPATH_INFO_AFTER_LAST: internal use @@ -3238,6 +3239,7 @@ enum nl80211_mpath_info { NL80211_MPATH_INFO_FLAGS, NL80211_MPATH_INFO_DISCOVERY_TIMEOUT, NL80211_MPATH_INFO_DISCOVERY_RETRIES, + NL80211_MPATH_INFO_HOP_COUNT, /* keep last */ __NL80211_MPATH_INFO_AFTER_LAST, diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 818aa0060349..8e756ac076ad 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1742,7 +1742,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, MPATH_INFO_EXPTIME | MPATH_INFO_DISCOVERY_TIMEOUT | MPATH_INFO_DISCOVERY_RETRIES | - MPATH_INFO_FLAGS; + MPATH_INFO_FLAGS | + MPATH_INFO_HOP_COUNT; pinfo->frame_qlen = mpath->frame_queue.qlen; pinfo->sn = mpath->sn; @@ -1762,6 +1763,7 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, pinfo->flags |= NL80211_MPATH_FLAG_FIXED; if (mpath->flags & MESH_PATH_RESOLVED) pinfo->flags |= NL80211_MPATH_FLAG_RESOLVED; + pinfo->hop_count = mpath->hop_count; } static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 6950cd0bf594..6d1190b3332f 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -386,6 +386,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, unsigned long orig_lifetime, exp_time; u32 last_hop_metric, new_metric; bool process = true; + u8 hopcount; rcu_read_lock(); sta = sta_info_get(sdata, mgmt->sa); @@ -404,6 +405,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, orig_sn = PREQ_IE_ORIG_SN(hwmp_ie); orig_lifetime = PREQ_IE_LIFETIME(hwmp_ie); orig_metric = PREQ_IE_METRIC(hwmp_ie); + hopcount = PREQ_IE_HOPCOUNT(hwmp_ie) + 1; break; case MPATH_PREP: /* Originator here refers to the MP that was the target in the @@ -415,6 +417,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, orig_sn = PREP_IE_TARGET_SN(hwmp_ie); orig_lifetime = PREP_IE_LIFETIME(hwmp_ie); orig_metric = PREP_IE_METRIC(hwmp_ie); + hopcount = PREP_IE_HOPCOUNT(hwmp_ie) + 1; break; default: rcu_read_unlock(); @@ -482,6 +485,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, mpath->sn = orig_sn; mpath->exp_time = time_after(mpath->exp_time, exp_time) ? mpath->exp_time : exp_time; + mpath->hop_count = hopcount; mesh_path_activate(mpath); spin_unlock_bh(&mpath->state_lock); ewma_mesh_fail_avg_init(&sta->mesh->fail_avg); @@ -523,6 +527,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, mpath->metric = last_hop_metric; mpath->exp_time = time_after(mpath->exp_time, exp_time) ? mpath->exp_time : exp_time; + mpath->hop_count = 1; mesh_path_activate(mpath); spin_unlock_bh(&mpath->state_lock); ewma_mesh_fail_avg_init(&sta->mesh->fail_avg); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 2317727d6413..442c02415aed 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5641,7 +5641,10 @@ static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, pinfo->discovery_timeout)) || ((pinfo->filled & MPATH_INFO_DISCOVERY_RETRIES) && nla_put_u8(msg, NL80211_MPATH_INFO_DISCOVERY_RETRIES, - pinfo->discovery_retries))) + pinfo->discovery_retries)) || + ((pinfo->filled & MPATH_INFO_HOP_COUNT) && + nla_put_u8(msg, NL80211_MPATH_INFO_HOP_COUNT, + pinfo->hop_count))) goto nla_put_failure; nla_nest_end(msg, pinfoattr); From patchwork Tue Jan 15 23:28:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: julanhsu@google.com X-Patchwork-Id: 10765247 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 342C613B4 for ; Tue, 15 Jan 2019 23:28:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F9D82D1F9 for ; Tue, 15 Jan 2019 23:28:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CBF02D215; Tue, 15 Jan 2019 23:28:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 849E42D1F9 for ; Tue, 15 Jan 2019 23:28:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391398AbfAOX2z (ORCPT ); Tue, 15 Jan 2019 18:28:55 -0500 Received: from mail-yw1-f74.google.com ([209.85.161.74]:47569 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728841AbfAOX2z (ORCPT ); Tue, 15 Jan 2019 18:28:55 -0500 Received: by mail-yw1-f74.google.com with SMTP id m200so2155365ywd.14 for ; Tue, 15 Jan 2019 15:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=TAtqO5rgreqPBCSMfznOFk7vuGi6IU/KKvy01EniQm0=; b=ZQ40Oee1HiwnwabvPBqy33k0Z1c0ZvTp2AUMQlZX6wrE7TnMcFnXOoh0MA5x1qxS4E pObG+vyWNpjOFtPsZ992JpYwtdeSacqUc36cF49Ev6SxxCqXKEsZ8mfBjBaO3rS25++I wnNUU5hWaV+ZMYWi6sybGFyYzeTM7Xd4KT02gM6iLwOh4dZMlnriXvgzICadqBohu/F3 ZaIN5YtHPAeIat1XJ7Ppqsge993+3V2lI99/tXKBFHf7CPtYQoHqXAlKlWER7fEww1vJ Q7gns1SViFVPR0yX9OewkNkW7cBQLtpI0I2x38yUM4oSfYhcDJLPvCVRdmWzInlt+1pa Tzdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=TAtqO5rgreqPBCSMfznOFk7vuGi6IU/KKvy01EniQm0=; b=ZluwnUodpqILTzQKXfniiZaPTT9nntUKmc4af9HwADyOEGee310LJNdwuGB+10NxHs DnLMP5jfh5A3W0xpBZkheDj4TBjXll1QItidxEOKXrqZra3t0In33/ImRVuA1XrMcYlR sjl9KYMA8oyoYwY4SVUNPU2UE0SA7HEtIdSkGIlFo5HSUsS/UwuudWyrvYkRHI2P/bl2 6zyEo0lpIIIfYgqm4MGt0nRJuZ3zjRuoPZswn1ECyM4QM4JZnTcbIRw9IJFsCj4XcTn2 8/BI9aH/AE+UcOkx1tOszBBfBQRgBtioRxpXUDaY6ROQg3FwUacAHEbSjo0uOmfdclYt B7tg== X-Gm-Message-State: AJcUukdIRRAleRuvBY4Apt1ZaZwI1duSYC4Qdncq2WNMtXSjKO8oIv2d OjNc78+VRM+zU1PMlCpcKahUYVtDpM7XJw== X-Google-Smtp-Source: ALg8bN77pDC+v3tJaLHldNs3zxYSKAtRtmwZAgqNLausRzKVo8fMPDmunPGXlH8xrFOA33xqsLzP9+ixHYa8Ew== X-Received: by 2002:a25:d42:: with SMTP id 63mr2412445ybn.78.1547594934391; Tue, 15 Jan 2019 15:28:54 -0800 (PST) Date: Tue, 15 Jan 2019 15:28:43 -0800 In-Reply-To: <20190115232843.223532-1-julanhsu@google.com> Message-Id: <20190115232843.223532-2-julanhsu@google.com> Mime-Version: 1.0 References: <20190115232843.223532-1-julanhsu@google.com> X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog Subject: [PATCH 2/2] mac80211: mesh: add mesh path change count to mpath info From: julanhsu@google.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Julan Hsu Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julan Hsu Expose path change count to destination in mpath info Signed-off-by: Julan Hsu --- include/net/cfg80211.h | 5 ++++- include/uapi/linux/nl80211.h | 4 +++- net/mac80211/cfg.c | 4 +++- net/mac80211/mesh.h | 2 ++ net/mac80211/mesh_hwmp.c | 4 ++++ net/wireless/nl80211.c | 5 ++++- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 6be50a550a13..4e5fb1daf0a1 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1427,7 +1427,8 @@ enum mpath_info_flags { MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), MPATH_INFO_DISCOVERY_RETRIES = BIT(5), MPATH_INFO_FLAGS = BIT(6), - MPATH_INFO_HOP_COUNT = BIT(7) + MPATH_INFO_HOP_COUNT = BIT(7), + MPATH_INFO_PATH_CHANGE = BIT(8) }; /** @@ -1448,6 +1449,7 @@ enum mpath_info_flags { * changes, i.e. when a station is added or removed, so that * userspace can tell whether it got a consistent snapshot. * @hop_count: hops to destination + * @path_change_count: total number of path changes to destination */ struct mpath_info { u32 filled; @@ -1459,6 +1461,7 @@ struct mpath_info { u8 discovery_retries; u8 flags; u8 hop_count; + u32 path_change_count; int generation; }; diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index fcfca197be59..1e24d236f675 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -3226,8 +3226,9 @@ enum nl80211_mpath_flags { * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination + * @NL80211_MPATH_INFO_PATH_CHANGE: total number of path changes to destination * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number - * currently defind + * currently defined * @__NL80211_MPATH_INFO_AFTER_LAST: internal use */ enum nl80211_mpath_info { @@ -3240,6 +3241,7 @@ enum nl80211_mpath_info { NL80211_MPATH_INFO_DISCOVERY_TIMEOUT, NL80211_MPATH_INFO_DISCOVERY_RETRIES, NL80211_MPATH_INFO_HOP_COUNT, + NL80211_MPATH_INFO_PATH_CHANGE, /* keep last */ __NL80211_MPATH_INFO_AFTER_LAST, diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8e756ac076ad..aba2f6cbdc4f 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1743,7 +1743,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, MPATH_INFO_DISCOVERY_TIMEOUT | MPATH_INFO_DISCOVERY_RETRIES | MPATH_INFO_FLAGS | - MPATH_INFO_HOP_COUNT; + MPATH_INFO_HOP_COUNT | + MPATH_INFO_PATH_CHANGE; pinfo->frame_qlen = mpath->frame_queue.qlen; pinfo->sn = mpath->sn; @@ -1764,6 +1765,7 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, if (mpath->flags & MESH_PATH_RESOLVED) pinfo->flags |= NL80211_MPATH_FLAG_RESOLVED; pinfo->hop_count = mpath->hop_count; + pinfo->path_change_count = mpath->path_change_count; } static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 21526630bf65..dbb43e9454e0 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h @@ -94,6 +94,7 @@ enum mesh_deferred_task_flags { * @last_preq_to_root: Timestamp of last PREQ sent to root * @is_root: the destination station of this path is a root node * @is_gate: the destination station of this path is a mesh gate + * @path_change_count: the number of path changes to destination * * * The dst address is unique in the mesh path table. Since the mesh_path is @@ -124,6 +125,7 @@ struct mesh_path { unsigned long last_preq_to_root; bool is_root; bool is_gate; + u32 path_change_count; }; /** diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 6d1190b3332f..a0aebf44493f 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -479,6 +479,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, } if (fresh_info) { + if (rcu_access_pointer(mpath->next_hop) != sta) + mpath->path_change_count++; mesh_path_assign_nexthop(mpath, sta); mpath->flags |= MESH_PATH_SN_VALID; mpath->metric = new_metric; @@ -523,6 +525,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, } if (fresh_info) { + if (rcu_access_pointer(mpath->next_hop) != sta) + mpath->path_change_count++; mesh_path_assign_nexthop(mpath, sta); mpath->metric = last_hop_metric; mpath->exp_time = time_after(mpath->exp_time, exp_time) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 442c02415aed..3fde570f1cf3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5644,7 +5644,10 @@ static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, pinfo->discovery_retries)) || ((pinfo->filled & MPATH_INFO_HOP_COUNT) && nla_put_u8(msg, NL80211_MPATH_INFO_HOP_COUNT, - pinfo->hop_count))) + pinfo->hop_count)) || + ((pinfo->filled & MPATH_INFO_PATH_CHANGE) && + nla_put_u32(msg, NL80211_MPATH_INFO_PATH_CHANGE, + pinfo->path_change_count))) goto nla_put_failure; nla_nest_end(msg, pinfoattr);