Merge Lean's source
This commit is contained in:
commit
a73910a006
@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=5.4-rc2-1
|
||||
PKG_RELEASE:=3
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.4-rc2/
|
||||
PKG_HASH:=b3baedc135b455f09f266cb77e73276ca21bceeb0f24bac2184cc4b97d09cdbf
|
||||
PKG_VERSION:=5.4-rc8-1
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.4-rc8/
|
||||
PKG_HASH:=707ffc50d0f6fe3398bcc3a7abd44ffa088d9309255a3a71d014620c20d3bbf9
|
||||
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
|
||||
|
||||
@ -106,7 +106,9 @@ mac80211_hostapd_setup_base() {
|
||||
json_get_vars noscan ht_coex vendor_vht
|
||||
json_get_values ht_capab_list ht_capab tx_burst
|
||||
|
||||
[ -n "$noscan" -a "$noscan" -gt 0 ] && hostapd_noscan=1
|
||||
set_default noscan 0
|
||||
|
||||
[ "$noscan" -gt 0 ] && hostapd_noscan=1
|
||||
[ "$tx_burst" = 0 ] && tx_burst=
|
||||
|
||||
ieee80211n=1
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.c
|
||||
@@ -3071,6 +3071,16 @@ int ath10k_core_register(struct ath10k *
|
||||
@@ -3074,6 +3074,16 @@ int ath10k_core_register(struct ath10k *
|
||||
|
||||
queue_work(ar->workqueue, &ar->register_work);
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ v13:
|
||||
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
@@ -2788,6 +2794,10 @@ int ath10k_core_start(struct ath10k *ar,
|
||||
@@ -2791,6 +2797,10 @@ int ath10k_core_start(struct ath10k *ar,
|
||||
goto err_hif_stop;
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ v13:
|
||||
return 0;
|
||||
|
||||
err_hif_stop:
|
||||
@@ -3044,9 +3054,18 @@ static void ath10k_core_register_work(st
|
||||
@@ -3047,9 +3057,18 @@ static void ath10k_core_register_work(st
|
||||
goto err_spectral_destroy;
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ v13:
|
||||
err_spectral_destroy:
|
||||
ath10k_spectral_destroy(ar);
|
||||
err_debug_destroy:
|
||||
@@ -3092,6 +3111,8 @@ void ath10k_core_unregister(struct ath10
|
||||
@@ -3095,6 +3114,8 @@ void ath10k_core_unregister(struct ath10
|
||||
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
|
||||
return;
|
||||
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From: Miaoqing Pan <miaoqing@codeaurora.org>
|
||||
Subject: [PATCH] ath10k: fix latency issue for QCA988x
|
||||
Date: Thu, 29 Aug 2019 10:45:12 +0800
|
||||
|
||||
Bad latency is found on QCA988x, the issue was introduced by
|
||||
commit 4504f0e5b571 ("ath10k: sdio: workaround firmware UART
|
||||
pin configuration bug"). If uart_pin_workaround is false, this
|
||||
change will set uart pin even if uart_print is false.
|
||||
|
||||
Tested HW: QCA9880
|
||||
Tested FW: 10.2.4-1.0-00037
|
||||
|
||||
Fixes: 4504f0e5b571 ("ath10k: sdio: workaround firmware UART pin configuration bug")
|
||||
Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath10k/core.c | 15 +++++++++------
|
||||
1 file changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.c
|
||||
@@ -2124,12 +2124,15 @@ static int ath10k_init_uart(struct ath10
|
||||
return ret;
|
||||
}
|
||||
|
||||
- if (!uart_print && ar->hw_params.uart_pin_workaround) {
|
||||
- ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
|
||||
- ar->hw_params.uart_pin);
|
||||
- if (ret) {
|
||||
- ath10k_warn(ar, "failed to set UART TX pin: %d", ret);
|
||||
- return ret;
|
||||
+ if (!uart_print) {
|
||||
+ if (ar->hw_params.uart_pin_workaround) {
|
||||
+ ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
|
||||
+ ar->hw_params.uart_pin);
|
||||
+ if (ret) {
|
||||
+ ath10k_warn(ar, "failed to set UART TX pin: %d",
|
||||
+ ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -1,24 +0,0 @@
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Fri, 27 Sep 2019 23:12:08 +0200
|
||||
Subject: [PATCH] backports: pci: Include linux/pci-aspm.h
|
||||
|
||||
In upstream commit 7ce2e76a0420 linux/pci-aspm.h was removed and the
|
||||
content included into pci.h. Add an include to have the functions
|
||||
defined in linux/pci-aspm.h available when linux/pci.h is included.
|
||||
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
|
||||
--- a/backport-include/linux/pci.h
|
||||
+++ b/backport-include/linux/pci.h
|
||||
@@ -7,6 +7,10 @@
|
||||
#include <linux/pci-aspm.h>
|
||||
#endif
|
||||
|
||||
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
||||
+#include <linux/pci-aspm.h>
|
||||
+#endif
|
||||
+
|
||||
#ifndef module_pci_driver
|
||||
/**
|
||||
* module_pci_driver() - Helper macro for registering a PCI driver
|
||||
@ -1,43 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 28 Oct 2019 15:20:40 +0100
|
||||
Subject: [PATCH] backport: add pci_disable_link_state wrapper with return code
|
||||
|
||||
The signature of pci_disable_link_state was changed to indicate if the state
|
||||
was successfully disabled. Since the old version did not have this, add a
|
||||
wrapper which checks the pcie register to determine the return code
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/backport-include/linux/pci.h
|
||||
+++ b/backport-include/linux/pci.h
|
||||
@@ -240,4 +240,29 @@ static inline struct pci_dev *pcie_find_
|
||||
(PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX)
|
||||
#endif
|
||||
|
||||
+#if defined(CONFIG_PCI) && LINUX_VERSION_IS_LESS(5,3,0)
|
||||
+
|
||||
+static inline int
|
||||
+LINUX_BACKPORT(pci_disable_link_state)(struct pci_dev *pdev, int state)
|
||||
+{
|
||||
+ u16 aspmc;
|
||||
+
|
||||
+ pci_disable_link_state(pdev, state);
|
||||
+
|
||||
+ pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &aspmc);
|
||||
+ if ((state & PCIE_LINK_STATE_L0S) &&
|
||||
+ (aspmc & PCI_EXP_LNKCTL_ASPM_L0S))
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ if ((state & PCIE_LINK_STATE_L1) &&
|
||||
+ (aspmc & PCI_EXP_LNKCTL_ASPM_L1))
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#define pci_disable_link_state LINUX_BACKPORT(pci_disable_link_state)
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
#endif /* _BACKPORT_LINUX_PCI_H */
|
||||
@ -1,68 +0,0 @@
|
||||
From e3c57dd949835419cee8d3b45db38de58bf6ebd5 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Mon, 18 Nov 2019 01:13:37 +0100
|
||||
Subject: [PATCH] backports: Adapt to changes to skb_get_hash_perturb()
|
||||
|
||||
The skb_get_hash_perturb() function now takes a siphash_key_t instead of
|
||||
an u32. This was changed in commit 55667441c84f ("net/flow_dissector:
|
||||
switch to siphash"). Use the correct type in the fq header file
|
||||
depending on the kernel version.
|
||||
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
include/net/fq.h | 8 ++++++++
|
||||
include/net/fq_impl.h | 8 ++++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
--- a/include/net/fq.h
|
||||
+++ b/include/net/fq.h
|
||||
@@ -69,7 +69,15 @@ struct fq {
|
||||
struct list_head backlogs;
|
||||
spinlock_t lock;
|
||||
u32 flows_cnt;
|
||||
+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
|
||||
+ siphash_key_t perturbation;
|
||||
+#else
|
||||
u32 perturbation;
|
||||
+#endif
|
||||
u32 limit;
|
||||
u32 memory_limit;
|
||||
u32 memory_usage;
|
||||
--- a/include/net/fq_impl.h
|
||||
+++ b/include/net/fq_impl.h
|
||||
@@ -108,7 +108,15 @@ begin:
|
||||
|
||||
static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb)
|
||||
{
|
||||
+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
|
||||
+ u32 hash = skb_get_hash_perturb(skb, &fq->perturbation);
|
||||
+#else
|
||||
u32 hash = skb_get_hash_perturb(skb, fq->perturbation);
|
||||
+#endif
|
||||
|
||||
return reciprocal_scale(hash, fq->flows_cnt);
|
||||
}
|
||||
@@ -308,7 +316,15 @@ static int fq_init(struct fq *fq, int fl
|
||||
INIT_LIST_HEAD(&fq->backlogs);
|
||||
spin_lock_init(&fq->lock);
|
||||
fq->flows_cnt = max_t(u32, flows_cnt, 1);
|
||||
+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
|
||||
+ get_random_bytes(&fq->perturbation, sizeof(fq->perturbation));
|
||||
+#else
|
||||
fq->perturbation = prandom_u32();
|
||||
+#endif
|
||||
fq->quantum = 300;
|
||||
fq->limit = 8192;
|
||||
fq->memory_limit = 16 << 20; /* 16 MBytes */
|
||||
@ -1,35 +0,0 @@
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka@redhat.com>
|
||||
X-Patchwork-Id: 11161981
|
||||
From: Stanislaw Gruszka <sgruszka@redhat.com>
|
||||
To: linux-wireless@vger.kernel.org
|
||||
Subject: [PATCH] rt2x00: initialize last_reset
|
||||
Date: Thu, 26 Sep 2019 10:54:33 +0200
|
||||
Message-Id: <20190926085433.1300-1-sgruszka@redhat.com>
|
||||
Sender: linux-wireless-owner@vger.kernel.org
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Initialize last_reset variable to INITIAL_JIFFIES, otherwise it is not
|
||||
possible to test H/W reset for first 5 minutes of system run.
|
||||
|
||||
Fixes: e403fa31ed71 ("rt2x00: add restart hw")
|
||||
Reported-and-tested-by: Jonathan Liu <net147@gmail.com>
|
||||
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00debug.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
|
||||
@@ -555,7 +555,7 @@ static ssize_t rt2x00debug_write_restart
|
||||
{
|
||||
struct rt2x00debug_intf *intf = file->private_data;
|
||||
struct rt2x00_dev *rt2x00dev = intf->rt2x00dev;
|
||||
- static unsigned long last_reset;
|
||||
+ static unsigned long last_reset = INITIAL_JIFFIES;
|
||||
|
||||
if (!rt2x00_has_cap_restart_hw(rt2x00dev))
|
||||
return -EOPNOTSUPP;
|
||||
@ -22,7 +22,7 @@
|
||||
+#endif /* _RT2X00_PLATFORM_H */
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -29,6 +29,7 @@
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <linux/average.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
.drv_init_registers = rt2800mmio_init_registers,
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -695,6 +695,7 @@ enum rt2x00_capability_flags {
|
||||
@@ -694,6 +694,7 @@ enum rt2x00_capability_flags {
|
||||
REQUIRE_HT_TX_DESC,
|
||||
REQUIRE_PS_AUTOWAKE,
|
||||
REQUIRE_DELAYED_RFKILL,
|
||||
@ -113,7 +113,7 @@
|
||||
|
||||
/*
|
||||
* Capabilities
|
||||
@@ -971,6 +972,11 @@ struct rt2x00_dev {
|
||||
@@ -970,6 +971,11 @@ struct rt2x00_dev {
|
||||
const struct firmware *fw;
|
||||
|
||||
/*
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
num_rates += 4;
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -400,6 +400,7 @@ struct hw_mode_spec {
|
||||
@@ -399,6 +399,7 @@ struct hw_mode_spec {
|
||||
unsigned int supported_bands;
|
||||
#define SUPPORT_BAND_2GHZ 0x00000001
|
||||
#define SUPPORT_BAND_5GHZ 0x00000002
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -563,6 +563,7 @@ struct rt2x00lib_ops {
|
||||
@@ -562,6 +562,7 @@ struct rt2x00lib_ops {
|
||||
struct link_qual *qual, const u32 count);
|
||||
void (*gain_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
void (*vco_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
@ -182,7 +182,7 @@
|
||||
void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -564,6 +564,8 @@ struct rt2x00lib_ops {
|
||||
@@ -563,6 +563,8 @@ struct rt2x00lib_ops {
|
||||
void (*gain_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
void (*vco_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
void (*rf_self_txdc_cal) (struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -566,6 +566,7 @@ struct rt2x00lib_ops {
|
||||
@@ -565,6 +565,7 @@ struct rt2x00lib_ops {
|
||||
void (*rf_self_txdc_cal) (struct rt2x00_dev *rt2x00dev);
|
||||
int (*calcrcalibrationcode) (struct rt2x00_dev *rt2x00dev, int d1, int d2);
|
||||
void (*r_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
@ -407,7 +407,7 @@
|
||||
void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -567,6 +567,7 @@ struct rt2x00lib_ops {
|
||||
@@ -566,6 +566,7 @@ struct rt2x00lib_ops {
|
||||
int (*calcrcalibrationcode) (struct rt2x00_dev *rt2x00dev, int d1, int d2);
|
||||
void (*r_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
void (*rxdcoc_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
@ -992,7 +992,7 @@
|
||||
void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -568,6 +568,7 @@ struct rt2x00lib_ops {
|
||||
@@ -567,6 +567,7 @@ struct rt2x00lib_ops {
|
||||
void (*r_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
void (*rxdcoc_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
void (*rxiq_calibration) (struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
@ -1,118 +0,0 @@
|
||||
From dc0c18ed229cdcca283dd78fefa38273ec37a42c Mon Sep 17 00:00:00 2001
|
||||
From: Aaron Komisar <aaron.komisar@tandemg.com>
|
||||
Date: Wed, 2 Oct 2019 13:59:07 +0000
|
||||
Subject: mac80211: fix scan when operating on DFS channels in ETSI domains
|
||||
|
||||
In non-ETSI regulatory domains scan is blocked when operating channel
|
||||
is a DFS channel. For ETSI, however, once DFS channel is marked as
|
||||
available after the CAC, this channel will remain available (for some
|
||||
time) even after leaving this channel.
|
||||
|
||||
Therefore a scan can be done without any impact on the availability
|
||||
of the DFS channel as no new CAC is required after the scan.
|
||||
|
||||
Enable scan in mac80211 in these cases.
|
||||
|
||||
Signed-off-by: Aaron Komisar <aaron.komisar@tandemg.com>
|
||||
Link: https://lore.kernel.org/r/1570024728-17284-1-git-send-email-aaron.komisar@tandemg.com
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
include/net/cfg80211.h | 8 ++++++++
|
||||
net/mac80211/scan.c | 30 ++++++++++++++++++++++++++++--
|
||||
net/wireless/reg.c | 1 +
|
||||
net/wireless/reg.h | 8 --------
|
||||
4 files changed, 37 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -5554,6 +5554,14 @@ const struct ieee80211_reg_rule *freq_re
|
||||
const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
|
||||
|
||||
/**
|
||||
+ * regulatory_pre_cac_allowed - check if pre-CAC allowed in the current regdom
|
||||
+ * @wiphy: wiphy for which pre-CAC capability is checked.
|
||||
+ *
|
||||
+ * Pre-CAC is allowed only in some regdomains (notable ETSI).
|
||||
+ */
|
||||
+bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
|
||||
+
|
||||
+/**
|
||||
* DOC: Internal regulatory db functions
|
||||
*
|
||||
*/
|
||||
--- a/net/mac80211/scan.c
|
||||
+++ b/net/mac80211/scan.c
|
||||
@@ -520,10 +520,33 @@ static int ieee80211_start_sw_scan(struc
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static bool __ieee80211_can_leave_ch(struct ieee80211_sub_if_data *sdata)
|
||||
+{
|
||||
+ struct ieee80211_local *local = sdata->local;
|
||||
+ struct ieee80211_sub_if_data *sdata_iter;
|
||||
+
|
||||
+ if (!ieee80211_is_radar_required(local))
|
||||
+ return true;
|
||||
+
|
||||
+ if (!regulatory_pre_cac_allowed(local->hw.wiphy))
|
||||
+ return false;
|
||||
+
|
||||
+ mutex_lock(&local->iflist_mtx);
|
||||
+ list_for_each_entry(sdata_iter, &local->interfaces, list) {
|
||||
+ if (sdata_iter->wdev.cac_started) {
|
||||
+ mutex_unlock(&local->iflist_mtx);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ mutex_unlock(&local->iflist_mtx);
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
static bool ieee80211_can_scan(struct ieee80211_local *local,
|
||||
struct ieee80211_sub_if_data *sdata)
|
||||
{
|
||||
- if (ieee80211_is_radar_required(local))
|
||||
+ if (!__ieee80211_can_leave_ch(sdata))
|
||||
return false;
|
||||
|
||||
if (!list_empty(&local->roc_list))
|
||||
@@ -630,7 +653,10 @@ static int __ieee80211_start_scan(struct
|
||||
|
||||
lockdep_assert_held(&local->mtx);
|
||||
|
||||
- if (local->scan_req || ieee80211_is_radar_required(local))
|
||||
+ if (local->scan_req)
|
||||
+ return -EBUSY;
|
||||
+
|
||||
+ if (!__ieee80211_can_leave_ch(sdata))
|
||||
return -EBUSY;
|
||||
|
||||
if (!ieee80211_can_scan(local, sdata)) {
|
||||
--- a/net/wireless/reg.c
|
||||
+++ b/net/wireless/reg.c
|
||||
@@ -3883,6 +3883,7 @@ bool regulatory_pre_cac_allowed(struct w
|
||||
|
||||
return pre_cac_allowed;
|
||||
}
|
||||
+EXPORT_SYMBOL(regulatory_pre_cac_allowed);
|
||||
|
||||
void regulatory_propagate_dfs_state(struct wiphy *wiphy,
|
||||
struct cfg80211_chan_def *chandef,
|
||||
--- a/net/wireless/reg.h
|
||||
+++ b/net/wireless/reg.h
|
||||
@@ -156,14 +156,6 @@ bool regulatory_indoor_allowed(void);
|
||||
#define REG_PRE_CAC_EXPIRY_GRACE_MS 2000
|
||||
|
||||
/**
|
||||
- * regulatory_pre_cac_allowed - if pre-CAC allowed in the current dfs domain
|
||||
- * @wiphy: wiphy for which pre-CAC capability is checked.
|
||||
-
|
||||
- * Pre-CAC is allowed only in ETSI domain.
|
||||
- */
|
||||
-bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
|
||||
-
|
||||
-/**
|
||||
* regulatory_propagate_dfs_state - Propagate DFS channel state to other wiphys
|
||||
* @wiphy - wiphy on which radar is detected and the event will be propagated
|
||||
* to other available wiphys having the same DFS domain
|
||||
@ -1,39 +0,0 @@
|
||||
From 95697f9907bfe3eab0ef20265a766b22e27dde64 Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Fri, 4 Oct 2019 15:37:05 +0300
|
||||
Subject: [PATCH] mac80211: accept deauth frames in IBSS mode
|
||||
|
||||
We can process deauth frames and all, but we drop them very
|
||||
early in the RX path today - this could never have worked.
|
||||
|
||||
Fixes: 2cc59e784b54 ("mac80211: reply to AUTH with DEAUTH if sta allocation fails in IBSS")
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
|
||||
Link: https://lore.kernel.org/r/20191004123706.15768-2-luca@coelho.fi
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
net/mac80211/rx.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/net/mac80211/rx.c
|
||||
+++ b/net/mac80211/rx.c
|
||||
@@ -3467,9 +3467,18 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
|
||||
case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
|
||||
/* process for all: mesh, mlme, ibss */
|
||||
break;
|
||||
+ case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
|
||||
+ if (is_multicast_ether_addr(mgmt->da) &&
|
||||
+ !is_broadcast_ether_addr(mgmt->da))
|
||||
+ return RX_DROP_MONITOR;
|
||||
+
|
||||
+ /* process only for station/IBSS */
|
||||
+ if (sdata->vif.type != NL80211_IFTYPE_STATION &&
|
||||
+ sdata->vif.type != NL80211_IFTYPE_ADHOC)
|
||||
+ return RX_DROP_MONITOR;
|
||||
+ break;
|
||||
case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP):
|
||||
case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP):
|
||||
- case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
|
||||
case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
|
||||
if (is_multicast_ether_addr(mgmt->da) &&
|
||||
!is_broadcast_ether_addr(mgmt->da))
|
||||
@ -2,13 +2,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netifd
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
|
||||
PKG_SOURCE_DATE:=2019-08-05
|
||||
PKG_SOURCE_VERSION:=5e02f94411b06f192fb2a7d9be9abde3549153a8
|
||||
PKG_MIRROR_HASH:=96e158584c605e96aceb3ce7e8ad8faa8e774ffd67d59558b2d6c2ff49d0f1a5
|
||||
PKG_SOURCE_DATE:=2019-11-12
|
||||
PKG_SOURCE_VERSION:=e15147c272201eb17320c10ec95919e641bd03c5
|
||||
PKG_MIRROR_HASH:=af830967d3d9f20d8d3c01b1931e501e075984043e38c23ac649faced34e896a
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
migrate_release() {
|
||||
local config="$1"
|
||||
local proto
|
||||
local release
|
||||
|
||||
config_get proto "$config" proto
|
||||
config_get release "$config" release
|
||||
|
||||
[ "$proto" = "dhcp" ] && [ -n "$release" ] && {
|
||||
norelease="$((!$release))"
|
||||
uci_set network "$config" norelease "$norelease"
|
||||
uci_remove network "$config" release
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach migrate_release interface
|
||||
commit network
|
||||
|
||||
exit 0
|
||||
@ -14,7 +14,7 @@ proto_dhcp_init_config() {
|
||||
proto_config_add_string clientid
|
||||
proto_config_add_string vendorid
|
||||
proto_config_add_boolean 'broadcast:bool'
|
||||
proto_config_add_boolean 'release:bool'
|
||||
proto_config_add_boolean 'norelease:bool'
|
||||
proto_config_add_string 'reqopts:list(string)'
|
||||
proto_config_add_boolean 'defaultreqopts:bool'
|
||||
proto_config_add_string iface6rd
|
||||
@ -35,8 +35,8 @@ proto_dhcp_setup() {
|
||||
local config="$1"
|
||||
local iface="$2"
|
||||
|
||||
local ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
|
||||
json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd delegate zone6rd zone mtu6rd customroutes classlessroute
|
||||
local ipaddr hostname clientid vendorid broadcast norelease reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
|
||||
json_get_vars ipaddr hostname clientid vendorid broadcast norelease reqopts defaultreqopts iface6rd delegate zone6rd zone mtu6rd customroutes classlessroute
|
||||
|
||||
local opt dhcpopts
|
||||
for opt in $reqopts; do
|
||||
@ -50,7 +50,7 @@ proto_dhcp_setup() {
|
||||
|
||||
[ "$defaultreqopts" = 0 ] && defaultreqopts="-o" || defaultreqopts=
|
||||
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
|
||||
[ "$release" = 1 ] && release="-R" || release=
|
||||
[ "$norelease" = 1 ] && norelease="" || norelease="-R"
|
||||
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
|
||||
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
|
||||
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
|
||||
@ -70,7 +70,7 @@ proto_dhcp_setup() {
|
||||
${ipaddr:+-r $ipaddr} \
|
||||
${hostname:+-x "hostname:$hostname"} \
|
||||
${vendorid:+-V "$vendorid"} \
|
||||
$clientid $defaultreqopts $broadcast $release $dhcpopts
|
||||
$clientid $defaultreqopts $broadcast $norelease $dhcpopts
|
||||
}
|
||||
|
||||
proto_dhcp_renew() {
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iw
|
||||
PKG_VERSION:=5.3
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/iw
|
||||
|
||||
@ -1,46 +1,96 @@
|
||||
--- a/nl80211.h
|
||||
+++ b/nl80211.h
|
||||
@@ -657,9 +657,7 @@
|
||||
* is used during CSA period.
|
||||
* @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
|
||||
* command may be used with the corresponding cookie to cancel the wait
|
||||
- * time if it is known that it is no longer necessary. This command is
|
||||
- * also sent as an event whenever the driver has completed the off-channel
|
||||
- * wait time.
|
||||
+ * time if it is known that it is no longer necessary.
|
||||
* @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
|
||||
* @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
|
||||
* transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
|
||||
@@ -2358,8 +2356,8 @@ enum nl80211_commands {
|
||||
@@ -52,6 +52,11 @@
|
||||
#define NL80211_MULTICAST_GROUP_NAN "nan"
|
||||
#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"
|
||||
|
||||
+#define NL80211_EDMG_BW_CONFIG_MIN 4
|
||||
+#define NL80211_EDMG_BW_CONFIG_MAX 15
|
||||
+#define NL80211_EDMG_CHANNELS_MIN 1
|
||||
+#define NL80211_EDMG_CHANNELS_MAX 0x3c /* 0b00111100 */
|
||||
+
|
||||
/**
|
||||
* DOC: Station handling
|
||||
*
|
||||
* @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support.
|
||||
@@ -2361,6 +2366,16 @@ enum nl80211_commands {
|
||||
* @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection
|
||||
* functionality.
|
||||
*
|
||||
- * @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection
|
||||
- * functionality.
|
||||
+ * @NL80211_ATTR_WIPHY_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
|
||||
+ * channel(s) that are allowed to be used for EDMG transmissions.
|
||||
+ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251. (u8 attribute)
|
||||
+ * @NL80211_ATTR_WIPHY_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
|
||||
+ * the allowed channel bandwidth configurations. (u8 attribute)
|
||||
+ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
|
||||
+ *
|
||||
+ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
|
||||
+ * transmit power to stay within regulatory limits. u32, dBi.
|
||||
*
|
||||
+ *
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
@@ -2818,7 +2816,7 @@ enum nl80211_attrs {
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -2820,6 +2835,11 @@ enum nl80211_attrs {
|
||||
|
||||
NL80211_ATTR_TWT_RESPONDER,
|
||||
NL80211_ATTR_HE_OBSS_PD,
|
||||
|
||||
- NL80211_ATTR_HE_OBSS_PD,
|
||||
+ NL80211_ATTR_WIPHY_EDMG_CHANNELS,
|
||||
+ NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,
|
||||
+
|
||||
+ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
|
||||
|
||||
+
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
@@ -3843,6 +3841,8 @@ enum nl80211_user_reg_hint_type {
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
@@ -3201,6 +3221,8 @@ enum nl80211_sta_bss_param {
|
||||
* sent to the station (u64, usec)
|
||||
* @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
|
||||
* @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
|
||||
+ * @NL80211_STA_INFO_ASSOC_AT_BOOTTIME: Timestamp (CLOCK_BOOTTIME, nanoseconds)
|
||||
+ * of STA's association
|
||||
* @__NL80211_STA_INFO_AFTER_LAST: internal
|
||||
* @NL80211_STA_INFO_MAX: highest possible station info attribute
|
||||
*/
|
||||
@@ -3247,6 +3269,7 @@ enum nl80211_sta_info {
|
||||
NL80211_STA_INFO_TX_DURATION,
|
||||
NL80211_STA_INFO_AIRTIME_WEIGHT,
|
||||
NL80211_STA_INFO_AIRTIME_LINK_METRIC,
|
||||
+ NL80211_STA_INFO_ASSOC_AT_BOOTTIME,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_STA_INFO_AFTER_LAST,
|
||||
@@ -3428,6 +3451,12 @@ enum nl80211_band_iftype_attr {
|
||||
* @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
|
||||
* @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using
|
||||
* attributes from &enum nl80211_band_iftype_attr
|
||||
+ * @NL80211_BAND_ATTR_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
|
||||
+ * channel(s) that are allowed to be used for EDMG transmissions.
|
||||
+ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251.
|
||||
+ * @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
|
||||
+ * the allowed channel bandwidth configurations.
|
||||
+ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
|
||||
* @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
|
||||
* @__NL80211_BAND_ATTR_AFTER_LAST: internal use
|
||||
*/
|
||||
@@ -3445,6 +3474,9 @@ enum nl80211_band_attr {
|
||||
NL80211_BAND_ATTR_VHT_CAPA,
|
||||
NL80211_BAND_ATTR_IFTYPE_DATA,
|
||||
|
||||
+ NL80211_BAND_ATTR_EDMG_CHANNELS,
|
||||
+ NL80211_BAND_ATTR_EDMG_BW_CONFIG,
|
||||
+
|
||||
/* keep last */
|
||||
__NL80211_BAND_ATTR_AFTER_LAST,
|
||||
NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
|
||||
@@ -3843,6 +3875,8 @@ enum nl80211_user_reg_hint_type {
|
||||
* @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
|
||||
* (on this channel or globally)
|
||||
* @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment
|
||||
+ * @NL80211_SURVEY_INFO_TIME_BSS_RX: amount of time the radio spent
|
||||
+ * receiving local BSS data
|
||||
+ * receiving frames destined to the local BSS
|
||||
* @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
|
||||
* currently defined
|
||||
* @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
|
||||
@@ -3859,6 +3859,7 @@ enum nl80211_survey_info {
|
||||
@@ -3859,6 +3893,7 @@ enum nl80211_survey_info {
|
||||
NL80211_SURVEY_INFO_TIME_TX,
|
||||
NL80211_SURVEY_INFO_TIME_SCAN,
|
||||
NL80211_SURVEY_INFO_PAD,
|
||||
@ -48,30 +98,19 @@
|
||||
|
||||
/* keep last */
|
||||
__NL80211_SURVEY_INFO_AFTER_LAST,
|
||||
@@ -6495,26 +6496,4 @@ enum nl80211_peer_measurement_ftm_resp {
|
||||
NL80211_PMSR_FTM_RESP_ATTR_MAX = NUM_NL80211_PMSR_FTM_RESP_ATTR - 1
|
||||
};
|
||||
@@ -4543,6 +4578,7 @@ enum nl80211_txrate_gi {
|
||||
* @NL80211_BAND_2GHZ: 2.4 GHz ISM band
|
||||
* @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
|
||||
* @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
|
||||
+ * @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
|
||||
* @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
|
||||
* since newer kernel versions may support more bands
|
||||
*/
|
||||
@@ -4550,6 +4586,7 @@ enum nl80211_band {
|
||||
NL80211_BAND_2GHZ,
|
||||
NL80211_BAND_5GHZ,
|
||||
NL80211_BAND_60GHZ,
|
||||
+ NL80211_BAND_6GHZ,
|
||||
|
||||
-/**
|
||||
- * enum nl80211_obss_pd_attributes - OBSS packet detection attributes
|
||||
- * @__NL80211_HE_OBSS_PD_ATTR_INVALID: Invalid
|
||||
- *
|
||||
- * @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset.
|
||||
- * @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset.
|
||||
- *
|
||||
- * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal
|
||||
- * @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute.
|
||||
- */
|
||||
-enum nl80211_obss_pd_attributes {
|
||||
- __NL80211_HE_OBSS_PD_ATTR_INVALID,
|
||||
-
|
||||
- NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,
|
||||
- NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET,
|
||||
-
|
||||
- /* keep last */
|
||||
- __NL80211_HE_OBSS_PD_ATTR_LAST,
|
||||
- NL80211_HE_OBSS_PD_ATTR_MAX = __NL80211_HE_OBSS_PD_ATTR_LAST - 1,
|
||||
-};
|
||||
-
|
||||
-
|
||||
#endif /* __LINUX_NL80211_H */
|
||||
NUM_NL80211_BANDS,
|
||||
};
|
||||
|
||||
@ -127,7 +127,7 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
# netlink interface for nf_conntrack
|
||||
--- /dev/null
|
||||
+++ b/net/netfilter/nf_conntrack_rtcache.c
|
||||
@@ -0,0 +1,428 @@
|
||||
@@ -0,0 +1,430 @@
|
||||
+/* route cache for netfilter.
|
||||
+ *
|
||||
+ * (C) 2014 Red Hat GmbH
|
||||
@ -444,6 +444,11 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ .destroy = nf_conn_rtcache_destroy,
|
||||
+};
|
||||
+
|
||||
+static int __net_init rtcache_net_init(struct net *net)
|
||||
+{
|
||||
+ return nf_register_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops));
|
||||
+}
|
||||
+
|
||||
+static void __net_exit rtcache_net_exit(struct net *net)
|
||||
+{
|
||||
+ /* remove hooks so no new connections get rtcache extension */
|
||||
@ -451,6 +456,7 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+}
|
||||
+
|
||||
+static struct pernet_operations rtcache_ops_net_ops = {
|
||||
+ .init = rtcache_net_init,
|
||||
+ .exit = rtcache_net_exit,
|
||||
+};
|
||||
+
|
||||
@ -469,18 +475,8 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = nf_register_net_hooks(&init_net, rtcache_ops,
|
||||
+ ARRAY_SIZE(rtcache_ops));
|
||||
+ if (ret < 0) {
|
||||
+ nf_ct_extend_unregister(&rtcache_extend);
|
||||
+ unregister_pernet_subsys(&rtcache_ops_net_ops);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = register_netdevice_notifier(&nf_rtcache_notifier);
|
||||
+ if (ret) {
|
||||
+ nf_unregister_net_hooks(&init_net, rtcache_ops,
|
||||
+ ARRAY_SIZE(rtcache_ops));
|
||||
+ nf_ct_extend_unregister(&rtcache_extend);
|
||||
+ unregister_pernet_subsys(&rtcache_ops_net_ops);
|
||||
+ }
|
||||
@ -531,6 +527,11 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ synchronize_net();
|
||||
+
|
||||
+ unregister_netdevice_notifier(&nf_rtcache_notifier);
|
||||
+ unregister_pernet_subsys(&rtcache_ops_net_ops);
|
||||
+ for_each_net(net)
|
||||
+ nf_unregister_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops));
|
||||
+
|
||||
+ synchronize_net();
|
||||
+
|
||||
+ rtnl_lock();
|
||||
+
|
||||
@ -547,6 +548,7 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ }
|
||||
+
|
||||
+ rtnl_unlock();
|
||||
+
|
||||
+ synchronize_net();
|
||||
+ nf_ct_extend_unregister(&rtcache_extend);
|
||||
+}
|
||||
|
||||
@ -127,7 +127,7 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
# netlink interface for nf_conntrack
|
||||
--- /dev/null
|
||||
+++ b/net/netfilter/nf_conntrack_rtcache.c
|
||||
@@ -0,0 +1,428 @@
|
||||
@@ -0,0 +1,430 @@
|
||||
+/* route cache for netfilter.
|
||||
+ *
|
||||
+ * (C) 2014 Red Hat GmbH
|
||||
@ -444,6 +444,11 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ .destroy = nf_conn_rtcache_destroy,
|
||||
+};
|
||||
+
|
||||
+static int __net_init rtcache_net_init(struct net *net)
|
||||
+{
|
||||
+ return nf_register_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops));
|
||||
+}
|
||||
+
|
||||
+static void __net_exit rtcache_net_exit(struct net *net)
|
||||
+{
|
||||
+ /* remove hooks so no new connections get rtcache extension */
|
||||
@ -451,6 +456,7 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+}
|
||||
+
|
||||
+static struct pernet_operations rtcache_ops_net_ops = {
|
||||
+ .init = rtcache_net_init,
|
||||
+ .exit = rtcache_net_exit,
|
||||
+};
|
||||
+
|
||||
@ -469,18 +475,8 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = nf_register_net_hooks(&init_net, rtcache_ops,
|
||||
+ ARRAY_SIZE(rtcache_ops));
|
||||
+ if (ret < 0) {
|
||||
+ nf_ct_extend_unregister(&rtcache_extend);
|
||||
+ unregister_pernet_subsys(&rtcache_ops_net_ops);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = register_netdevice_notifier(&nf_rtcache_notifier);
|
||||
+ if (ret) {
|
||||
+ nf_unregister_net_hooks(&init_net, rtcache_ops,
|
||||
+ ARRAY_SIZE(rtcache_ops));
|
||||
+ nf_ct_extend_unregister(&rtcache_extend);
|
||||
+ unregister_pernet_subsys(&rtcache_ops_net_ops);
|
||||
+ }
|
||||
@ -531,6 +527,11 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ synchronize_net();
|
||||
+
|
||||
+ unregister_netdevice_notifier(&nf_rtcache_notifier);
|
||||
+ unregister_pernet_subsys(&rtcache_ops_net_ops);
|
||||
+ for_each_net(net)
|
||||
+ nf_unregister_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops));
|
||||
+
|
||||
+ synchronize_net();
|
||||
+
|
||||
+ rtnl_lock();
|
||||
+
|
||||
@ -547,6 +548,7 @@ Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
+ }
|
||||
+
|
||||
+ rtnl_unlock();
|
||||
+
|
||||
+ synchronize_net();
|
||||
+ nf_ct_extend_unregister(&rtcache_extend);
|
||||
+}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user