mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-19 03:43:29 +00:00
This commit is contained in:
commit
a6713ee37d
@ -3,11 +3,11 @@
|
||||
LINUX_RELEASE?=1
|
||||
|
||||
LINUX_VERSION-3.18 = .71
|
||||
LINUX_VERSION-4.4 = .91
|
||||
LINUX_VERSION-4.4 = .92
|
||||
LINUX_VERSION-4.9 = .54
|
||||
|
||||
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
|
||||
LINUX_KERNEL_HASH-4.4.91 = cb9d2b8c1afe58414de5bc7d65429cc9f5f37c80fc229d0e83c55c5c3c254ffb
|
||||
LINUX_KERNEL_HASH-4.4.92 = 53f8cd8b024444df0f242f8e6ab5147b0b009d7a30e8b2ed3854e8d17937460d
|
||||
LINUX_KERNEL_HASH-4.9.54 = 651005db6efbce4fcd607415ebd697dd8d2f5a2abc2c632b11ece03a1a210fc5
|
||||
|
||||
ifdef KERNEL_PATCHVER
|
||||
|
@ -17,7 +17,7 @@ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fs
|
||||
iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount \
|
||||
default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
|
||||
luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd luci-app-sfe \
|
||||
luci-app-pptp-server luci-app-ipsec-vpnd
|
||||
luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-nlbwmon
|
||||
# For nas targets
|
||||
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
|
||||
# For router targets
|
||||
|
@ -40,7 +40,7 @@ VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
|
||||
VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
|
||||
|
||||
VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.2)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.3)
|
||||
|
||||
VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
|
||||
|
@ -82,38 +82,38 @@ define Download/ct-firmware
|
||||
URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
|
||||
endef
|
||||
|
||||
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19-rc5-lede
|
||||
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-19.bin.lede
|
||||
define Download/ath10k-firmware-qca988x-ct
|
||||
$(call Download/ct-firmware,QCA988X,)
|
||||
HASH:=556d6a4df50cd94a229a240d6d1d108ed5910069902f1e0cbb57b02ede27690f
|
||||
HASH:=bff98f028062dae9fc638c7596aec3c79bf9eddaff65cfacba067f6d72f217cd
|
||||
endef
|
||||
$(eval $(call Download,ath10k-firmware-qca988x-ct))
|
||||
|
||||
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19-rc5-lede
|
||||
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-19.bin.lede
|
||||
define Download/ath10k-firmware-qca9887-ct
|
||||
$(call Download/ct-firmware,QCA9887,ath10k-9887)
|
||||
HASH:=725982694156e0b891dcd1b1b18ba5318fbbe173f4ec9603ff7acbd08f7c4050
|
||||
HASH:=95dc106f98672bd9c7d3fe6881ed79ab079cb49b0a995650991b1beaff2b0101
|
||||
endef
|
||||
$(eval $(call Download,ath10k-firmware-qca9887-ct))
|
||||
|
||||
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.002
|
||||
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
|
||||
define Download/ath10k-firmware-qca99x0-ct
|
||||
$(call Download/ct-firmware,QCA99X0,ath10k-10-4)
|
||||
HASH:=e3c77077b47d55219f90816a51bf046f5b40c32be5e96bf629b083d873a879ad
|
||||
HASH:=993c29fd64bb2a59b86d34f58601a1a48b83b541750bc511f78cc17152829b4d
|
||||
endef
|
||||
$(eval $(call Download,ath10k-firmware-qca99x0-ct))
|
||||
|
||||
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.002
|
||||
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
|
||||
define Download/ath10k-firmware-qca9984-ct
|
||||
$(call Download/ct-firmware,QCA9984,ath10k-9984-10-4)
|
||||
HASH:=610f7747db6b101f4fc21431b776ac640b5977357e5be9aece2349447b9b1d85
|
||||
HASH:=d997eed9a8bc6809c01d367759ba8545c10e3be93ea1f33d6d753127ef0f7c5e
|
||||
endef
|
||||
$(eval $(call Download,ath10k-firmware-qca9984-ct))
|
||||
|
||||
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.002
|
||||
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
|
||||
define Download/ath10k-firmware-qca9888-ct
|
||||
$(call Download/ct-firmware,QCA9888,ath10k-9888-10-4)
|
||||
HASH:=f92e7d7968698af7c6f2d76b31b3645589e03839e15838010ce457c635e5aae6
|
||||
HASH:=bbaa71bc7dcaa264c5875e86639f174908fed09fbace975e325959d42f3754ff
|
||||
endef
|
||||
$(eval $(call Download,ath10k-firmware-qca9888-ct))
|
||||
|
||||
|
@ -8,13 +8,18 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2017-05-16
|
||||
PKG_SOURCE_VERSION:=c048ef0c3eedf99b41bc12b3f4e47ef3d9fab484
|
||||
PKG_MIRROR_HASH:=7936293962a10a0da7469759623013fc151019a6a584cfc6416bc0b605bd74d7
|
||||
PKG_SOURCE_DATE:=2017-06-13
|
||||
PKG_SOURCE_VERSION:=bded1823912549017d819d1796273b3134c3de20
|
||||
PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
|
||||
|
||||
PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
# Build the 4.13 ath10k-ct driver version. Other options are "-4.9", or
|
||||
# leave un-defined for 4.7 kernel. Probably this should match as closely as
|
||||
# possible to whatever mac80211 backports version is being used.
|
||||
CT_KVER="-4.13"
|
||||
|
||||
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
@ -25,8 +30,8 @@ define KernelPackage/ath10k-ct
|
||||
TITLE:=ath10k-ct driver optimized for CT ath10k firmware
|
||||
DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +@KERNEL_RELAY +kmod-hwmon-core
|
||||
FILES:=\
|
||||
$(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
|
||||
$(PKG_BUILD_DIR)/ath10k/ath10k_core.ko
|
||||
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
|
||||
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
|
||||
AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
|
||||
endef
|
||||
|
||||
@ -75,7 +80,7 @@ define Build/Compile
|
||||
+$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)/ath10k" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
modules
|
||||
endef
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
firmware = ar->normal_mode_fw.fw_file.firmware;
|
||||
if (firmware)
|
||||
@@ -3413,7 +3413,7 @@ int ath10k_debug_register(struct ath10k
|
||||
@@ -3422,7 +3422,7 @@ int ath10k_debug_register(struct ath10k
|
||||
debugfs_create_file("nf_cal_period", S_IRUSR | S_IWUSR,
|
||||
ar->debug.debugfs_phy, ar, &fops_nf_cal_period);
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
&fops_simulate_radar);
|
||||
--- a/ath10k/mac.c
|
||||
+++ b/ath10k/mac.c
|
||||
@@ -3596,7 +3596,7 @@ static void ath10k_regd_update(struct at
|
||||
@@ -3604,7 +3604,7 @@ static void ath10k_regd_update(struct at
|
||||
|
||||
regpair = ar->ath_common.regulatory.regpair;
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
nl_dfs_reg = ar->dfs_detector->region;
|
||||
wmi_dfs_reg = ath10k_mac_get_dfs_region(nl_dfs_reg);
|
||||
ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
|
||||
@@ -3630,7 +3630,7 @@ static void ath10k_reg_notifier(struct w
|
||||
@@ -3638,7 +3638,7 @@ static void ath10k_reg_notifier(struct w
|
||||
|
||||
ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory);
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "reg-notifier: dfs region 0x%x\n",
|
||||
request->dfs_region);
|
||||
result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector,
|
||||
@@ -8925,7 +8925,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -8938,7 +8938,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
|
||||
ar->hw->netdev_features = NETIF_F_HW_CSUM;
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
/* Init ath dfs pattern detector */
|
||||
ar->ath_common.debug_mask = ATH_DBG_DFS;
|
||||
ar->dfs_detector = dfs_pattern_detector_init(&ar->ath_common,
|
||||
@@ -8970,7 +8970,7 @@ err_unregister:
|
||||
@@ -8983,7 +8983,7 @@ err_unregister:
|
||||
ieee80211_unregister_hw(ar->hw);
|
||||
|
||||
err_dfs_detector_exit:
|
||||
@ -64,7 +64,7 @@
|
||||
ar->dfs_detector->exit(ar->dfs_detector);
|
||||
|
||||
err_free:
|
||||
@@ -8985,7 +8985,7 @@ void ath10k_mac_unregister(struct ath10k
|
||||
@@ -8998,7 +8998,7 @@ void ath10k_mac_unregister(struct ath10k
|
||||
{
|
||||
ieee80211_unregister_hw(ar->hw);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/ath10k/htt_rx.c
|
||||
+++ b/ath10k/htt_rx.c
|
||||
@@ -2497,7 +2497,7 @@ bool ath10k_htt_t2h_msg_handler(struct a
|
||||
@@ -2514,7 +2514,7 @@ bool ath10k_htt_t2h_msg_handler(struct a
|
||||
u32 freq = __le32_to_cpu(resp->chan_change.freq);
|
||||
|
||||
ar->tgt_oper_chan =
|
||||
|
@ -51,7 +51,7 @@
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -883,13 +883,10 @@ static void ath10k_htt_rx_h_ppdu(struct
|
||||
@@ -900,13 +900,10 @@ static void ath10k_htt_rx_h_ppdu(struct
|
||||
/* New PPDU starts so clear out the old per-PPDU status. */
|
||||
status->freq = 0;
|
||||
status->rate_idx = 0;
|
||||
@ -69,7 +69,7 @@
|
||||
status->flag |= RX_FLAG_NO_SIGNAL_VAL;
|
||||
|
||||
ath10k_htt_rx_h_signal(ar, status, rxd);
|
||||
@@ -942,7 +939,7 @@ static void ath10k_process_rx(struct ath
|
||||
@@ -959,7 +956,7 @@ static void ath10k_process_rx(struct ath
|
||||
*status = *rx_status;
|
||||
|
||||
ath10k_dbg(ar, ATH10K_DBG_DATA,
|
||||
@ -78,7 +78,7 @@
|
||||
skb,
|
||||
skb->len,
|
||||
ieee80211_get_SA(hdr),
|
||||
@@ -950,15 +947,15 @@ static void ath10k_process_rx(struct ath
|
||||
@@ -967,15 +964,15 @@ static void ath10k_process_rx(struct ath
|
||||
is_multicast_ether_addr(ieee80211_get_DA(hdr)) ?
|
||||
"mcast" : "ucast",
|
||||
(__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4,
|
||||
|
@ -0,0 +1,36 @@
|
||||
From c0cc00f250e19c717fc9cdbdb7f55aaa569c7498 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Thu, 24 Aug 2017 23:06:41 +0200
|
||||
Subject: [PATCH] ath10k: activate user space firmware loading again
|
||||
|
||||
In commit 9f5bcfe93315 ("ath10k: silence firmware file probing
|
||||
warnings") the firmware loading was changed from request_firmware() to
|
||||
request_firmware_direct() to silence some warnings in case it fails.
|
||||
request_firmware_direct() directly searches in the file system only and
|
||||
does not send a hotplug event to user space in case it could not find
|
||||
the firmware directly.
|
||||
In LEDE we use a user space script to extract the calibration data from
|
||||
the flash memory which gets triggered by the hotplug event. This way the
|
||||
firmware gets extracted from some vendor specific partition when the
|
||||
driver requests this firmware. This mechanism does not work any more
|
||||
after this change.
|
||||
|
||||
Fixes: 9f5bcfe93315 ("ath10k: silence firmware file probing warnings")
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Cc: Michal Kazior <michal.kazior@tieto.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
|
||||
---
|
||||
ath10k-4.13/core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/ath10k-4.13/core.c
|
||||
+++ b/ath10k-4.13/core.c
|
||||
@@ -556,7 +556,7 @@ static const struct firmware *ath10k_fet
|
||||
dir = ".";
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s", dir, file);
|
||||
- ret = request_firmware_direct(&fw, filename, ar->dev);
|
||||
+ ret = request_firmware(&fw, filename, ar->dev);
|
||||
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
|
||||
filename, ret);
|
||||
|
@ -10,14 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=4.14-rc2
|
||||
PKG_VERSION:=2017-10-06
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v$(PKG_VERSION)/
|
||||
PKG_BACKPORT_VERSION:=-1
|
||||
PKG_HASH:=8d1b62e0ea6cc2ffa7e6ae666da201360256e9b74ae651a31842d33625367524
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
||||
PKG_HASH:=194786b7635f36b9ce280fd2319f6a4feeff209175e330ddbcbe789a3b4540a5
|
||||
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)$(PKG_BACKPORT_VERSION)
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
@ -102,7 +101,7 @@ define KernelPackage/mac80211
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Linux 802.11 Wireless Networking Stack
|
||||
# +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-crypto-hash +kmod-crypto-cmac +hostapd-common
|
||||
DEPENDS+= +kmod-cfg80211 +hostapd-common
|
||||
KCONFIG:=\
|
||||
CONFIG_AVERAGE=y
|
||||
FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/kconf/conf.c
|
||||
+++ b/kconf/conf.c
|
||||
@@ -593,40 +593,12 @@ int main(int ac, char **av)
|
||||
@@ -594,40 +594,12 @@ int main(int ac, char **av)
|
||||
case oldconfig:
|
||||
case listnewconfig:
|
||||
case olddefconfig:
|
||||
@ -44,7 +44,7 @@
|
||||
break;
|
||||
--- a/kconf/confdata.c
|
||||
+++ b/kconf/confdata.c
|
||||
@@ -1169,6 +1169,8 @@ bool conf_set_all_new_symbols(enum conf_
|
||||
@@ -1170,6 +1170,8 @@ bool conf_set_all_new_symbols(enum conf_
|
||||
}
|
||||
bool has_changed = false;
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
for_all_symbols(i, sym) {
|
||||
if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID))
|
||||
continue;
|
||||
@@ -1212,8 +1214,6 @@ bool conf_set_all_new_symbols(enum conf_
|
||||
@@ -1213,8 +1215,6 @@ bool conf_set_all_new_symbols(enum conf_
|
||||
|
||||
}
|
||||
|
||||
|
@ -43,122 +43,118 @@
|
||||
- struct aead_request *aead_req;
|
||||
- int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
|
||||
- u8 *__aad;
|
||||
-
|
||||
+ int i;
|
||||
|
||||
- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC);
|
||||
- if (!aead_req)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- __aad = (u8 *)aead_req + reqsize;
|
||||
- memcpy(__aad, aad, CCM_AAD_LEN);
|
||||
-
|
||||
- sg_init_table(sg, 3);
|
||||
- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad));
|
||||
- sg_set_buf(&sg[1], data, data_len);
|
||||
- sg_set_buf(&sg[2], mic, mic_len);
|
||||
-
|
||||
- aead_request_set_tfm(aead_req, tfm);
|
||||
- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0);
|
||||
- aead_request_set_ad(aead_req, sg[0].length);
|
||||
+ int i;
|
||||
|
||||
- crypto_aead_encrypt(aead_req);
|
||||
- kzfree(aead_req);
|
||||
+ crypto_cipher_encrypt_one(tfm, b, b_0);
|
||||
|
||||
- return 0;
|
||||
- __aad = (u8 *)aead_req + reqsize;
|
||||
- memcpy(__aad, aad, CCM_AAD_LEN);
|
||||
+ /* Extra Authenticate-only data (always two AES blocks) */
|
||||
+ for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||
+ aad[i] ^= b[i];
|
||||
+ crypto_cipher_encrypt_one(tfm, b, aad);
|
||||
+
|
||||
|
||||
- sg_init_table(sg, 3);
|
||||
- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad));
|
||||
- sg_set_buf(&sg[1], data, data_len);
|
||||
- sg_set_buf(&sg[2], mic, mic_len);
|
||||
+ aad += AES_BLOCK_SIZE;
|
||||
+
|
||||
|
||||
- aead_request_set_tfm(aead_req, tfm);
|
||||
- aead_request_set_crypt(aead_req, sg, sg, data_len, b_0);
|
||||
- aead_request_set_ad(aead_req, sg[0].length);
|
||||
+ for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||
+ aad[i] ^= b[i];
|
||||
+ crypto_cipher_encrypt_one(tfm, a, aad);
|
||||
+
|
||||
|
||||
- crypto_aead_encrypt(aead_req);
|
||||
- kzfree(aead_req);
|
||||
+ /* Mask out bits from auth-only-b_0 */
|
||||
+ b_0[0] &= 0x07;
|
||||
+
|
||||
|
||||
- return 0;
|
||||
+ /* S_0 is used to encrypt T (= MIC) */
|
||||
+ b_0[14] = 0;
|
||||
+ b_0[15] = 0;
|
||||
+ crypto_cipher_encrypt_one(tfm, s_0, b_0);
|
||||
+}
|
||||
+
|
||||
}
|
||||
|
||||
-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
- u8 *data, size_t data_len, u8 *mic,
|
||||
- size_t mic_len)
|
||||
+
|
||||
+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic,
|
||||
+ size_t mic_len)
|
||||
+{
|
||||
+ int i, j, last_len, num_blocks;
|
||||
+ u8 b[AES_BLOCK_SIZE];
|
||||
+ u8 s_0[AES_BLOCK_SIZE];
|
||||
+ u8 e[AES_BLOCK_SIZE];
|
||||
+ u8 *pos, *cpos;
|
||||
+
|
||||
+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE);
|
||||
+ last_len = data_len % AES_BLOCK_SIZE;
|
||||
+ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b);
|
||||
+
|
||||
+ /* Process payload blocks */
|
||||
+ pos = data;
|
||||
+ cpos = data;
|
||||
+ for (j = 1; j <= num_blocks; j++) {
|
||||
+ int blen = (j == num_blocks && last_len) ?
|
||||
+ last_len : AES_BLOCK_SIZE;
|
||||
+
|
||||
+ /* Authentication followed by encryption */
|
||||
+ for (i = 0; i < blen; i++)
|
||||
+ b[i] ^= pos[i];
|
||||
+ crypto_cipher_encrypt_one(tfm, b, b);
|
||||
+
|
||||
+ b_0[14] = (j >> 8) & 0xff;
|
||||
+ b_0[15] = j & 0xff;
|
||||
+ crypto_cipher_encrypt_one(tfm, e, b_0);
|
||||
+ for (i = 0; i < blen; i++)
|
||||
+ *cpos++ = *pos++ ^ e[i];
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < mic_len; i++)
|
||||
+ mic[i] = b[i] ^ s_0[i];
|
||||
}
|
||||
|
||||
-int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
|
||||
+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
u8 *data, size_t data_len, u8 *mic,
|
||||
size_t mic_len)
|
||||
{
|
||||
- struct scatterlist sg[3];
|
||||
- struct aead_request *aead_req;
|
||||
- int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
|
||||
- u8 *__aad;
|
||||
- int err;
|
||||
-
|
||||
+ int i, j, last_len, num_blocks;
|
||||
+ u8 b[AES_BLOCK_SIZE];
|
||||
+ u8 s_0[AES_BLOCK_SIZE];
|
||||
+ u8 e[AES_BLOCK_SIZE];
|
||||
+ u8 *pos, *cpos;
|
||||
|
||||
- if (data_len == 0)
|
||||
- return -EINVAL;
|
||||
-
|
||||
+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE);
|
||||
+ last_len = data_len % AES_BLOCK_SIZE;
|
||||
+ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b);
|
||||
|
||||
- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC);
|
||||
- if (!aead_req)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
+ /* Process payload blocks */
|
||||
+ pos = data;
|
||||
+ cpos = data;
|
||||
+ for (j = 1; j <= num_blocks; j++) {
|
||||
+ int blen = (j == num_blocks && last_len) ?
|
||||
+ last_len : AES_BLOCK_SIZE;
|
||||
|
||||
- __aad = (u8 *)aead_req + reqsize;
|
||||
- memcpy(__aad, aad, CCM_AAD_LEN);
|
||||
-
|
||||
+ /* Authentication followed by encryption */
|
||||
+ for (i = 0; i < blen; i++)
|
||||
+ b[i] ^= pos[i];
|
||||
+ crypto_cipher_encrypt_one(tfm, b, b);
|
||||
|
||||
- sg_init_table(sg, 3);
|
||||
- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad));
|
||||
- sg_set_buf(&sg[1], data, data_len);
|
||||
- sg_set_buf(&sg[2], mic, mic_len);
|
||||
-
|
||||
+ b_0[14] = (j >> 8) & 0xff;
|
||||
+ b_0[15] = j & 0xff;
|
||||
+ crypto_cipher_encrypt_one(tfm, e, b_0);
|
||||
+ for (i = 0; i < blen; i++)
|
||||
+ *cpos++ = *pos++ ^ e[i];
|
||||
+ }
|
||||
|
||||
- aead_request_set_tfm(aead_req, tfm);
|
||||
- aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0);
|
||||
- aead_request_set_ad(aead_req, sg[0].length);
|
||||
+ for (i = 0; i < mic_len; i++)
|
||||
+ mic[i] = b[i] ^ s_0[i];
|
||||
+}
|
||||
|
||||
- err = crypto_aead_decrypt(aead_req);
|
||||
- kzfree(aead_req);
|
||||
+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
|
||||
+ u8 *data, size_t data_len, u8 *mic,
|
||||
+ size_t mic_len)
|
||||
+{
|
||||
+ int i, j, last_len, num_blocks;
|
||||
+ u8 *pos, *cpos;
|
||||
+ u8 a[AES_BLOCK_SIZE];
|
||||
+ u8 b[AES_BLOCK_SIZE];
|
||||
+ u8 s_0[AES_BLOCK_SIZE];
|
||||
+
|
||||
|
||||
- return err;
|
||||
+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE);
|
||||
+ last_len = data_len % AES_BLOCK_SIZE;
|
||||
+ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b);
|
||||
@ -185,11 +181,7 @@
|
||||
+ if ((mic[i] ^ s_0[i]) != a[i])
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
- err = crypto_aead_decrypt(aead_req);
|
||||
- kzfree(aead_req);
|
||||
-
|
||||
- return err;
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
@ -202,12 +194,12 @@
|
||||
{
|
||||
- struct crypto_aead *tfm;
|
||||
- int err;
|
||||
+ struct crypto_cipher *tfm;
|
||||
|
||||
-
|
||||
- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC);
|
||||
- if (IS_ERR(tfm))
|
||||
- return tfm;
|
||||
-
|
||||
+ struct crypto_cipher *tfm;
|
||||
|
||||
- err = crypto_aead_setkey(tfm, key, key_len);
|
||||
- if (err)
|
||||
- goto free_aead;
|
||||
|
32
package/kernel/mac80211/patches/130-disable-fils.patch
Normal file
32
package/kernel/mac80211/patches/130-disable-fils.patch
Normal file
@ -0,0 +1,32 @@
|
||||
Disable FILS support, since it pulls in crypto hash support
|
||||
|
||||
--- a/net/mac80211/fils_aead.h
|
||||
+++ b/net/mac80211/fils_aead.h
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef FILS_AEAD_H
|
||||
#define FILS_AEAD_H
|
||||
|
||||
-#if LINUX_VERSION_IS_GEQ(4,3,0)
|
||||
+#if 0 /* LINUX_VERSION_IS_GEQ(4,3,0) */
|
||||
int fils_encrypt_assoc_req(struct sk_buff *skb,
|
||||
struct ieee80211_mgd_assoc_data *assoc_data);
|
||||
int fils_decrypt_assoc_resp(struct ieee80211_sub_if_data *sdata,
|
||||
--- a/net/mac80211/fils_aead.c
|
||||
+++ b/net/mac80211/fils_aead.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-#if LINUX_VERSION_IS_GEQ(4,3,0)
|
||||
+#if 0 /* LINUX_VERSION_IS_GEQ(4,3,0) */
|
||||
/*
|
||||
* FILS AEAD for (Re)Association Request/Response frames
|
||||
* Copyright 2016, Qualcomm Atheros, Inc.
|
||||
--- a/net/mac80211/main.c
|
||||
+++ b/net/mac80211/main.c
|
||||
@@ -550,7 +550,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
|
||||
NL80211_FEATURE_MAC_ON_CREATE |
|
||||
NL80211_FEATURE_USERSPACE_MPM |
|
||||
NL80211_FEATURE_FULL_AP_CLIENT_STATE;
|
||||
-#if LINUX_VERSION_IS_GEQ(4,3,0)
|
||||
+#if 0 /* LINUX_VERSION_IS_GEQ(4,3,0) */
|
||||
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_FILS_STA);
|
||||
#endif
|
||||
|
@ -0,0 +1,198 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 7 Oct 2017 09:37:28 +0200
|
||||
Subject: [PATCH] Revert "mac80211: aes-cmac: switch to shash CMAC
|
||||
driver"
|
||||
|
||||
This reverts commit 26717828b75dd5c46e97f7f4a9b937d038bb2852.
|
||||
Reduces mac80211 dependencies for LEDE
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/aes_cmac.c
|
||||
+++ b/net/mac80211/aes_cmac.c
|
||||
@@ -22,50 +22,126 @@
|
||||
#define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */
|
||||
#define AAD_LEN 20
|
||||
|
||||
-static const u8 zero[CMAC_TLEN_256];
|
||||
|
||||
-void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad,
|
||||
- const u8 *data, size_t data_len, u8 *mic)
|
||||
+void gf_mulx(u8 *pad)
|
||||
{
|
||||
- SHASH_DESC_ON_STACK(desc, tfm);
|
||||
- u8 out[AES_BLOCK_SIZE];
|
||||
+ int i, carry;
|
||||
|
||||
- desc->tfm = tfm;
|
||||
+ carry = pad[0] & 0x80;
|
||||
+ for (i = 0; i < AES_BLOCK_SIZE - 1; i++)
|
||||
+ pad[i] = (pad[i] << 1) | (pad[i + 1] >> 7);
|
||||
+ pad[AES_BLOCK_SIZE - 1] <<= 1;
|
||||
+ if (carry)
|
||||
+ pad[AES_BLOCK_SIZE - 1] ^= 0x87;
|
||||
+}
|
||||
|
||||
- crypto_shash_init(desc);
|
||||
- crypto_shash_update(desc, aad, AAD_LEN);
|
||||
- crypto_shash_update(desc, data, data_len - CMAC_TLEN);
|
||||
- crypto_shash_finup(desc, zero, CMAC_TLEN, out);
|
||||
+void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem,
|
||||
+ const u8 *addr[], const size_t *len, u8 *mac,
|
||||
+ size_t mac_len)
|
||||
+{
|
||||
+ u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE];
|
||||
+ const u8 *pos, *end;
|
||||
+ size_t i, e, left, total_len;
|
||||
|
||||
- memcpy(mic, out, CMAC_TLEN);
|
||||
+ memset(cbc, 0, AES_BLOCK_SIZE);
|
||||
+
|
||||
+ total_len = 0;
|
||||
+ for (e = 0; e < num_elem; e++)
|
||||
+ total_len += len[e];
|
||||
+ left = total_len;
|
||||
+
|
||||
+ e = 0;
|
||||
+ pos = addr[0];
|
||||
+ end = pos + len[0];
|
||||
+
|
||||
+ while (left >= AES_BLOCK_SIZE) {
|
||||
+ for (i = 0; i < AES_BLOCK_SIZE; i++) {
|
||||
+ cbc[i] ^= *pos++;
|
||||
+ if (pos >= end) {
|
||||
+ e++;
|
||||
+ pos = addr[e];
|
||||
+ end = pos + len[e];
|
||||
+ }
|
||||
+ }
|
||||
+ if (left > AES_BLOCK_SIZE)
|
||||
+ crypto_cipher_encrypt_one(tfm, cbc, cbc);
|
||||
+ left -= AES_BLOCK_SIZE;
|
||||
+ }
|
||||
+
|
||||
+ memset(pad, 0, AES_BLOCK_SIZE);
|
||||
+ crypto_cipher_encrypt_one(tfm, pad, pad);
|
||||
+ gf_mulx(pad);
|
||||
+
|
||||
+ if (left || total_len == 0) {
|
||||
+ for (i = 0; i < left; i++) {
|
||||
+ cbc[i] ^= *pos++;
|
||||
+ if (pos >= end) {
|
||||
+ e++;
|
||||
+ pos = addr[e];
|
||||
+ end = pos + len[e];
|
||||
+ }
|
||||
+ }
|
||||
+ cbc[left] ^= 0x80;
|
||||
+ gf_mulx(pad);
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||
+ pad[i] ^= cbc[i];
|
||||
+ crypto_cipher_encrypt_one(tfm, pad, pad);
|
||||
+ memcpy(mac, pad, mac_len);
|
||||
}
|
||||
|
||||
-void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad,
|
||||
+
|
||||
+void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad,
|
||||
+ const u8 *data, size_t data_len, u8 *mic)
|
||||
+{
|
||||
+ const u8 *addr[3];
|
||||
+ size_t len[3];
|
||||
+ u8 zero[CMAC_TLEN];
|
||||
+
|
||||
+ memset(zero, 0, CMAC_TLEN);
|
||||
+ addr[0] = aad;
|
||||
+ len[0] = AAD_LEN;
|
||||
+ addr[1] = data;
|
||||
+ len[1] = data_len - CMAC_TLEN;
|
||||
+ addr[2] = zero;
|
||||
+ len[2] = CMAC_TLEN;
|
||||
+
|
||||
+ aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN);
|
||||
+}
|
||||
+
|
||||
+void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad,
|
||||
const u8 *data, size_t data_len, u8 *mic)
|
||||
{
|
||||
- SHASH_DESC_ON_STACK(desc, tfm);
|
||||
+ const u8 *addr[3];
|
||||
+ size_t len[3];
|
||||
+ u8 zero[CMAC_TLEN_256];
|
||||
|
||||
- desc->tfm = tfm;
|
||||
+ memset(zero, 0, CMAC_TLEN_256);
|
||||
+ addr[0] = aad;
|
||||
+ len[0] = AAD_LEN;
|
||||
+ addr[1] = data;
|
||||
+ len[1] = data_len - CMAC_TLEN_256;
|
||||
+ addr[2] = zero;
|
||||
+ len[2] = CMAC_TLEN_256;
|
||||
|
||||
- crypto_shash_init(desc);
|
||||
- crypto_shash_update(desc, aad, AAD_LEN);
|
||||
- crypto_shash_update(desc, data, data_len - CMAC_TLEN_256);
|
||||
- crypto_shash_finup(desc, zero, CMAC_TLEN_256, mic);
|
||||
+ aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256);
|
||||
}
|
||||
|
||||
-struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[],
|
||||
- size_t key_len)
|
||||
+struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[],
|
||||
+ size_t key_len)
|
||||
{
|
||||
- struct crypto_shash *tfm;
|
||||
+ struct crypto_cipher *tfm;
|
||||
|
||||
- tfm = crypto_alloc_shash("cmac(aes)", 0, 0);
|
||||
+ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
|
||||
if (!IS_ERR(tfm))
|
||||
- crypto_shash_setkey(tfm, key, key_len);
|
||||
+ crypto_cipher_setkey(tfm, key, key_len);
|
||||
|
||||
return tfm;
|
||||
}
|
||||
|
||||
-void ieee80211_aes_cmac_key_free(struct crypto_shash *tfm)
|
||||
+
|
||||
+void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm)
|
||||
{
|
||||
- crypto_free_shash(tfm);
|
||||
+ crypto_free_cipher(tfm);
|
||||
}
|
||||
--- a/net/mac80211/aes_cmac.h
|
||||
+++ b/net/mac80211/aes_cmac.h
|
||||
@@ -10,14 +10,13 @@
|
||||
#define AES_CMAC_H
|
||||
|
||||
#include <linux/crypto.h>
|
||||
-#include <crypto/hash.h>
|
||||
|
||||
-struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[],
|
||||
- size_t key_len);
|
||||
-void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad,
|
||||
+struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[],
|
||||
+ size_t key_len);
|
||||
+void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad,
|
||||
const u8 *data, size_t data_len, u8 *mic);
|
||||
-void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad,
|
||||
+void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad,
|
||||
const u8 *data, size_t data_len, u8 *mic);
|
||||
-void ieee80211_aes_cmac_key_free(struct crypto_shash *tfm);
|
||||
+void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm);
|
||||
|
||||
#endif /* AES_CMAC_H */
|
||||
--- a/net/mac80211/key.h
|
||||
+++ b/net/mac80211/key.h
|
||||
@@ -93,7 +93,7 @@ struct ieee80211_key {
|
||||
} ccmp;
|
||||
struct {
|
||||
u8 rx_pn[IEEE80211_CMAC_PN_LEN];
|
||||
- struct crypto_shash *tfm;
|
||||
+ struct crypto_cipher *tfm;
|
||||
u32 replays; /* dot11RSNAStatsCMACReplays */
|
||||
u32 icverrors; /* dot11RSNAStatsCMACICVErrors */
|
||||
} aes_cmac;
|
@ -0,0 +1,10 @@
|
||||
--- a/net/mac80211/Kconfig
|
||||
+++ b/net/mac80211/Kconfig
|
||||
@@ -5,7 +5,6 @@ config MAC80211
|
||||
depends on CRYPTO
|
||||
depends on CRYPTO_ARC4
|
||||
depends on CRYPTO_AES
|
||||
- depends on CRYPTO_CMAC
|
||||
depends on CRC32
|
||||
---help---
|
||||
This option enables the hardware independent IEEE 802.11
|
@ -29,21 +29,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
- npend = ath9k_hw_numtxpending(ah, i);
|
||||
- if (npend)
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (ah->external_reset &&
|
||||
- (npend || type == ATH9K_RESET_COLD)) {
|
||||
- int reset_err = 0;
|
||||
-
|
||||
- ath_dbg(ath9k_hw_common(ah), RESET,
|
||||
- "reset MAC via external reset\n");
|
||||
-
|
||||
- reset_err = ah->external_reset();
|
||||
- if (reset_err) {
|
||||
- ath_err(ath9k_hw_common(ah),
|
||||
- "External reset failed, err=%d\n",
|
||||
- reset_err);
|
||||
- return false;
|
||||
+ if (type == ATH9K_RESET_COLD)
|
||||
+ return true;
|
||||
+
|
||||
@ -59,35 +44,47 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+ for (i = 0; i < AR_NUM_QCU; i++) {
|
||||
+ if (ath9k_hw_numtxpending(ah, i))
|
||||
+ return true;
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
}
|
||||
|
||||
- if (ah->external_reset &&
|
||||
- (npend || type == ATH9K_RESET_COLD)) {
|
||||
- int reset_err = 0;
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
|
||||
- ath_dbg(ath9k_hw_common(ah), RESET,
|
||||
- "reset MAC via external reset\n");
|
||||
+static bool ath9k_hw_external_reset(struct ath_hw *ah, int type)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
|
||||
- reset_err = ah->external_reset();
|
||||
- if (reset_err) {
|
||||
- ath_err(ath9k_hw_common(ah),
|
||||
- "External reset failed, err=%d\n",
|
||||
- reset_err);
|
||||
- return false;
|
||||
- }
|
||||
+ if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type))
|
||||
+ return true;
|
||||
+
|
||||
+ ath_dbg(ath9k_hw_common(ah), RESET,
|
||||
+ "reset MAC via external reset\n");
|
||||
|
||||
- REG_WRITE(ah, AR_RTC_RESET, 1);
|
||||
+ ath_dbg(ath9k_hw_common(ah), RESET,
|
||||
+ "reset MAC via external reset\n");
|
||||
+
|
||||
+ err = ah->external_reset();
|
||||
+ if (err) {
|
||||
+ ath_err(ath9k_hw_common(ah),
|
||||
+ "External reset failed, err=%d\n", err);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ if (AR_SREV_9550(ah)) {
|
||||
+ REG_WRITE(ah, AR_RTC_RESET, 0);
|
||||
+ udelay(10);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
+ REG_WRITE(ah, AR_RTC_RESET, 1);
|
||||
+ udelay(10);
|
||||
+
|
||||
|
@ -1,6 +1,7 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 19 Jul 2017 08:49:31 +0200
|
||||
Subject: [PATCH] ath9k: adjust tx power reduction for US regulatory domain
|
||||
Subject: [PATCH] ath9k: adjust tx power reduction for US regulatory
|
||||
domain
|
||||
|
||||
FCC regulatory rules allow for up to 3 dBi antenna gain. Account for
|
||||
this in the EEPROM based tx power reduction code.
|
@ -1,6 +1,7 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sun, 23 Jul 2017 14:58:22 +0200
|
||||
Subject: [PATCH] ath9k: fix more-data flag for buffered multicast packets
|
||||
Subject: [PATCH] ath9k: fix more-data flag for buffered multicast
|
||||
packets
|
||||
|
||||
The flag needs to be cleared for the last packet in the list, not the
|
||||
first one. Fixes some issues with multicast packet loss for powersave
|
@ -1,7 +1,7 @@
|
||||
From 59f8c22bf1749c4a2b5947bfaebc677c259a1ad6 Mon Sep 17 00:00:00 2001
|
||||
From: dave taht <dave@taht.net>
|
||||
Date: Wed, 5 Oct 2016 20:09:15 -0700
|
||||
Subject: [PATCH 5/7] Revert "ath10k: disable wake_tx_queue for older devices"
|
||||
Subject: [PATCH] Revert "ath10k: disable wake_tx_queue for older
|
||||
devices"
|
||||
|
||||
This reverts commit 4ca1807815aa6801aaced7fdefa9edacc2521767
|
||||
in the hope that we've fixed all the performance problems now.
|
@ -36,9 +36,9 @@
|
||||
u8 ps_dtim_period;
|
||||
--- a/include/uapi/linux/nl80211.h
|
||||
+++ b/include/uapi/linux/nl80211.h
|
||||
@@ -2139,6 +2139,9 @@ enum nl80211_commands {
|
||||
* the driver or is not needed (because roaming used the Fast Transition
|
||||
* protocol).
|
||||
@@ -2149,6 +2149,9 @@ enum nl80211_commands {
|
||||
* @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT.
|
||||
* @NL80211_ATTR_PORT_AUTHORIZED: (reserved)
|
||||
*
|
||||
+ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
|
||||
+ * transmit power to stay within regulatory limits. u32, dBi.
|
||||
@ -46,7 +46,7 @@
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
@@ -2565,6 +2568,8 @@ enum nl80211_attrs {
|
||||
@@ -2575,6 +2578,8 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_PMKR0_NAME,
|
||||
NL80211_ATTR_PORT_AUTHORIZED,
|
||||
|
||||
@ -137,7 +137,7 @@
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -2378,6 +2379,20 @@ static int nl80211_set_wiphy(struct sk_b
|
||||
@@ -2395,6 +2396,20 @@ static int nl80211_set_wiphy(struct sk_b
|
||||
if (result)
|
||||
return result;
|
||||
}
|
||||
|
@ -103,7 +103,8 @@
|
||||
+ GFP_KERNEL);
|
||||
+ if (!led)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
|
||||
- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val);
|
||||
+ led->gpio = gpio = (struct gpio_led *) (led + 1);
|
||||
+ _name = (char *) (led->gpio + 1);
|
||||
+
|
||||
@ -116,8 +117,7 @@
|
||||
+ ret = ath_add_led(sc, led);
|
||||
+ if (unlikely(ret < 0))
|
||||
+ kfree(led);
|
||||
|
||||
- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val);
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
@ -125,11 +125,11 @@
|
||||
{
|
||||
- if (!sc->led_registered)
|
||||
- return;
|
||||
+ struct ath_led *led;
|
||||
|
||||
-
|
||||
- ath_led_brightness(&sc->led_cdev, LED_OFF);
|
||||
- led_classdev_unregister(&sc->led_cdev);
|
||||
-
|
||||
+ struct ath_led *led;
|
||||
|
||||
- ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin);
|
||||
+ while (!list_empty(&sc->leds)) {
|
||||
+ led = list_first_entry(&sc->leds, struct ath_led, list);
|
||||
|
@ -39,7 +39,7 @@ Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
|
||||
.adda_2t_path_on_a = 0x04db25a4,
|
||||
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
|
||||
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
|
||||
@@ -1655,6 +1655,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
|
||||
@@ -1658,6 +1658,7 @@ struct rtl8xxxu_fileops rtl8192eu_fops =
|
||||
.rx_desc_size = sizeof(struct rtl8xxxu_rxdesc24),
|
||||
.has_s0s1 = 0,
|
||||
.gen2_thermal_meter = 1,
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -2849,6 +2849,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
@@ -2838,6 +2838,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
* preference in cfg struct to apply this to
|
||||
* FW later while initializing the dongle
|
||||
*/
|
||||
|
@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2017-09-10
|
||||
PKG_SOURCE_VERSION:=d5e945e9b2ee8f52581c1a6978097cf30c39cfd9
|
||||
PKG_MIRROR_HASH:=276eb2eea7b5ae64424292c5d955a8543fd3e39a2125b8046a30a519be76f3c9
|
||||
PKG_SOURCE_DATE:=2017-10-12
|
||||
PKG_SOURCE_VERSION:=37654d704772512065cd28b007342758c2a0f14a
|
||||
PKG_MIRROR_HASH:=487ca40ed4e1ffe015dabc76c0a84782602d84f5b08c9c86cc6c892cb499623b
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
@ -1,86 +0,0 @@
|
||||
--- a/mt76x2_mac.c
|
||||
+++ b/mt76x2_mac.c
|
||||
@@ -46,7 +46,7 @@ mt76x2_mac_process_rate(struct ieee80211
|
||||
case MT_PHY_TYPE_CCK:
|
||||
if (idx >= 8) {
|
||||
idx -= 8;
|
||||
- status->flag |= RX_FLAG_SHORTPRE;
|
||||
+ status->enc_flags |= RX_ENC_FLAG_SHORTPRE;
|
||||
}
|
||||
|
||||
if (idx >= 4)
|
||||
@@ -55,16 +55,16 @@ mt76x2_mac_process_rate(struct ieee80211
|
||||
status->rate_idx = idx;
|
||||
return;
|
||||
case MT_PHY_TYPE_HT_GF:
|
||||
- status->flag |= RX_FLAG_HT_GF;
|
||||
+ status->enc_flags |= RX_ENC_FLAG_HT_GF;
|
||||
/* fall through */
|
||||
case MT_PHY_TYPE_HT:
|
||||
- status->flag |= RX_FLAG_HT;
|
||||
+ status->encoding = RX_ENC_HT;
|
||||
status->rate_idx = idx;
|
||||
break;
|
||||
case MT_PHY_TYPE_VHT:
|
||||
- status->flag |= RX_FLAG_VHT;
|
||||
+ status->encoding = RX_ENC_VHT;
|
||||
status->rate_idx = FIELD_GET(MT_RATE_INDEX_VHT_IDX, idx);
|
||||
- status->vht_nss = FIELD_GET(MT_RATE_INDEX_VHT_NSS, idx) + 1;
|
||||
+ status->nss = FIELD_GET(MT_RATE_INDEX_VHT_NSS, idx) + 1;
|
||||
break;
|
||||
default:
|
||||
WARN_ON(1);
|
||||
@@ -72,22 +72,22 @@ mt76x2_mac_process_rate(struct ieee80211
|
||||
}
|
||||
|
||||
if (rate & MT_RXWI_RATE_LDPC)
|
||||
- status->flag |= RX_FLAG_LDPC;
|
||||
+ status->enc_flags |= RX_ENC_FLAG_LDPC;
|
||||
|
||||
if (rate & MT_RXWI_RATE_SGI)
|
||||
- status->flag |= RX_FLAG_SHORT_GI;
|
||||
+ status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
|
||||
|
||||
if (rate & MT_RXWI_RATE_STBC)
|
||||
- status->flag |= 1 << RX_FLAG_STBC_SHIFT;
|
||||
+ status->enc_flags |= 1 << RX_ENC_FLAG_STBC_SHIFT;
|
||||
|
||||
switch (FIELD_GET(MT_RXWI_RATE_BW, rate)) {
|
||||
case MT_PHY_BW_20:
|
||||
break;
|
||||
case MT_PHY_BW_40:
|
||||
- status->flag |= RX_FLAG_40MHZ;
|
||||
+ status->bw = RATE_INFO_BW_40;
|
||||
break;
|
||||
case MT_PHY_BW_80:
|
||||
- status->vht_flag |= RX_VHT_FLAG_80MHZ;
|
||||
+ status->bw = RATE_INFO_BW_80;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
--- a/mt7603_mac.c
|
||||
+++ b/mt7603_mac.c
|
||||
@@ -411,19 +411,19 @@ mt7603_mac_fill_rx(struct mt7603_dev *de
|
||||
break;
|
||||
case MT_PHY_TYPE_HT_GF:
|
||||
case MT_PHY_TYPE_HT:
|
||||
- status->flag |= RX_FLAG_HT;
|
||||
+ status->encoding = RX_ENC_HT;
|
||||
break;
|
||||
case MT_PHY_TYPE_VHT:
|
||||
- status->flag |= RX_FLAG_VHT;
|
||||
+ status->encoding = RX_ENC_VHT;
|
||||
break;
|
||||
default:
|
||||
WARN_ON(1);
|
||||
}
|
||||
|
||||
if (rxdg0 & MT_RXV1_HT_SHORT_GI)
|
||||
- status->flag |= RX_FLAG_SHORT_GI;
|
||||
+ status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
|
||||
|
||||
- status->flag |= RX_FLAG_STBC_MASK *
|
||||
+ status->enc_flags |= RX_ENC_FLAG_STBC_MASK *
|
||||
FIELD_GET(MT_RXV1_HT_STBC, rxdg0);
|
||||
|
||||
status->rate_idx = i;
|
58
package/lean/he-6in4/Makefile
Normal file
58
package/lean/he-6in4/Makefile
Normal file
@ -0,0 +1,58 @@
|
||||
#
|
||||
# Copyright (C) 2015 OpenWrt-dist
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=he-6in4
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=ghostry <ghostry@ghostry.cn>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/he-6in4
|
||||
SECTION:=ipv6
|
||||
CATEGORY:=Gmod
|
||||
SUBMENU:=Network
|
||||
TITLE:=Dynamic Update he.net of ip
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+luci-proto-ipv6 +6in4 +curl
|
||||
endef
|
||||
|
||||
define Package/he-6in4/description
|
||||
Dynamic Update he.net of ip
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/he-6in4/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
chmod 755 /etc/hotplug.d/iface/60-6in4 >/dev/null 2>&1
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/he-6in4/install
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/root/etc/hotplug.d/iface/60-6in4 $(1)/etc/hotplug.d/iface/60-6in4
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,he-6in4))
|
12
package/lean/he-6in4/files/root/etc/hotplug.d/iface/60-6in4
Normal file
12
package/lean/he-6in4/files/root/etc/hotplug.d/iface/60-6in4
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
if [ "$ACTION" != "ifup" ]; then
|
||||
exit
|
||||
fi
|
||||
config_load network
|
||||
config_get tunnelid $INTERFACE tunnelid
|
||||
config_get username $INTERFACE username
|
||||
config_get password $INTERFACE password
|
||||
if [ "$tunnelid" != "" ]; then
|
||||
curl -k -u "$username":"$password" https://ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid
|
||||
fi
|
202
package/lean/luci-app-kcptun/LICENSE
Normal file
202
package/lean/luci-app-kcptun/LICENSE
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
64
package/lean/luci-app-kcptun/README.md
Normal file
64
package/lean/luci-app-kcptun/README.md
Normal file
@ -0,0 +1,64 @@
|
||||
# luci-app-kcptun
|
||||
|
||||
Luci support for kcptun
|
||||
|
||||
OpenWrt/LEDE 上的 Kcptun Luci 支持界面
|
||||
|
||||
[](https://github.com/kuoruan/luci-app-kcptun/releases/latest) [](https://github.com/kuoruan/luci-app-kcptun/releases/latest)
|
||||
|
||||
## 编译说明
|
||||
|
||||
由于目录结构原因,无法使用 OpenWrt/LEDE 的 SDK 直接编译。
|
||||
|
||||
需要下载 OpenWrt/LEDE 的完整源码 https://github.com/lede-project/source
|
||||
并将 luci-app-kcptun 放入 ```feeds/luci/applications/``` 目录下。
|
||||
|
||||
```
|
||||
cd openwrt
|
||||
git clone https://github.com/kuoruan/luci-app-kcptun.git feeds/luci/applications/luci-app-kcptun
|
||||
rm -rf tmp/
|
||||
|
||||
./scripts/feeds update luci
|
||||
./scripts/feeds install luci
|
||||
|
||||
make menuconfig
|
||||
make package/luci-app-kcptun/{clean,compile} V=s
|
||||
```
|
||||
|
||||
如果需要在 SDK 上编译,需要自行修改目录结构。参考:https://github.com/shadowsocks/luci-app-shadowsocks
|
||||
|
||||
## 安装说明
|
||||
|
||||
1. 到 [release](https://github.com/kuoruan/luci-app-kcptun/releases) 页面下载最新版 luci-app-kcptun 和 luci-i18n-kcptun-zh-cn (简体中文翻译文件)
|
||||
2. 将下载好的 ipk 文件上传到路由器任意目录下, 如 /tmp
|
||||
3. 先安装 luci-app-kcptun 再安装 luci-i18n-kcptun-zh-cn
|
||||
|
||||
```
|
||||
opkg install luci-app-kcptun_*.ipk
|
||||
opkg install luci-i18n-kcptun-zh-cn_*.ipk
|
||||
```
|
||||
|
||||
安装好 LuCI 之后,进入配置页面,会提示 ```客户端文件配置有误```。
|
||||
|
||||
若路由器上已经有 Kcptun 客户端,直接配置好路径即可,如果当前还没有客户端文件,可以使用以下操作:
|
||||
|
||||
1. 配置好 ```客户端文件``` 路径(可选,默认路径 ```/var/kcptun_client```),确保客户端文件所在目录的剩余空间足以放下两个客户端文件;
|
||||
2. 根据当前设备,配置好 ```CPU 架构```(可选);
|
||||
3. 如果你的路由器上装有透明代理软件,最好先打开;
|
||||
4. 点击 ```检查 Kcptun```,正常情况下应该会获取到 Kcptun 最新版本号;
|
||||
5. ```点击更新``` 按钮来自动下载配置客户端文件。
|
||||
|
||||
如果自动下载更新失败,请手动下载 Kcptun 客户端文件并上传到路由器上,然后配置好 ```客户端文件``` 路径。
|
||||
|
||||
下载地址: https://github.com/xtaci/kcptun/releases
|
||||
|
||||
注:Golang 的 MIPS/MIPSLE 版本暂时不支持 Soft Float,需要在编译 OpenWrt/LEDE 时打开 ```MIPS FPU Emulator```,其他版本不受影响。
|
||||
|
||||
## 卸载说明
|
||||
|
||||
卸载时需要先卸载 luci-i18n-kcptun-zh-cn, 再卸载 luci-app-kcptun
|
||||
|
||||
```
|
||||
opkg remove luci-i18n-kcptun-zh-cn
|
||||
opkg remove luci-app-kcptun
|
||||
```
|
16
package/lean/luci-theme-atmaterial/Makefile
Normal file
16
package/lean/luci-theme-atmaterial/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=Advanced Tomato Material
|
||||
LUCI_DEPENDS:=
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=3
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
File diff suppressed because it is too large
Load Diff
BIN
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/favicon.ico
Executable file
BIN
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/favicon.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by Fontastic.me</metadata>
|
||||
<defs>
|
||||
<font id="advancedtomato" horiz-adv-x="512">
|
||||
<font-face font-family="advancedtomato" units-per-em="512" ascent="480" descent="-32"/>
|
||||
<missing-glyph horiz-adv-x="512" />
|
||||
|
||||
<glyph unicode="" d="M317 169c9-9 9-17 0-25-9-8-17-8-24 0 0 0-99 100-99 100-8 8-8 16 0 25 0 0 99 100 99 100 7 9 15 9 24 0 9-8 9-16 0-25 0 0-80-88-80-88 0 0 80-87 80-87"/>
|
||||
<glyph unicode="" d="M195 169c0 0 81 87 81 87 0 0-81 88-81 88-9 9-9 17 0 25 9 9 17 9 24 0 0 0 99-100 99-100 8-9 8-17 0-25 0 0-99-100-99-100-7-8-15-8-24 0-9 8-9 16 0 25"/>
|
||||
<glyph unicode="" d="M169 195c-9-8-17-8-26 0-8 8-8 16 0 25 0 0 101 97 101 97 9 9 17 9 24 0 0 0 101-97 101-97 8-9 8-17 0-25-9-8-17-8-26 0 0 0-87 80-87 80 0 0-87-80-87-80"/>
|
||||
<glyph unicode="" d="M344 317c8 9 16 9 25 0 9-7 9-15 0-24 0 0-101-98-101-98-7-8-15-8-24 0 0 0-101 98-101 98-9 9-9 17 0 24 9 9 17 9 26 0 0 0 87-79 87-79 0 0 88 79 88 79"/>
|
||||
<glyph unicode="" d="M141 148c0 0 60 60 60 60 0 0 0-150 0-150 0 0-142 9-142 9 0 0 45 44 45 44-39 41-59 91-58 148 1 57 21 107 62 148 34 34 75 53 122 59 0 0 2-52 2-52-34-6-63-21-88-45-30-30-45-67-46-109 0-43 14-80 43-112m170 307c0 0 142-9 142-9 0 0-45-44-45-44 39-41 59-91 58-148-1-57-21-107-62-148-32-33-73-53-122-60 0 0-1 53-1 53 33 6 62 21 87 45 30 30 45 67 46 109 0 43-14 80-43 112 0 0-59-60-59-60 0 0-1 150-1 150"/>
|
||||
<glyph unicode="" d="M283 77c0 0 0 51 0 51 0 0 50 0 50 0 0 0 0-51 0-51 0-14-5-26-15-36-10-10-22-15-36-15 0 0-205 0-205 0-14 0-26 5-36 15-10 10-15 22-15 36 0 0 0 358 0 358 0 15 5 27 15 37 10 9 22 14 36 14 0 0 205 0 205 0 14 0 26-5 36-14 10-10 15-22 15-37 0 0 0-77 0-77 0 0-50 0-50 0 0 0 0 77 0 77 0 0-206 0-206 0 0 0 0-358 0-358 0 0 206 0 206 0m203 167c0 0-101-101-101-101 0 0 0 62 0 62 0 0-230 0-230 0 0 0 0 77 0 77 0 0 230 0 230 0 0 0 0 61 0 61 0 0 101-99 101-99"/>
|
||||
<glyph unicode="" d="M212 77c-11 0-21 5-28 14 0 0-92 121-92 121-6 8-8 17-6 27 1 9 5 17 13 23 7 6 16 9 26 7 10-1 18-6 24-14 0 0 60-79 60-79 0 0 152 243 152 243 5 8 13 13 22 15 9 2 18 1 27-4 8-5 13-13 15-22 3-9 1-18-4-27 0 0-179-287-179-287-7-11-16-16-28-16 0 0-2-1-2-1"/>
|
||||
<glyph unicode="" d="M372 410c25 0 38-11 38-33 0 0 0-241 0-241 0-22-13-34-38-34 0 0-231 0-231 0-26 0-39 12-39 34 0 0 0 241 0 241 0 12 3 21 10 25 6 5 16 8 29 8 0 0 231 0 231 0"/>
|
||||
<glyph unicode="" d="M377 269c5-3 7-8 7-13 0-5-2-9-7-12 0 0-219-136-219-136-8-6-15-7-21-4-6 4-9 11-9 21 0 0 0 263 0 263 0 10 3 17 9 21 6 3 13 2 21-3 0 0 219-137 219-137"/>
|
||||
<glyph unicode="" d="M79 336c-3-3-4-7-6-11-1-5-1-9-1-13 0-4 0-6-1-6-1-1-4-3-9-8-5-4-8-7-9-8-6-5-11-4-15 2 0 0-36 39-36 39-3 4-3 8 1 12 1 1 4 3 10 7 5 4 8 7 10 8 2 2 6 3 14 3 7 0 13 3 19 8 4 4 7 11 9 19 1 8 3 13 5 15 1 0 2 2 5 4 2 2 6 6 13 11 6 5 13 11 21 16 46 31 77 47 95 49 42 0 67 0 76-1 4 0 3-1-4-4-41-18-67-31-78-39-27-19-34-38-19-58 12-16 19-24 20-25 3-2 2-5-1-7-1-1-7-6-20-18-12-11-18-17-19-18-5-2-8-3-9-2-15 17-27 27-37 31-9 4-21 2-34-6m147-13c0 0 209-244 209-244 7-8 6-14-1-20 0 0-24-21-24-21-8-5-14-4-20 2 0 0-212 242-212 242-2 2-2 6 0 10 0 0 37 32 37 32 4 2 8 2 11-1m283 103c6-36 3-64-8-85-17-30-43-41-79-32-19 4-36-1-51-16 0 0-42-40-42-40 0 0-35 40-35 40 0 0 35 36 35 36 8 8 13 17 16 27 2 10 3 21 3 33 0 12 0 22 2 30 5 19 28 38 72 57 4 2 7 2 9-1 2-3 3-6 1-8-4-4-12-18-23-41-5-3-7-9-6-18 0-8 7-18 20-27 20-14 36-10 49 11 2 4 7 11 14 21 6 10 10 16 11 17 1 3 4 5 7 5 3-1 5-4 5-9m-439-350c0 0 130 127 130 127 0 0 39-44 39-44 0 0-126-124-126-124-7-7-13-8-20-2 0 0-23 23-23 23-8 6-8 13 0 20"/>
|
||||
<glyph unicode="" d="M478 232c9-15 11-31 7-49 0 0-17-94-17-94-1-7-4-13-10-18-6-5-13-8-20-8 0 0-365 0-365 0-7 0-13 3-19 8-6 5-10 11-10 18 0 0-18 94-18 94-3 18 0 34 7 49 0 0 81 192 81 192 8 16 20 23 37 23 0 0 209 0 209 0 17 0 30-7 38-23 0 0 80-192 80-192m-35-67c1 7-1 14-5 19-4 6-10 9-18 9 0 0-329 0-329 0-8 0-14-3-18-9-4-5-6-12-5-19 0 0 7-38 7-38 1-8 4-14 10-19 6-5 13-8 20-8 0 0 302 0 302 0 8 0 14 3 20 8 6 5 9 11 10 19 0 0 6 38 6 38"/>
|
||||
<glyph unicode="" d="M256 448c-106 0-192-86-192-192 0-106 86-192 192-192 106 0 192 86 192 192 0 106-86 192-192 192z m0-333c-78 0-141 63-141 141 0 34 12 66 33 90l198-198c-24-21-56-33-90-33z m108 51l-198 198c24 21 56 33 90 33 78 0 141-63 141-141 0-34-12-66-33-90z"/>
|
||||
<glyph unicode="" d="M256 502c68 0 126-24 174-72 48-49 72-106 72-174 0-68-24-126-72-174-48-48-106-72-174-72-68 0-125 24-174 72-48 48-72 106-72 174 0 68 24 125 72 174 49 48 106 72 174 72m210-246c0 45-13 86-40 122-27 37-61 62-103 77-7-9-9-14-9-17 2-13 5-21 10-26 4-4 9-5 15-3 0 0 16 6 16 6 0 0 4 0 11 1 7-8 7-16 0-24-8-8-16-18-23-29-8-11-8-24-1-39 12-22 28-33 49-33 10-1 17-7 22-19 5-11 8-22 9-33 3-28 1-52-7-72-8-15-5-28 7-39 29 38 44 81 44 128m-239 207c-38-5-72-19-102-43-29-24-51-54-65-89 2 0 6-1 12-1 5-1 10-1 14-2 4 0 9-1 13-2 5-1 9-2 13-4 3-2 5-4 6-7 1-4-1-11-7-23-7-11-10-21-10-31 0-10 7-20 20-29 13-8 19-16 19-23 0-10 2-21 4-35 3-14 4-21 4-22 0-5 7-14 19-28 12-14 21-22 27-22 3 0 5 4 5 12 1 7 0 16-1 27-1 11-1 18-1 21 0 11 2 23 7 38 4 14 14 26 30 36 16 9 25 17 28 23 6 12 7 22 5 31-3 10-6 17-9 22-3 6-9 11-17 15-9 4-16 7-21 8-6 2-12 4-19 5-7 1-11 2-12 2-5 2-12 3-21 4-9 0-15-1-18-2-4-1-9 1-14 6-6 5-9 10-9 15 0 3 3 8 8 13 5 6 11 12 18 19 6 7 11 12 14 16 3 4 6 8 9 10 3 3 6 6 11 9 4 3 9 6 14 10 1 2 5 5 13 9 7 5 11 8 13 12m-37-407c23-7 45-10 66-10 44 0 82 12 116 35-9 15-29 21-61 17-8 0-19-3-33-8-14-6-22-8-24-9-25-6-38-8-39-8-4-1-8-3-13-7-5-5-9-8-12-10"/>
|
||||
<glyph unicode="" d="M450 117c10-12 11-22 3-32 0 0-24-24-24-24-12-10-24-10-35 0 0 0-97 98-97 98-25-15-52-22-80-22-44 0-82 16-114 49-33 32-49 70-49 114 0 44 16 81 46 112 31 31 68 47 112 47 44 0 82-16 115-49 32-32 49-70 49-114 0-30-8-58-24-83 0 0 98-96 98-96m-348 183c0-30 12-57 35-80 23-23 50-35 80-35 30 0 56 11 77 33 22 21 33 47 33 78 0 30-12 56-35 79-23 23-50 35-80 35-30 0-56-11-77-33-22-21-33-47-33-77"/>
|
||||
<glyph unicode="" d="M425 249c0 0-98 0-98 0 0 0 0-179 0-179 0 0-142 0-142 0 0 0 0 179 0 179 0 0-98 0-98 0 0 0 169 194 169 194 0 0 169-194 169-194"/>
|
||||
<glyph unicode="" d="M425 264c0 0-169-194-169-194 0 0-169 194-169 194 0 0 98 0 98 0 0 0 0 179 0 179 0 0 142 0 142 0 0 0 0-179 0-179 0 0 98 0 98 0"/>
|
||||
<glyph unicode="" d="M302 206c-72 0-128-8-170-23-42-16-77-49-106-101 1 7 3 16 6 27 3 11 12 31 26 60 14 29 30 54 49 76 19 22 45 42 80 60 34 18 73 27 115 27 0 0 0 98 0 98 0 0 184-165 184-165 0 0-184-171-184-171 0 0 0 112 0 112"/>
|
||||
<glyph unicode="" d="M208 168c11 19 48 68 109 145 62 78 95 116 100 113 4-2-13-50-49-142-37-93-61-149-71-167-17-30-40-36-70-19-29 17-36 41-19 70m48 194c-57 0-106-21-145-65-40-43-60-96-60-159 0-10 1-18 1-23 1-8-1-14-6-19-5-5-10-8-17-9-7-1-13 1-19 6-5 5-8 11-9 18 0 2 0 7 0 13-1 6-1 11-1 14 0 77 25 143 74 196 50 53 110 80 182 80 25 0 47-3 69-10 0 0-36-44-36-44-14 2-25 2-33 2m185-31c47-53 71-117 71-193 0-13 0-22-1-28-1-7-3-13-8-17-5-5-11-7-18-7 0 0-2 0-2 0-7 1-13 5-18 10-4 6-6 12-5 19 0 4 1 12 1 23 0 51-14 97-41 137 2 5 5 14 10 27 5 12 9 22 11 29"/>
|
||||
<glyph unicode="" d="M376 255c40-13 60-36 60-70 0-34-21-68-65-101-43-32-97-48-160-48-55 0-103 13-146 40-43 26-64 60-64 100 0 44 25 92 75 143 31 32 63 54 95 67 32 12 55 12 69-2 12-12 14-32 5-59-2-5 0-8 4-8 0 0 8 1 8 1 25 12 48 18 69 18 20 0 34-6 43-18 8-12 7-29-1-51-2-6 0-10 8-12m-165-181c42 4 76 17 103 39 28 22 40 47 37 74-3 28-20 50-51 66-31 16-67 22-109 18-41-4-76-17-103-39-27-22-39-47-36-74 3-28 20-49 50-66 31-16 67-22 109-18m300 250c0 0 0-1 0-1 0-5-2-9-6-13-3-3-8-5-12-5-5 0-9 2-13 5-3 4-5 8-5 13 0 32-11 60-35 83-23 23-51 34-83 34-5 0-10 2-13 5-3 4-5 8-5 14 0 11 6 17 18 17 43 0 79-15 109-44 30-30 45-66 45-108m-72 2c2-5 1-10-2-14-2-5-6-7-11-8-12-1-19 4-22 14-2 13-8 25-18 34-10 10-21 16-34 19-11 2-16 9-13 20 3 12 10 17 21 15 20-5 37-14 52-29 14-14 23-32 27-51m-270-108c16 4 31 1 45-6 14-8 22-18 25-32 3-13 0-27-10-39-10-13-24-21-41-23-16-4-31-2-45 6-13 7-21 18-24 32-3 13 0 26 10 39 10 12 23 20 40 23"/>
|
||||
<glyph unicode="" d="M185 231l-133-133c-2-2-4-3-6-3-3 0-5 1-7 3l-14 14c-2 2-3 4-3 7 0 2 1 5 3 6l112 113-112 112c-2 2-3 4-3 7 0 2 1 4 3 6l14 14c2 2 4 3 7 3 2 0 4-1 6-3l133-133c2-2 3-4 3-6 0-3-1-5-3-7z m309-130l0-19c0-2-1-5-3-6-2-2-4-3-6-3l-275 0c-2 0-5 1-6 3-2 1-3 4-3 6l0 19c0 2 1 4 3 6 1 2 4 3 6 3l275 0c2 0 4-1 6-3 2-2 3-4 3-6z"/>
|
||||
<glyph unicode="" d="M389 282c10 0 15-9 15-26 0-17-5-26-15-26 0 0-266 0-266 0-10 0-15 9-15 26 0 17 5 26 15 26 0 0 266 0 266 0"/>
|
||||
<glyph unicode="" d="M256 474c0 0 133-125 133-125 0 0-84 0-84 0 0 0 0-131 0-131 0 0-97 0-97 0 0 0 0 131 0 131 0 0-85 0-85 0 0 0 133 125 133 125m239-296c7-3 11-9 14-16 3-8 4-15 2-21 0 0-14-79-14-79-2-6-6-12-12-16-6-5-13-7-20-7 0 0-418 0-418 0-8 0-14 2-21 7-6 4-9 10-11 16 0 0-14 79-14 79-4 17 2 29 16 37 0 0 81 55 81 55 0 0 50 0 50 0 0 0-87-66-87-66 0 0 91 0 91 0 3 0 5-1 7-4 0 0 20-57 20-57 0 0 154 0 154 0 0 0 20 57 20 57 3 3 5 4 6 4 0 0 91 0 91 0 0 0-87 66-87 66 0 0 51 0 51 0 0 0 81-55 81-55"/>
|
||||
<glyph unicode="" d="M495 178c7-3 11-9 14-16 3-8 4-15 2-21 0 0-14-79-14-79-2-6-6-12-12-16-6-5-13-7-20-7 0 0-418 0-418 0-8 0-14 2-21 7-6 4-9 10-11 16 0 0-14 79-14 79-4 17 2 29 16 37 0 0 81 55 81 55 0 0 50 0 50 0 0 0-87-66-87-66 0 0 91 0 91 0 3 0 5-1 7-4 0 0 20-57 20-57 0 0 154 0 154 0 0 0 20 57 20 57 3 3 5 4 6 4 0 0 91 0 91 0 0 0-87 66-87 66 0 0 51 0 51 0 0 0 81-55 81-55m-106 165c0 0-133-125-133-125 0 0-133 125-133 125 0 0 85 0 85 0 0 0 0 131 0 131 0 0 97 0 97 0 0 0 0-131 0-131 0 0 84 0 84 0"/>
|
||||
<glyph unicode="" d="M213 331c44 0 79-33 85-75l75 0c-1 10-3 20-5 29l61 35-43 74-61-35c-19 19-42 33-69 40l0 70-85 0 0-70c-27-7-51-21-70-40l-60 35-43-74 61-35c-4-12-6-26-6-40 0-13 2-27 6-40l-61-35 43-74 60 35c19-18 43-32 70-40l0-70 85 0 0 151c-13-7-27-12-43-12-47 0-85 38-85 85 0 47 38 86 85 86z m278-203c0 8-2 15-4 23l40 23-22 36-39-22c-11 11-24 18-39 22l0 46-43 0 0-46c-15-4-29-11-40-22l-39 22-21-36 39-23c-2-8-3-15-3-23 0-8 1-15 3-23l-39-23 21-36 39 22c11-11 25-18 40-22l0-46 43 0 0 46c15 4 28 11 39 22l40-22 21 36-40 23c2 8 4 15 4 23z m-86-43c-23 0-42 19-42 43 0 24 19 43 42 43 24 0 43-19 43-43 0-24-19-43-43-43z"/>
|
||||
<glyph unicode="" d="M318 512c17 0 29-5 38-14 9-9 14-21 14-35 0-17-7-32-20-45-14-13-30-20-49-20-16 0-29 5-38 14-9 9-13 21-12 37 0 15 6 30 18 43 12 13 28 20 49 20m-105-512c-34 0-43 30-28 91 0 0 31 130 31 130 5 19 5 29 0 29-4 0-13-3-28-9-14-7-26-13-36-20 0 0-14 23-14 23 31 26 63 48 97 64 34 17 60 25 77 25 27 0 33-28 19-83 0 0-36-136-36-136-6-22-5-33 3-33 15 0 35 10 60 31 0 0 16-21 16-21-29-29-59-52-90-67-31-16-55-24-71-24"/>
|
||||
<glyph unicode="" d="M457 302l0-55c0-8-3-14-8-20-5-5-12-8-19-8l-119 0 0-118c0-8-3-15-8-20-5-5-12-8-20-8l-54 0c-8 0-15 3-20 8-5 5-8 12-8 20l0 118-119 0c-7 0-14 3-19 8-5 6-8 12-8 20l0 55c0 7 3 14 8 19 5 5 12 8 19 8l119 0 0 119c0 8 3 14 8 19 5 6 12 8 20 8l54 0c8 0 15-2 20-8 5-5 8-11 8-19l0-119 119 0c7 0 14-3 19-8 5-5 8-12 8-19z"/>
|
||||
<glyph unicode="" d="M256 512c-141 0-256-115-256-256 0-141 115-256 256-256 141 0 256 115 256 256 0 141-115 256-256 256z m0-469c-118 0-213 95-213 213 0 118 95 213 213 213 118 0 213-95 213-213 0-118-95-213-213-213z m95 360c-11 5-23 1-29-9l-72-145-43 43c-8 9-22 9-30 0-8-8-8-21 0-30l64-64c4-4 9-6 15-6 1 0 2 0 3 0 7 1 13 6 16 12l85 170c6 11 1 24-9 29z m-116-296l42 0 0-22-42 0z m0 341l42 0 0-21-42 0z m-171-171l43 0 0-21-43 0z m341 0l43 0 0-21-43 0z"/>
|
||||
<glyph unicode="" d="M55 37l82 0 0 82-82 0z m100 0l92 0 0 82-92 0z m-100 100l82 0 0 92-82 0z m100 0l92 0 0 92-92 0z m-100 110l82 0 0 82-82 0z m210-210l92 0 0 82-92 0z m-110 210l92 0 0 82-92 0z m220-210l82 0 0 82-82 0z m-110 100l92 0 0 92-92 0z m-100 247l0 82c0 3-1 5-3 7-2 2-4 2-7 2l-18 0c-2 0-4 0-6-2-2-2-3-4-3-7l0-82c0-2 1-5 3-6 2-2 4-3 6-3l18 0c3 0 5 1 7 3 2 1 3 4 3 6z m210-247l82 0 0 92-82 0z m-110 110l92 0 0 82-92 0z m110 0l82 0 0 82-82 0z m9 137l0 82c0 3-1 5-3 7-2 2-4 2-6 2l-18 0c-3 0-5 0-7-2-2-2-3-4-3-7l0-82c0-2 1-5 3-6 2-2 4-3 7-3l18 0c2 0 4 1 6 3 2 1 3 4 3 6z m110 18l0-365c0-10-4-19-11-26-7-7-16-11-26-11l-402 0c-10 0-19 4-26 11-7 7-11 16-11 26l0 365c0 10 4 19 11 26 7 7 16 11 26 11l36 0 0 27c0 13 5 24 14 33 9 9 20 13 32 13l18 0c13 0 24-4 33-13 9-9 13-20 13-33l0-27 110 0 0 27c0 13 4 24 13 33 9 9 20 13 33 13l18 0c12 0 23-4 32-13 9-9 14-20 14-33l0-27 36 0c10 0 19-4 26-11 7-7 11-16 11-26z"/>
|
||||
<glyph unicode="" d="M55 37l402 0 0 292-402 0z m110 347l0 82c0 3-1 5-3 7-2 2-4 2-7 2l-18 0c-3 0-5 0-6-2-2-2-3-4-3-7l0-82c0-3 1-5 3-7 1-1 3-2 6-2l18 0c3 0 5 1 7 2 2 2 3 4 3 7z m219 0l0 82c0 3-1 5-3 7-1 2-3 2-6 2l-18 0c-3 0-5 0-7-2-2-2-3-4-3-7l0-82c0-3 1-5 3-7 2-1 4-2 7-2l18 0c3 0 5 1 6 2 2 2 3 4 3 7z m110 18l0-365c0-10-4-19-11-26-7-7-16-11-26-11l-402 0c-10 0-19 4-26 11-7 7-11 16-11 26l0 365c0 10 4 19 11 26 7 7 16 11 26 11l36 0 0 27c0 13 5 24 14 33 9 9 20 13 32 13l18 0c13 0 24-4 33-13 9-9 13-20 13-33l0-27 110 0 0 27c0 13 4 24 13 33 9 9 20 13 33 13l18 0c12 0 23-4 32-13 9-9 14-20 14-33l0-27 36 0c10 0 19-4 26-11 7-7 11-16 11-26z"/>
|
||||
<glyph unicode="" d="M407 461l27 0 0 51-370 0 0-51 32 0c4-96 39-159 101-180l0-53c-61-21-96-83-101-177l-32 0 0-51 370 0 0 51-27 0c-5 94-40 156-101 177l0 53c62 21 97 84 101 180m-116-255c67-17 87-90 91-155l-26 0-45 52-57 68-58-68-45-52-29 0c3 65 23 138 90 155l10 2 0 93-10 2c-69 17-88 92-91 158l261 0c-3-66-22-141-91-158l-10-2 0-93z m17 151l-105 0 26-31 27-30 26 30z"/>
|
||||
<glyph unicode="" d="M399 395c0-15-8-31-24-49-17-18-33-35-50-51-17-16-25-29-25-39 0-10 8-23 25-39 17-16 33-32 50-50 16-17 24-34 24-49 0 0 0-61 0-61 0-11-14-24-44-37-29-13-62-20-99-20-37 0-70 7-99 20-30 13-44 26-44 37 0 0 0 61 0 61 0 15 8 32 24 49 17 18 33 34 50 50 17 16 25 29 25 39 0 10-8 23-25 39-17 16-33 33-50 51-16 18-24 34-24 49 0 0 0 61 0 61 0 11 14 23 44 36 30 13 63 20 99 20 36 0 69-7 99-20 30-13 44-25 44-36 0 0 0-61 0-61m-246 58c0 0-10-8-10-8-1-2 0-5 2-7 32-17 69-26 111-26 45 0 83 8 113 25 4 4 2 9-9 16-32 18-67 27-103 27-41 0-76-9-104-27m116-197c0 6 1 12 2 17 2 5 5 11 10 17 4 6 8 10 10 13 2 2 7 7 16 15 8 9 13 13 15 15 31 31 47 52 47 62 0 0 1 26 1 26-34-19-72-28-114-28-42 0-80 9-114 28 0 0 2-26 2-26 0-11 16-31 46-62 3-2 6-6 12-11 5-5 9-9 12-11 0 0 9-10 9-10 0 0 3-4 9-11 6-7 8-10 6-10-2 0-1-4 4-12 5-8 6-12 2-12 0-3 0-7-1-10 0-3-1-6-3-9-2-3-3-6-4-8-1-3-3-5-6-9 0 0-6-8-6-8 0 0-2-2-7-8-6-5-8-8-9-7 0 0-3-3-9-9-6-5-9-8-9-8-30-30-46-51-46-62 0 0 0-34 0-34 3 1 14 5 34 12 20 6 36 14 47 22 12 8 18 18 18 29 0 11 4 16 13 16 9 0 13-5 13-16 0-11 6-21 17-29 11-8 28-16 48-22 21-7 33-11 35-12 0 0 0 34 0 34 0 10-16 31-47 62-2 2-5 5-11 10-6 6-10 10-11 11-2 2-5 5-10 10-4 5-7 8-9 11-2 3-4 6-6 10-2 5-4 8-5 12 0 4-1 8-1 12"/>
|
||||
<glyph unicode="" d="M256 458l0 1-172-100 0 0 0-118 0 0c2-97 77-178 172-188 96 10 170 91 172 188l0 118 0 0z m0-353l0 142-121 0 0 82 121 70 0-152 121 0 0-6 0 0c-2-69-54-127-121-136z"/>
|
||||
<glyph unicode="" d="M428 318l-167 129c-4 4-11 4-16 0l-161-129c-3-2-5-6-5-10l0-233c0-7 6-13 13-13l96 0c7 0 13 6 13 13l0 143 110 0 0-143c0-7 6-13 13-13l96 0c7 0 13 6 13 13l0 233c0 4-2 8-5 10z"/>
|
||||
<glyph unicode="" d="M442 392l-20-20-19-19-25-24c-13-1-26 4-36 13-9 10-14 23-13 36l63 64c1 1 1 3 0 4 0 1 0 1-1 1l0 0c0 0 0 0 0 0 0 0 0 0 0 0-14 6-29 10-45 10-61 0-111-50-111-111 0-12 2-23 6-33l-116-116c-39-1-70-32-70-71 0-39 32-71 71-71 39 0 70 31 71 70l116 116c10-4 21-6 33-6 61 0 111 50 111 111 0 16-4 31-10 45 0 0 0 0 0 0 0 0 0 1 0 1l0 0c0 0-1 0-1 0-1 1-3 1-4 0z m-286-266c0-16-14-29-30-29-16 0-29 13-29 29 0 16 13 30 29 30 16 0 30-14 30-30z"/>
|
||||
<glyph unicode="" d="M256 369c-20 0-34-12-34-31 0-18 14-30 34-30 21 0 34 12 34 30 0 19-13 31-34 31z m-32-81l64 0 0-145-64 0z m32 196c-126 0-228-102-228-228 0-126 102-228 228-228 126 0 228 102 228 228 0 126-102 228-228 228z m0-399c-94 0-171 77-171 171 0 94 77 171 171 171 94 0 171-77 171-171 0-94-77-171-171-171z"/>
|
||||
<glyph unicode="" d="M512 128l0-37c0-5-2-9-5-12-4-4-8-6-13-6l-476 0c-5 0-9 2-13 6-3 3-5 7-5 12l0 37c0 5 2 9 5 13 4 3 8 5 13 5l476 0c5 0 9-2 13-5 3-4 5-8 5-13z m-110 110l0-37c0-5-2-9-5-13-4-3-8-5-13-5l-366 0c-5 0-9 2-13 5-3 4-5 8-5 13l0 37c0 5 2 9 5 13 4 3 8 5 13 5l366 0c5 0 9-2 13-5 3-4 5-8 5-13z m73 109l0-36c0-5-1-9-5-13-4-4-8-5-13-5l-439 0c-5 0-9 1-13 5-3 4-5 8-5 13l0 36c0 5 2 10 5 13 4 4 8 6 13 6l439 0c5 0 9-2 13-6 4-3 5-8 5-13z m-109 110l0-36c0-5-2-10-6-13-3-4-8-6-13-6l-329 0c-5 0-9 2-13 6-3 3-5 8-5 13l0 36c0 5 2 9 5 13 4 4 8 5 13 5l329 0c5 0 10-1 13-5 4-4 6-8 6-13z"/>
|
||||
<glyph unicode="" d="M256 256c-18 0-32 14-32 32l0 160c0 18 14 32 32 32 18 0 32-14 32-32l0-160c0-18-14-32-32-32z m123 187c61-40 101-109 101-187 0-124-100-224-224-224-124 0-224 100-224 224 0 78 40 147 101 187 5 3 11 5 17 5 18 0 32-14 32-32 0-6-2-12-5-17-2-3-4-6-7-8-1-1-3-2-4-3-8-6-16-12-23-19-30-30-47-70-47-113 0-43 17-83 47-113 30-30 70-47 113-47 43 0 83 17 113 47 30 30 47 70 47 113 0 43-17 83-47 113-7 7-15 13-23 19-1 1-3 2-4 3-3 2-5 5-7 8-3 5-5 11-5 17 0 18 14 32 32 32 6 0 12-2 17-5z"/>
|
||||
<glyph unicode="" d="M444 125c3-3 4-6 4-10 0-4-1-7-4-10l-38-37c-3-3-5-4-9-4-4 0-7 1-10 4l-131 131-131-131c-3-3-5-4-9-4-4 0-7 1-10 4l-38 37c-3 3-4 6-4 10 0 4 1 7 4 10l132 131-132 130c-5 5-5 15 0 20l37 38c3 2 6 4 10 4 4 0 7-1 10-4l131-130 131 130c3 2 6 4 10 4 4 0 7-1 10-4l37-38c5-5 5-14 0-19l-132-130z"/>
|
||||
<glyph unicode="" d="M149 172l30-30c20 20 47 32 77 32 30 0 57-12 77-32l30 30c-27 28-65 45-107 45-42 0-80-17-107-45z m-69 69l30-30c38 37 89 60 146 60 57 0 108-23 146-60l30 30c-45 45-107 73-176 73-69 0-131-28-176-73z m176 170c-96 0-182-38-245-101l31-30c55 55 130 89 214 89 84 0 159-34 214-89l31 30c-63 63-149 101-245 101z m0-283c-18 0-32-14-32-32 0-18 14-32 32-32 18 0 32 14 32 32 0 18-14 32-32 32z"/>
|
||||
<glyph unicode="" d="M352 384l-96 0 0-320 96 0z m128-96l-96 0 0-224 96 0z m-448-256l0 64 32 0 0 32-32 0 0 64 32 0 0 32-32 0 0 64 32 0 0 32-32 0 0 64 32 0 0 32-32 0 0 64 32 0 0 32-64 0 0-512 512 0 0 32z m192 192l-96 0 0-160 96 0z"/>
|
||||
<glyph unicode="" d="M288 192l0-96 64 0-96-96-96 96 64 0 0 96z m-64 128l0 96-64 0 96 96 96-96-64 0 0-96z m-32-96l-96 0 0-64-96 96 96 96 0-64 96 0z m128 64l96 0 0 64 96-96-96-96 0 64-96 0z"/>
|
||||
<glyph unicode="" d="M431 389c0 0 4-2 4-2 13-7 23-18 31-32 7-13 10-29 10-49 0-44-19-80-56-107-36-28-89-41-157-41 0 0-15 0-15 0-6 0-11-2-17-6-5-5-9-9-10-15 0 0-18-80-18-80-4-14-13-21-27-21 0 0-54 0-54 0-6 0-11 2-15 6-3 5-4 10-3 15 0 0 3 13 3 13 0 0 35 0 35 0 6 0 11 2 17 6 5 5 8 10 10 15 0 0 18 80 18 80 4 14 13 20 27 20 0 0 15 0 15 0 67 0 119 14 157 41 37 28 56 64 56 108 0 19-4 35-11 49m-297-264c-1-6-4-10-9-15-6-4-11-7-17-7 0 0-55 0-55 0-6 0-11 3-14 7-3 5-4 9-2 15 0 0 77 331 77 331 3 13 12 20 26 20 0 0 115 0 115 0 26 0 48-1 64-4 19-4 36-10 48-17 13-9 23-19 30-32 7-13 10-29 10-49 0-45-18-80-56-108-36-27-88-41-156-41 0 0-16 0-16 0-5 0-11-2-16-6-6-4-9-9-10-14 0 0-19-80-19-80m45 191c-1-5 0-10 3-14 4-4 8-6 13-6 0 0 15 0 15 0 29 0 52 6 68 18 17 12 25 29 25 51 0 15-5 25-15 32-11 7-27 11-49 11 0 0-17 0-17 0-14 0-23-7-27-21 0 0-16-71-16-71"/>
|
||||
<glyph unicode="" d="M293 119l0 54c0 3-1 5-3 7-2 2-4 3-7 3l-54 0c-3 0-5-1-7-3-2-2-3-4-3-7l0-54c0-3 1-5 3-7 2-1 4-2 7-2l54 0c3 0 5 1 7 2 2 2 3 4 3 7z m-1 107l5 131c0 2-1 4-3 6-2 2-4 3-7 3l-62 0c-3 0-5-1-7-3-2-2-3-4-3-6l5-131c0-2 1-3 3-5 1-1 4-2 6-2l53 0c3 0 5 1 7 2 2 2 3 3 3 5z m-4 267l219-402c7-12 7-24 0-36-3-6-8-10-13-14-6-3-12-4-19-4l-438 0c-7 0-13 1-19 4-5 4-10 8-13 14-7 12-7 24 0 36l219 402c3 6 8 10 13 14 6 3 12 5 19 5 7 0 13-2 19-5 5-4 10-8 13-14z"/>
|
||||
</font></defs></svg>
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="icomoon" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="expand_less" d="M512 596.667l256-256-60-60-196 196-196-196-60 60z" />
|
||||
<glyph unicode="" glyph-name="expand_more" d="M708 572.667l60-60-256-256-256 256 60 60 196-196z" />
|
||||
<glyph unicode="" glyph-name="menu" d="M128 682.667h768v-86h-768v86zM128 384.667v84h768v-84h-768zM128 170.667v86h768v-86h-768z" />
|
||||
<glyph unicode="" glyph-name="favorite" d="M512 28.667l-62 56q-106 96-154 142t-107 114-81 123-22 113q0 98 67 166t167 68q116 0 192-90 76 90 192 90 100 0 167-68t67-166q0-78-52-162t-113-146-199-186z" />
|
||||
<glyph unicode="" glyph-name="spinner9" d="M512 960c-278.748 0-505.458-222.762-511.848-499.974 5.92 241.864 189.832 435.974 415.848 435.974 229.75 0 416-200.576 416-448 0-53.020 42.98-96 96-96s96 42.98 96 96c0 282.77-229.23 512-512 512zM512-64c278.748 0 505.458 222.762 511.848 499.974-5.92-241.864-189.832-435.974-415.848-435.974-229.75 0-416 200.576-416 448 0 53.020-42.98 96-96 96s-96-42.98-96-96c0-282.77 229.23-512 512-512z" />
|
||||
<glyph unicode="" glyph-name="question-circle" horiz-adv-x="878" d="M512 164.571v109.714q0 8-5.143 13.143t-13.143 5.143h-109.714q-8 0-13.143-5.143t-5.143-13.143v-109.714q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143zM658.286 548.571q0 50.286-31.714 93.143t-79.143 66.286-97.143 23.429q-138.857 0-212-121.714-8.571-13.714 4.571-24l75.429-57.143q4-3.429 10.857-3.429 9.143 0 14.286 6.857 30.286 38.857 49.143 52.571 19.429 13.714 49.143 13.714 27.429 0 48.857-14.857t21.429-33.714q0-21.714-11.429-34.857t-38.857-25.714q-36-16-66-49.429t-30-71.714v-20.571q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143q0 10.857 12.286 28.286t31.143 28.286q18.286 10.286 28 16.286t26.286 20 25.429 27.429 16 34.571 7.143 46.286zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
|
||||
</font></defs></svg>
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Binary file not shown.
6
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/js/jquery.min.js
vendored
Executable file
6
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/js/jquery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
236
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/js/script.js
Executable file
236
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/js/script.js
Executable file
@ -0,0 +1,236 @@
|
||||
/**
|
||||
* Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
|
||||
*
|
||||
* luci-theme-material
|
||||
* Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||
*
|
||||
* Have a bug? Please create an issue here on GitHub!
|
||||
* https://github.com/LuttyYang/luci-theme-material/issues
|
||||
*
|
||||
* luci-theme-bootstrap:
|
||||
* Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
* Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
* Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
*
|
||||
* MUI:
|
||||
* https://github.com/muicss/mui
|
||||
*
|
||||
* Licensed to the public under the Apache License 2.0
|
||||
*/
|
||||
(function ($) {
|
||||
$(".main > .loading").fadeOut();
|
||||
|
||||
/**
|
||||
* trim text, Remove spaces, wrap
|
||||
* @param text
|
||||
* @returns {string}
|
||||
*/
|
||||
function trimText(text) {
|
||||
return text.replace(/[ \t\n\r]+/g, " ");
|
||||
}
|
||||
|
||||
|
||||
var lastNode = undefined;
|
||||
var mainNodeName = undefined;
|
||||
|
||||
var nodeUrl = "";
|
||||
(function(node){
|
||||
if (node[0] == "admin"){
|
||||
luciLocation = [node[1], node[2]];
|
||||
}else{
|
||||
luciLocation = node;
|
||||
}
|
||||
|
||||
for(var i in luciLocation){
|
||||
nodeUrl += luciLocation[i];
|
||||
if (i != luciLocation.length - 1){
|
||||
nodeUrl += "/";
|
||||
}
|
||||
}
|
||||
})(luciLocation);
|
||||
|
||||
/**
|
||||
* get the current node by Burl (primary)
|
||||
* @returns {boolean} success?
|
||||
*/
|
||||
function getCurrentNodeByUrl() {
|
||||
var ret = false;
|
||||
if (!$('body').hasClass('logged-in')) {
|
||||
luciLocation = ["Main", "Login"];
|
||||
return true;
|
||||
}
|
||||
|
||||
$(".main > .main-left > .nav > .slide > .menu").each(function () {
|
||||
var ulNode = $(this);
|
||||
ulNode.next().find("a").each(function () {
|
||||
var that = $(this);
|
||||
var href = that.attr("href");
|
||||
|
||||
if (href.indexOf(nodeUrl) != -1) {
|
||||
ulNode.click();
|
||||
ulNode.next(".slide-menu").stop(true, true);
|
||||
lastNode = that.parent();
|
||||
lastNode.addClass("active");
|
||||
ret = true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* menu click
|
||||
*/
|
||||
$(".main > .main-left > .nav > .slide > .menu").click(function () {
|
||||
var ul = $(this).next(".slide-menu");
|
||||
var menu = $(this);
|
||||
if (!ul.is(":visible")) {
|
||||
menu.addClass("active");
|
||||
ul.addClass("active");
|
||||
ul.stop(true).slideDown("fast");
|
||||
} else {
|
||||
ul.stop(true).slideUp("fast", function () {
|
||||
menu.removeClass("active");
|
||||
ul.removeClass("active");
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* hook menu click and add the hash
|
||||
*/
|
||||
$(".main > .main-left > .nav > .slide > .slide-menu > li > a").click(function () {
|
||||
if (lastNode != undefined) lastNode.removeClass("active");
|
||||
$(this).parent().addClass("active");
|
||||
$(".main > .loading").fadeIn("fast");
|
||||
return true;
|
||||
});
|
||||
|
||||
/**
|
||||
* fix menu click
|
||||
*/
|
||||
$(".main > .main-left > .nav > .slide > .slide-menu > li").click(function () {
|
||||
if (lastNode != undefined) lastNode.removeClass("active");
|
||||
$(this).addClass("active");
|
||||
$(".main > .loading").fadeIn("fast");
|
||||
window.location = $($(this).find("a")[0]).attr("href");
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* get current node and open it
|
||||
*/
|
||||
if (getCurrentNodeByUrl()) {
|
||||
mainNodeName = "node-" + luciLocation[0] + "-" + luciLocation[1];
|
||||
mainNodeName = mainNodeName.replace(/[ \t\n\r\/]+/g, "_").toLowerCase();
|
||||
$("body").addClass(mainNodeName);
|
||||
}
|
||||
$(".cbi-button-up").val("");
|
||||
$(".cbi-button-down").val("");
|
||||
|
||||
|
||||
/**
|
||||
* hook other "A Label" and add hash to it.
|
||||
*/
|
||||
$("#maincontent > .container").find("a").each(function () {
|
||||
var that = $(this);
|
||||
var onclick = that.attr("onclick");
|
||||
if (onclick == undefined || onclick == "") {
|
||||
that.click(function () {
|
||||
var href = that.attr("href");
|
||||
if (href.indexOf("#") == -1) {
|
||||
$(".main > .loading").fadeIn("fast");
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Sidebar expand
|
||||
*/
|
||||
var showSide = false;
|
||||
$(".showSide").click(function () {
|
||||
if (showSide) {
|
||||
$(".darkMask").stop(true).fadeOut("fast");
|
||||
$(".main-left").stop(true).animate({
|
||||
width: "0"
|
||||
}, "fast");
|
||||
$(".main-right").css("overflow-y", "auto");
|
||||
showSide = false;
|
||||
} else {
|
||||
$(".darkMask").stop(true).fadeIn("fast");
|
||||
$(".main-left").stop(true).animate({
|
||||
width: "15rem"
|
||||
}, "fast");
|
||||
$(".main-right").css("overflow-y", "hidden");
|
||||
showSide = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".darkMask").click(function () {
|
||||
if (showSide) {
|
||||
showSide = false;
|
||||
$(".darkMask").stop(true).fadeOut("fast");
|
||||
$(".main-left").stop(true).animate({
|
||||
width: "0"
|
||||
}, "fast");
|
||||
$(".main-right").css("overflow-y", "auto");
|
||||
}
|
||||
});
|
||||
|
||||
$(window).resize(function () {
|
||||
if ($(window).width() > 921) {
|
||||
$(".main-left").css("width", "");
|
||||
$(".darkMask").stop(true);
|
||||
$(".darkMask").css("display", "none");
|
||||
showSide = false;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* fix legend position
|
||||
*/
|
||||
$("legend").each(function () {
|
||||
var that = $(this);
|
||||
that.after("<span class='panel-title'>" + that.text() + "</span>");
|
||||
});
|
||||
|
||||
$(".cbi-section-table-titles, .cbi-section-table-descr, .cbi-section-descr").each(function () {
|
||||
var that = $(this);
|
||||
if (that.text().trim() == ""){
|
||||
that.css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".main-right").focus();
|
||||
$(".main-right").blur();
|
||||
$("input").attr("size", "0");
|
||||
|
||||
if (mainNodeName != undefined) {
|
||||
console.log(mainNodeName);
|
||||
switch (mainNodeName) {
|
||||
case "node-status-system_log":
|
||||
case "node-status-kernel_log":
|
||||
$("#syslog").focus(function () {
|
||||
$("#syslog").blur();
|
||||
$(".main-right").focus();
|
||||
$(".main-right").blur();
|
||||
});
|
||||
break;
|
||||
case "node-status-firewall":
|
||||
var button = $(".node-status-firewall > .main fieldset li > a");
|
||||
button.addClass("cbi-button cbi-button-reset a-to-btn");
|
||||
break;
|
||||
case "node-system-reboot":
|
||||
var button = $(".node-system-reboot > .main > .main-right p > a");
|
||||
button.addClass("cbi-button cbi-input-reset a-to-btn");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
BIN
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/logo.png
Executable file
BIN
package/lean/luci-theme-atmaterial/htdocs/luci-static/atmaterial/logo.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
51
package/lean/luci-theme-atmaterial/luasrc/view/themes/atmaterial/footer.htm
Executable file
51
package/lean/luci-theme-atmaterial/luasrc/view/themes/atmaterial/footer.htm
Executable file
@ -0,0 +1,51 @@
|
||||
<%#
|
||||
Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
|
||||
|
||||
luci-theme-material
|
||||
Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||
|
||||
Have a bug? Please create an issue here on GitHub!
|
||||
https://github.com/LuttyYang/luci-theme-material/issues
|
||||
|
||||
luci-theme-bootstrap:
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
|
||||
MUI:
|
||||
https://github.com/muicss/mui
|
||||
|
||||
Licensed to the public under the Apache License 2.0
|
||||
-%>
|
||||
|
||||
<%
|
||||
local ver = require "luci.version"
|
||||
local disp = require "luci.dispatcher"
|
||||
local request = disp.context.path
|
||||
local category = request[1]
|
||||
local tree = disp.node()
|
||||
local categories = disp.node_childs(tree)
|
||||
%>
|
||||
</div>
|
||||
<footer class="mobile-hide">
|
||||
<a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> /
|
||||
<a href="https://openwrt.org/"><%= ver.distversion %></a>
|
||||
<% if #categories > 1 then %>
|
||||
<ul class="breadcrumb pull-right" id="modemenu">
|
||||
<% for i, r in ipairs(categories) do %>
|
||||
<li<% if request[1] == r then %> class="active"<%end%>><a href="<%=controller%>/<%=r%>/"><%=striptags(translate(tree.nodes[r].title))%></a> <span class="divider">|</span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// thanks for Jo-Philipp Wich <jow@openwrt.org>
|
||||
var luciLocation = <%= luci.http.write_json(luci.dispatcher.context.path) %>;
|
||||
</script>
|
||||
<script src="<%=media%>/js/jquery.min.js"></script>
|
||||
<script src="<%=media%>/js/script.js"></script>
|
||||
</body>
|
||||
</html>
|
238
package/lean/luci-theme-atmaterial/luasrc/view/themes/atmaterial/header.htm
Executable file
238
package/lean/luci-theme-atmaterial/luasrc/view/themes/atmaterial/header.htm
Executable file
@ -0,0 +1,238 @@
|
||||
<%#
|
||||
Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
|
||||
|
||||
luci-theme-material
|
||||
Copyright 2015 Lutty Yang <lutty@wcan.in>
|
||||
|
||||
Have a bug? Please create an issue here on GitHub!
|
||||
https://github.com/LuttyYang/luci-theme-material/issues
|
||||
|
||||
luci-theme-bootstrap:
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Copyright 2012 David Menting <david@nut-bolt.nl>
|
||||
|
||||
MUI:
|
||||
https://github.com/muicss/mui
|
||||
|
||||
Licensed to the public under the Apache License 2.0
|
||||
-%>
|
||||
|
||||
<%
|
||||
local ver = require "luci.version"
|
||||
local sys = require "luci.sys"
|
||||
local util = require "luci.util"
|
||||
local http = require "luci.http"
|
||||
local disp = require "luci.dispatcher"
|
||||
|
||||
local boardinfo = util.ubus("system", "board")
|
||||
|
||||
local request = disp.context.path
|
||||
local request2 = disp.context.request
|
||||
|
||||
local category = request[1]
|
||||
local cattree = category and disp.node(category)
|
||||
|
||||
local leaf = request2[#request2]
|
||||
|
||||
local tree = disp.node()
|
||||
local node = disp.context.dispatched
|
||||
|
||||
local categories = disp.node_childs(tree)
|
||||
|
||||
local c = tree
|
||||
local i, r
|
||||
|
||||
-- tag all nodes leading to this page
|
||||
for i, r in ipairs(request) do
|
||||
if c.nodes and c.nodes[r] then
|
||||
c = c.nodes[r]
|
||||
c._menu_selected = true
|
||||
end
|
||||
end
|
||||
|
||||
-- send as HTML5
|
||||
http.prepare_content("text/html")
|
||||
|
||||
local function nodeurl(prefix, name, query)
|
||||
local url = controller .. prefix .. name .. "/"
|
||||
if query then
|
||||
url = url .. http.build_querystring(query)
|
||||
end
|
||||
return pcdata(url)
|
||||
end
|
||||
|
||||
local function subtree(prefix, node, level)
|
||||
if not level then
|
||||
level = 1
|
||||
end
|
||||
|
||||
local childs = disp.node_childs(node)
|
||||
if #childs > 0 then
|
||||
|
||||
if level > 2 then
|
||||
%>
|
||||
<ul class="tabs">
|
||||
<%
|
||||
end
|
||||
|
||||
local selected_node
|
||||
local selected_name
|
||||
local i, v
|
||||
|
||||
for i, v in ipairs(childs) do
|
||||
local nnode = node.nodes[v]
|
||||
if nnode._menu_selected then
|
||||
selected_node = nnode
|
||||
selected_name = v
|
||||
end
|
||||
if level > 2 then
|
||||
%>
|
||||
<li class="tabmenu-item-<%=v%><%- if nnode._menu_selected or (node.leaf and v == leaf) then %> active<% end %>">
|
||||
<a href="<%=nodeurl(prefix, v, nnode.query)%>"><%=striptags(translate(nnode.title))%></a>
|
||||
</li>
|
||||
<% end
|
||||
end
|
||||
|
||||
if level > 2 then
|
||||
%>
|
||||
</ul>
|
||||
<% end
|
||||
|
||||
if selected_node then
|
||||
subtree(prefix .. selected_name .. "/", selected_node, level + 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
-%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%=luci.i18n.context.lang%>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
|
||||
<meta name="format-detection" content="telephone=no, email=no"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="x5-fullscreen" content="true">
|
||||
<meta name="full-screen" content="yes">
|
||||
<meta name="x5-page-mode" content="app">
|
||||
<meta name="browsermode" content="application">
|
||||
<meta name="theme-color" content="#0099CC">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
<meta name="msapplication-TileColor" content="#0099CC">
|
||||
|
||||
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
|
||||
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
|
||||
<meta name="msapplication-TileImage" content="<%=media%>/logo.png"/>
|
||||
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
|
||||
<link rel="apple-touch-icon-precomposed" href="<%=media%>/logo.png" sizes="144x144">
|
||||
|
||||
<link rel="stylesheet" href="<%=media%>/css/style.css">
|
||||
<link rel="shortcut icon" href="<%=media%>/favicon.ico">
|
||||
<% if node and node.css then %>
|
||||
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
|
||||
<% end -%>
|
||||
<% if css then %>
|
||||
<style title="text/css">
|
||||
<%-= css %>
|
||||
</style>
|
||||
<% end -%>
|
||||
<script src="<%=resource%>/xhr.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>">
|
||||
|
||||
<header>
|
||||
<div class="container">
|
||||
<span class="showSide"></span>
|
||||
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
|
||||
<div class="pull-right">
|
||||
<%
|
||||
-- calculate the number of unsaved changes
|
||||
if tree.nodes[category] and tree.nodes[category].ucidata then
|
||||
local ucichanges = 0
|
||||
for i, j in pairs(require("luci.model.uci").cursor():changes()) do
|
||||
for k, l in pairs(j) do
|
||||
for m, n in pairs(l) do
|
||||
ucichanges = ucichanges + 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<% if ucichanges > 0 then %>
|
||||
<a class="label notice" href="<%=controller%>/<%=category%>/uci/changes?redir=<%=http.urlencode(http.formvalue("redir") or REQUEST_URI)%>"><span class="mobile-hide"><%:Unsaved Changes%>: </span><%=ucichanges%></a>
|
||||
<% end %>
|
||||
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
|
||||
<span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%> </span><%:on%></span>
|
||||
<span class="label" id="xhr_poll_status_off" style="display:none"><span class="mobile-hide"><%:Auto Refresh%> </span><%:off%></span>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="main">
|
||||
<div style="" class="loading"><span><div class="loading-img"></div>Loading...</span></div>
|
||||
<div class="main-left">
|
||||
<ul class="nav">
|
||||
<%-
|
||||
local function submenu(prefix, node)
|
||||
local childs = disp.node_childs(node)
|
||||
if #childs > 0 then
|
||||
%>
|
||||
<ul class="slide-menu">
|
||||
<%-
|
||||
for i, r in ipairs(childs) do
|
||||
local nnode = node.nodes[r]
|
||||
local href = controller .. prefix .. r ..
|
||||
(nnode.query and http.build_querystring(nnode.query) or "")
|
||||
%>
|
||||
<li><a data-title="<%=pcdata(striptags(nnode.title))%>" href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a></li>
|
||||
<%-
|
||||
end
|
||||
%>
|
||||
</ul>
|
||||
<%-
|
||||
end
|
||||
end
|
||||
|
||||
childs = disp.node_childs(cattree)
|
||||
|
||||
if #childs > 0 then
|
||||
for i, r in ipairs(childs) do
|
||||
local nnode = cattree.nodes[r]
|
||||
local href = controller .. "/" .. category .. "/" .. r ..
|
||||
(nnode.query and http.build_querystring(k.query) or "")
|
||||
local grandchildren = disp.node_childs(nnode)
|
||||
|
||||
if #grandchildren > 0 then
|
||||
%>
|
||||
<li class="slide">
|
||||
<a class="menu" data-title="<%=pcdata(striptags(nnode.title))%>" href="#"><%=pcdata(striptags(translate(nnode.title)))%></a>
|
||||
<%- submenu("/" .. category .. "/" .. r .. "/", nnode) %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<a data-title="<%=pcdata(striptags(nnode.title))%>" href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a>
|
||||
</li>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="main-right">
|
||||
<div class="darkMask"></div>
|
||||
<div id="maincontent">
|
||||
<div class="container">
|
||||
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
|
||||
<div class="alert-message warning">
|
||||
<h4><%:No password set!%></h4>
|
||||
<%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%><br>
|
||||
<a href="<%=pcdata(luci.dispatcher.build_url("admin/system/admin"))%>"><%:Go to password configuration...%></a>
|
||||
</div>
|
||||
<%- end -%>
|
||||
<% if category then subtree("/" .. category .. "/", cattree) end %>
|
||||
|
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
uci batch <<-EOF
|
||||
set luci.themes.AdvancedTomatoMaterial=/luci-static/atmaterial
|
||||
set luci.main.mediaurlbase=/luci-static/atmaterial
|
||||
commit luci
|
||||
EOF
|
||||
exit 0
|
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmasq
|
||||
PKG_VERSION:=2.76
|
||||
PKG_RELEASE:=12
|
||||
PKG_VERSION:=2.78
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
|
||||
PKG_MD5SUM:=00f5ee66b4e4b7f14538bf62ae3c9461
|
||||
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
|
||||
PKG_HASH:=89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
@ -37,6 +37,7 @@ define Package/dnsmasq/Default
|
||||
CATEGORY:=Base system
|
||||
TITLE:=DNS and DHCP server
|
||||
URL:=http://www.thekelleys.org.uk/dnsmasq/
|
||||
DEPENDS:=+libubus
|
||||
USERID:=dnsmasq=453:dnsmasq=453
|
||||
endef
|
||||
|
||||
@ -48,14 +49,14 @@ endef
|
||||
define Package/dnsmasq-dhcpv6
|
||||
$(call Package/dnsmasq/Default)
|
||||
TITLE += (with DHCPv6 support)
|
||||
DEPENDS:=@IPV6
|
||||
DEPENDS+=@IPV6
|
||||
VARIANT:=dhcpv6
|
||||
endef
|
||||
|
||||
define Package/dnsmasq-full
|
||||
$(call Package/dnsmasq/Default)
|
||||
TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack, NO_ID enabled by default)
|
||||
DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \
|
||||
DEPENDS+=+PACKAGE_dnsmasq_full_dnssec:libnettle \
|
||||
+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \
|
||||
+PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack
|
||||
VARIANT:=full
|
||||
@ -137,7 +138,7 @@ endif
|
||||
|
||||
MAKE_FLAGS := \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
COPTS="$(COPTS)" \
|
||||
PREFIX="/usr"
|
||||
@ -150,8 +151,17 @@ define Package/dnsmasq/install
|
||||
$(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/neigh
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/tftp
|
||||
$(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec
|
||||
$(INSTALL_DIR) $(1)/usr/share/dnsmasq
|
||||
$(INSTALL_DATA) ./files/rfc6761.conf $(1)/usr/share/dnsmasq/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/dnsmasq
|
||||
$(INSTALL_BIN) ./files/dhcp-script.sh $(1)/usr/lib/dnsmasq/dhcp-script.sh
|
||||
$(INSTALL_DIR) $(1)/usr/share/acl.d
|
||||
$(INSTALL_DATA) ./files/dnsmasq_acl.json $(1)/usr/share/acl.d/
|
||||
endef
|
||||
|
||||
Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
|
||||
|
46
package/network/services/dnsmasq/files/dhcp-script.sh
Executable file
46
package/network/services/dnsmasq/files/dhcp-script.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f "$USER_DHCPSCRIPT" ] && . "$USER_DHCPSCRIPT" "$@"
|
||||
|
||||
case "$1" in
|
||||
add)
|
||||
export ACTION="add"
|
||||
export MACADDR="$2"
|
||||
export IPADDR="$3"
|
||||
export HOSTNAME="$4"
|
||||
exec /sbin/hotplug-call dhcp
|
||||
;;
|
||||
del)
|
||||
export ACTION="remove"
|
||||
export MACADDR="$2"
|
||||
export IPADDR="$3"
|
||||
export HOSTNAME="$4"
|
||||
exec /sbin/hotplug-call dhcp
|
||||
;;
|
||||
old)
|
||||
export ACTION="update"
|
||||
export MACADDR="$2"
|
||||
export IPADDR="$3"
|
||||
export HOSTNAME="$4"
|
||||
exec /sbin/hotplug-call dhcp
|
||||
;;
|
||||
arp-add)
|
||||
export ACTION="add"
|
||||
export MACADDR="$2"
|
||||
export IPADDR="$3"
|
||||
exec /sbin/hotplug-call neigh
|
||||
;;
|
||||
arp-del)
|
||||
export ACTION="remove"
|
||||
export MACADDR="$2"
|
||||
export IPADDR="$3"
|
||||
exec /sbin/hotplug-call neigh
|
||||
;;
|
||||
tftp)
|
||||
export ACTION="add"
|
||||
export TFTP_SIZE="$2"
|
||||
export TFTP_ADDR="$3"
|
||||
export TFTP_PATH="$4"
|
||||
exec /sbin/hotplug-call tftp
|
||||
;;
|
||||
esac
|
@ -15,7 +15,7 @@ config dnsmasq
|
||||
option leasefile '/tmp/dhcp.leases'
|
||||
option resolvfile '/tmp/resolv.conf.auto'
|
||||
#list server '/mycompany.local/1.2.3.4'
|
||||
#option nonwildcard 1
|
||||
option nonwildcard 1 # bind to & keep track of interfaces
|
||||
#list interface br-lan
|
||||
#list notinterface lo
|
||||
#list bogusnxdomain '64.94.110.11'
|
||||
|
@ -8,6 +8,8 @@ PROG=/usr/sbin/dnsmasq
|
||||
|
||||
ADD_LOCAL_DOMAIN=1
|
||||
ADD_LOCAL_HOSTNAME=1
|
||||
ADD_WAN_FQDN=0
|
||||
ADD_LOCAL_FQDN=""
|
||||
|
||||
BASECONFIGFILE="/var/etc/dnsmasq.conf"
|
||||
BASEHOSTFILE="/tmp/hosts/dhcp"
|
||||
@ -15,6 +17,10 @@ BASETIMESTAMPFILE="/etc/dnsmasq.time"
|
||||
TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf"
|
||||
TIMEVALIDFILE="/var/state/dnsmasqsec"
|
||||
BASEDHCPSTAMPFILE="/var/run/dnsmasq"
|
||||
RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf"
|
||||
DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh"
|
||||
|
||||
DNSMASQ_DHCP_VER=4
|
||||
|
||||
xappend() {
|
||||
local value="$1"
|
||||
@ -23,22 +29,22 @@ xappend() {
|
||||
}
|
||||
|
||||
hex_to_hostid() {
|
||||
local var="$1"
|
||||
local hex="${2#0x}" # strip optional "0x" prefix
|
||||
local var="$1"
|
||||
local hex="${2#0x}" # strip optional "0x" prefix
|
||||
|
||||
if [ -n "${hex//[0-9a-fA-F]/}" ]; then
|
||||
# is invalid hex literal
|
||||
return 1
|
||||
fi
|
||||
if [ -n "${hex//[0-9a-fA-F]/}" ]; then
|
||||
# is invalid hex literal
|
||||
return 1
|
||||
fi
|
||||
|
||||
# convert into host id
|
||||
export "$var=$(
|
||||
printf "%0x:%0x" \
|
||||
$(((0x$hex >> 16) % 65536)) \
|
||||
$(( 0x$hex % 256))
|
||||
)"
|
||||
# convert into host id
|
||||
export "$var=$(
|
||||
printf "%0x:%0x" \
|
||||
$(((0x$hex >> 16) % 65536)) \
|
||||
$(( 0x$hex % 65536))
|
||||
)"
|
||||
|
||||
return 0
|
||||
return 0
|
||||
}
|
||||
|
||||
dhcp_calc() {
|
||||
@ -83,12 +89,24 @@ log_once() {
|
||||
logger -t dnsmasq "$@"
|
||||
}
|
||||
|
||||
has_handler() {
|
||||
local file
|
||||
|
||||
for file in /etc/hotplug.d/dhcp/* /etc/hotplug.d/tftp/* /etc/hotplug.d/neigh/*; do
|
||||
[ -f "$file" ] && return 0
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
append_bool() {
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
local value="$3"
|
||||
local default="$4"
|
||||
local _loctmp
|
||||
config_get_bool _loctmp "$section" "$option" 0
|
||||
[ -z "$default" ] && default="0"
|
||||
config_get_bool _loctmp "$section" "$option" "$default"
|
||||
[ $_loctmp -gt 0 ] && xappend "$value"
|
||||
}
|
||||
|
||||
@ -107,6 +125,10 @@ append_server() {
|
||||
xappend "--server=$1"
|
||||
}
|
||||
|
||||
append_rev_server() {
|
||||
xappend "--rev-server=$1"
|
||||
}
|
||||
|
||||
append_address() {
|
||||
xappend "--address=$1"
|
||||
}
|
||||
@ -116,12 +138,16 @@ append_ipset() {
|
||||
}
|
||||
|
||||
append_interface() {
|
||||
network_get_device ifname "$1" || return
|
||||
network_get_device ifname "$1" || ifname="$1"
|
||||
xappend "--interface=$ifname"
|
||||
}
|
||||
|
||||
append_listenaddress() {
|
||||
xappend "--listen-address=$1"
|
||||
}
|
||||
|
||||
append_notinterface() {
|
||||
network_get_device ifname "$1" || return
|
||||
network_get_device ifname "$1" || ifname="$1"
|
||||
xappend "--except-interface=$ifname"
|
||||
}
|
||||
|
||||
@ -137,6 +163,10 @@ append_pxe_service() {
|
||||
xappend "--pxe-service=$1"
|
||||
}
|
||||
|
||||
append_interface_name() {
|
||||
xappend "--interface-name=$1,$2"
|
||||
}
|
||||
|
||||
filter_dnsmasq() {
|
||||
local cfg="$1" func="$2" match_cfg="$3" found_cfg
|
||||
|
||||
@ -180,6 +210,7 @@ dhcp_remoteid_add() {
|
||||
}
|
||||
|
||||
dhcp_circuitid_add() {
|
||||
# TODO: DHCPV6 does not have circuitid; catch "option6:"
|
||||
local cfg="$1"
|
||||
|
||||
config_get networkid "$cfg" networkid
|
||||
@ -212,6 +243,7 @@ dhcp_userclass_add() {
|
||||
}
|
||||
|
||||
dhcp_vendorclass_add() {
|
||||
# TODO: DHCPV6 vendor class has stricter definitions; catch? fixup?
|
||||
local cfg="$1"
|
||||
|
||||
config_get networkid "$cfg" networkid
|
||||
@ -245,6 +277,7 @@ dhcp_match_add() {
|
||||
|
||||
dhcp_host_add() {
|
||||
local cfg="$1"
|
||||
local hosttag nametime addrs duids
|
||||
|
||||
config_get_bool force "$cfg" force 0
|
||||
|
||||
@ -256,7 +289,9 @@ dhcp_host_add() {
|
||||
|
||||
config_get name "$cfg" name
|
||||
config_get ip "$cfg" ip
|
||||
[ -n "$ip" -o -n "$name" ] || return 0
|
||||
config_get hostid "$cfg" hostid
|
||||
|
||||
[ -n "$ip" -o -n "$name" -o -n "$hostid" ] || return 0
|
||||
|
||||
config_get_bool dns "$cfg" dns 0
|
||||
[ "$dns" = "1" -a -n "$ip" -a -n "$name" ] && {
|
||||
@ -264,35 +299,105 @@ dhcp_host_add() {
|
||||
}
|
||||
|
||||
config_get mac "$cfg" mac
|
||||
config_get duid "$cfg" duid
|
||||
config_get tag "$cfg" tag
|
||||
|
||||
if [ -n "$mac" ]; then
|
||||
# --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap
|
||||
# many MAC are possible to track a laptop ON/OFF dock
|
||||
macs=""
|
||||
for m in $mac; do append macs "$m" ","; done
|
||||
else
|
||||
# --dhcp-host=lap,192.168.0.199
|
||||
fi
|
||||
|
||||
if [ $DNSMASQ_DHCP_VER -eq 6 -a -n "$duid" ]; then
|
||||
# --dhcp-host=id:00:03:00:01:12:00:00:01:02:03,[::beef],lap
|
||||
# one (virtual) machine gets one DUID per RFC3315
|
||||
duids="id:${duid// */}"
|
||||
fi
|
||||
|
||||
if [ -z "$macs" -a -z "$duids" ]; then
|
||||
# --dhcp-host=lap,192.168.0.199,[::beef]
|
||||
[ -n "$name" ] || return 0
|
||||
macs="$name"
|
||||
name=""
|
||||
fi
|
||||
|
||||
config_get tag "$cfg" tag
|
||||
if [ -n "$hostid" ]; then
|
||||
hex_to_hostid hostid "$hostid"
|
||||
fi
|
||||
|
||||
if [ "$DHCPv6CAPABLE" -eq 1 ]; then
|
||||
config_get hostid "$cfg" hostid
|
||||
if [ -n "$hostid" ]; then
|
||||
hex_to_hostid hostid "$hostid"
|
||||
fi
|
||||
tags=""
|
||||
if [ -n "$tag" ]; then
|
||||
for t in $tag; do append tags "$t" ",set:"; done
|
||||
fi
|
||||
|
||||
config_get_bool broadcast "$cfg" broadcast 0
|
||||
[ "$broadcast" = "0" ] && broadcast=
|
||||
|
||||
config_get leasetime "$cfg" leasetime
|
||||
|
||||
xappend "--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}${leasetime:+,$leasetime}"
|
||||
[ "$broadcast" = "0" ] && broadcast= || broadcast=",set:needs-broadcast"
|
||||
|
||||
hosttag="${networkid:+,set:${networkid}}${tags:+,set:${tags}}$broadcast"
|
||||
nametime="${name:+,$name}${leasetime:+,$leasetime}"
|
||||
|
||||
if [ $DNSMASQ_DHCP_VER -eq 6 ]; then
|
||||
addrs="${ip:+,$ip}${hostid:+,[::$hostid]}"
|
||||
xappend "--dhcp-host=$macs${duids:+,$duids}$hosttag$addrs$nametime"
|
||||
else
|
||||
xappend "--dhcp-host=$macs$hosttag${ip:+,$ip}$nametime"
|
||||
fi
|
||||
}
|
||||
|
||||
dhcp_this_host_add() {
|
||||
local net="$1"
|
||||
local ifname="$2"
|
||||
local mode="$3"
|
||||
local routerstub routername ifdashname
|
||||
local lanaddr lanaddr6 lanaddrs6 ulaprefix
|
||||
|
||||
if [ "$mode" -gt 0 ] ; then
|
||||
ifdashname="${ifname//./-}"
|
||||
routerstub="$( md5sum /etc/os-release )"
|
||||
routerstub="router-${routerstub// */}"
|
||||
routername="$( uci_get system @system[0] hostname $routerstub )"
|
||||
|
||||
if [ "$mode" -gt 1 ] ; then
|
||||
if [ "$mode" -gt 2 ] ; then
|
||||
if [ "$mode" -gt 3 ] ; then
|
||||
append_interface_name "$ifdashname.$routername.$DOMAIN" "$ifname"
|
||||
fi
|
||||
|
||||
append_interface_name "$routername.$DOMAIN" "$ifname"
|
||||
fi
|
||||
|
||||
# All IP addresses discovered by dnsmasq will be labeled (except fe80::)
|
||||
append_interface_name "$routername" "$ifname"
|
||||
|
||||
else
|
||||
# This uses a static host file entry for only limited addresses.
|
||||
# Use dnsmasq option "--expandhosts" to enable FQDN on host files.
|
||||
ulaprefix="$(uci_get network @globals[0] ula_prefix)"
|
||||
network_get_ipaddr lanaddr "$net"
|
||||
network_get_ipaddrs6 lanaddrs6 "$net"
|
||||
|
||||
if [ -n "$lanaddr" ] ; then
|
||||
dhcp_domain_add "" "$routername" "$lanaddr"
|
||||
fi
|
||||
|
||||
if [ -n "$ulaprefix" -a -n "$lanaddrs6" ] ; then
|
||||
for lanaddr6 in $lanaddrs6 ; do
|
||||
case "$lanaddr6" in
|
||||
"${ulaprefix%%:/*}"*)
|
||||
dhcp_domain_add "" "$routername" "$lanaddr6"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
dhcp_tag_add() {
|
||||
# NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions
|
||||
local cfg="$1"
|
||||
|
||||
tag="$cfg"
|
||||
@ -323,6 +428,7 @@ dhcp_mac_add() {
|
||||
}
|
||||
|
||||
dhcp_boot_add() {
|
||||
# TODO: BOOTURL is different between DHCPv4 and DHCPv6
|
||||
local cfg="$1"
|
||||
|
||||
config_get networkid "$cfg" networkid
|
||||
@ -345,24 +451,30 @@ dhcp_boot_add() {
|
||||
|
||||
dhcp_add() {
|
||||
local cfg="$1"
|
||||
local dhcp6range="::"
|
||||
local nettag
|
||||
local tags
|
||||
|
||||
config_get net "$cfg" interface
|
||||
[ -n "$net" ] || return 0
|
||||
|
||||
config_get dhcpv4 "$cfg" dhcpv4
|
||||
[ "$dhcpv4" != "disabled" ] || return 0
|
||||
|
||||
config_get networkid "$cfg" networkid
|
||||
[ -n "$networkid" ] || networkid="$net"
|
||||
|
||||
network_get_subnet subnet "$net" || return 0
|
||||
network_get_device ifname "$net" || return 0
|
||||
network_get_protocol proto "$net" || return 0
|
||||
|
||||
[ "$cachelocal" = "0" ] && network_get_dnsserver dnsserver "$net" && {
|
||||
DNS_SERVERS="$DNS_SERVERS $dnsserver"
|
||||
}
|
||||
|
||||
append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && return 0
|
||||
append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && {
|
||||
# Many ISP do not have useful names for DHCP customers (your WAN).
|
||||
dhcp_this_host_add "$net" "$ifname" "$ADD_WAN_FQDN"
|
||||
return 0
|
||||
}
|
||||
|
||||
network_get_subnet subnet "$net" || return 0
|
||||
network_get_protocol proto "$net" || return 0
|
||||
|
||||
# Do not support non-static interfaces for now
|
||||
[ static = "$proto" ] || return 0
|
||||
@ -374,35 +486,142 @@ dhcp_add() {
|
||||
config_get_bool force "$cfg" force 0
|
||||
[ $force -gt 0 ] || dhcp_check "$ifname" || return 0
|
||||
|
||||
config_get start "$cfg" start
|
||||
config_get limit "$cfg" limit
|
||||
config_get leasetime "$cfg" leasetime
|
||||
config_get start "$cfg" start 100
|
||||
config_get limit "$cfg" limit 150
|
||||
config_get leasetime "$cfg" leasetime 12h
|
||||
config_get options "$cfg" options
|
||||
config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1
|
||||
|
||||
leasetime="${leasetime:-12h}"
|
||||
start="$(dhcp_calc "${start:-100}")"
|
||||
limit="${limit:-150}"
|
||||
[ "$limit" -gt 0 ] && limit=$((limit-1))
|
||||
eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)"
|
||||
if [ "$dynamicdhcp" = "0" ]; then END="static"; fi
|
||||
xappend "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}"
|
||||
config_get dhcpv4 "$cfg" dhcpv4
|
||||
config_get dhcpv6 "$cfg" dhcpv6
|
||||
|
||||
dhcp_option_add "$cfg" "$networkid"
|
||||
config_get ra "$cfg" ra
|
||||
config_get ra_management "$cfg" ra_management
|
||||
config_get ra_preference "$cfg" ra_preference
|
||||
config_get dns "$cfg" dns
|
||||
|
||||
config_list_foreach "$cfg" "interface_name" append_interface_name "$ifname"
|
||||
|
||||
# Put the router host name on this DHCP served interface address(es)
|
||||
dhcp_this_host_add "$net" "$ifname" "$ADD_LOCAL_FQDN"
|
||||
|
||||
start="$( dhcp_calc "$start" )"
|
||||
|
||||
add_tag() {
|
||||
tags="${tags}tag:$1,"
|
||||
}
|
||||
config_list_foreach "$cfg" tag add_tag
|
||||
|
||||
nettag="${networkid:+set:${networkid},}"
|
||||
|
||||
if [ "$limit" -gt 0 ] ; then
|
||||
limit=$((limit-1))
|
||||
fi
|
||||
|
||||
eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)"
|
||||
|
||||
if [ "$dynamicdhcp" = "0" ] ; then
|
||||
END="static"
|
||||
dhcp6range="::,static"
|
||||
else
|
||||
dhcp6range="::1000,::ffff"
|
||||
fi
|
||||
|
||||
|
||||
if [ "$dhcpv4" != "disabled" ] ; then
|
||||
xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"
|
||||
fi
|
||||
|
||||
|
||||
if [ $DNSMASQ_DHCP_VER -eq 6 -a "$ra" = "server" ] ; then
|
||||
# Note: dnsmasq cannot just be a DHCPv6 server (all-in-1)
|
||||
# and let some other machine(s) send RA pointing to it.
|
||||
|
||||
case $ra_preference in
|
||||
*high*)
|
||||
xappend "--ra-param=$ifname,high,0,7200"
|
||||
;;
|
||||
*low*)
|
||||
xappend "--ra-param=$ifname,low,0,7200"
|
||||
;;
|
||||
*)
|
||||
# Send UNSOLICITED RA at default interval and live for 2 hours.
|
||||
# TODO: convert flexible lease time into route life time (only seconds).
|
||||
xappend "--ra-param=$ifname,0,7200"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$dhcpv6" = "disabled" ] ; then
|
||||
ra_management="3"
|
||||
fi
|
||||
|
||||
|
||||
case $ra_management in
|
||||
0)
|
||||
# SLACC with DCHP for extended options
|
||||
xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-stateless,ra-names"
|
||||
;;
|
||||
2)
|
||||
# DHCP address and RA only for management redirection
|
||||
xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,$leasetime"
|
||||
;;
|
||||
3)
|
||||
# SLAAC only but dnsmasq attempts to link HOSTNAME, DHCPv4 MAC, and SLAAC
|
||||
xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-only,ra-names"
|
||||
;;
|
||||
*)
|
||||
# SLAAC and full DHCP
|
||||
xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,slaac,ra-names,$leasetime"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$dns" ]; then
|
||||
dnss=""
|
||||
for d in $dns; do append dnss "[$d]" ","; done
|
||||
else
|
||||
dnss="[::]"
|
||||
fi
|
||||
|
||||
dhcp_option_append "option6:dns-server,$dnss" "$networkid"
|
||||
fi
|
||||
|
||||
dhcp_option_add "$cfg" "$networkid" 0
|
||||
dhcp_option_add "$cfg" "$networkid" 2
|
||||
}
|
||||
|
||||
dhcp_option_add() {
|
||||
local cfg="$1"
|
||||
dhcp_option_append() {
|
||||
local option="$1"
|
||||
local networkid="$2"
|
||||
local force="$3"
|
||||
|
||||
xappend "--dhcp-option${force:+-force}=${networkid:+$networkid,}$option"
|
||||
}
|
||||
|
||||
dhcp_option_add() {
|
||||
# NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions
|
||||
local cfg="$1"
|
||||
local networkid="$2"
|
||||
local force="$3"
|
||||
local opt="dhcp_option"
|
||||
|
||||
[ "$force" = "0" ] && force=
|
||||
[ "$force" = "2" ] && opt="dhcp_option_force"
|
||||
|
||||
config_get dhcp_option "$cfg" dhcp_option
|
||||
for o in $dhcp_option; do
|
||||
xappend "--dhcp-option${force:+-force}=${networkid:+$networkid,}$o"
|
||||
done
|
||||
local list_len
|
||||
config_get list_len "$cfg" "${opt}_LENGTH"
|
||||
|
||||
if [ -n "$list_len" ]; then
|
||||
config_list_foreach "$cfg" "$opt" dhcp_option_append "$networkid" "$force"
|
||||
else
|
||||
config_get dhcp_option "$cfg" "$opt"
|
||||
|
||||
[ -n "$dhcp_option" ] && echo "Warning: the 'option $opt' syntax is deprecated, use 'list $opt'" >&2
|
||||
|
||||
local option
|
||||
for option in $dhcp_option; do
|
||||
dhcp_option_append "$option" "$networkid" "$force"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
dhcp_domain_add() {
|
||||
@ -507,13 +726,14 @@ dhcp_relay_add() {
|
||||
if [ -z "$interface" ]; then
|
||||
xappend "--dhcp-relay=$local_addr,$server_addr"
|
||||
else
|
||||
xappend "--dhcp-relay=$local_addr,$server_addr,$interface"
|
||||
network_get_device ifname "$interface" || return
|
||||
xappend "--dhcp-relay=$local_addr,$server_addr,$ifname"
|
||||
fi
|
||||
}
|
||||
|
||||
dnsmasq_start()
|
||||
{
|
||||
local cfg="$1" disabled
|
||||
local cfg="$1" disabled resolvfile user_dhcpscript
|
||||
|
||||
config_get_bool disabled "$cfg" disabled 0
|
||||
[ "$disabled" -gt 0 ] && return 0
|
||||
@ -546,6 +766,41 @@ dnsmasq_start()
|
||||
|
||||
$PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0
|
||||
|
||||
|
||||
if [ -x /usr/sbin/odhcpd -a -x /etc/init.d/odhcpd ] ; then
|
||||
local odhcpd_is_main odhcpd_is_enabled
|
||||
config_get odhcpd_is_main odhcpd maindhcp 0
|
||||
/etc/init.d/odhcpd enabled && odhcpd_is_enabled=1 || odhcpd_is_enabled=0
|
||||
|
||||
|
||||
if [ "$odhcpd_is_enabled" -eq 0 -a "$DHCPv6CAPABLE" -eq 1 ] ; then
|
||||
# DHCP V4 and V6 in DNSMASQ
|
||||
DNSMASQ_DHCP_VER=6
|
||||
elif [ "$odhcpd_is_main" -gt 0 ] ; then
|
||||
# ODHCPD is doing it all
|
||||
DNSMASQ_DHCP_VER=0
|
||||
else
|
||||
# You have ODHCPD but use DNSMASQ for DHCPV4
|
||||
DNSMASQ_DHCP_VER=4
|
||||
fi
|
||||
|
||||
elif [ "$DHCPv6CAPABLE" -eq 1 ] ; then
|
||||
# DHCP V4 and V6 in DNSMASQ
|
||||
DNSMASQ_DHCP_VER=6
|
||||
else
|
||||
DNSMASQ_DHCP_VER=4
|
||||
fi
|
||||
|
||||
# Allow DHCP/DHCPv6 to be handled by ISC DHCPD
|
||||
if [ -x /usr/sbin/dhcpd ] ; then
|
||||
if [ -x /etc/init.d/dhcpd ] ; then
|
||||
/etc/init.d/dhcpd enabled && DNSMASQ_DHCP_VER=0
|
||||
fi
|
||||
if [ -x /etc/init.d/dhcpd6 -a "$DNSMASQ_DHCP_VER" -gt 0 ] ; then
|
||||
/etc/init.d/dhcpd6 enabled && DNSMASQ_DHCP_VER=4
|
||||
fi
|
||||
fi
|
||||
|
||||
append_bool "$cfg" authoritative "--dhcp-authoritative"
|
||||
append_bool "$cfg" nodaemon "--no-daemon"
|
||||
append_bool "$cfg" domainneeded "--domain-needed"
|
||||
@ -558,12 +813,11 @@ dnsmasq_start()
|
||||
append_bool "$cfg" localise_queries "--localise-queries"
|
||||
append_bool "$cfg" readethers "--read-ethers"
|
||||
append_bool "$cfg" dbus "--enable-dbus"
|
||||
append_bool "$cfg" boguspriv "--bogus-priv"
|
||||
append_bool "$cfg" expandhosts "--expand-hosts"
|
||||
config_get tftp_root "$cfg" "tftp_root"
|
||||
[ -d "$tftp_root" ] && append_bool "$cfg" enable_tftp "--enable-tftp"
|
||||
[ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp"
|
||||
append_bool "$cfg" tftp_no_fail "--tftp-no-fail"
|
||||
append_bool "$cfg" nonwildcard "--bind-dynamic"
|
||||
append_bool "$cfg" nonwildcard "--bind-dynamic" 1
|
||||
append_bool "$cfg" fqdn "--dhcp-fqdn"
|
||||
append_bool "$cfg" proxydnssec "--proxy-dnssec"
|
||||
append_bool "$cfg" localservice "--local-service"
|
||||
@ -573,7 +827,8 @@ dnsmasq_start()
|
||||
append_bool "$cfg" allservers "--all-servers"
|
||||
append_bool "$cfg" noping "--no-ping"
|
||||
|
||||
append_parm "$cfg" dhcpscript "--dhcp-script"
|
||||
append_parm "$cfg" logfacility "--log-facility"
|
||||
|
||||
append_parm "$cfg" cachesize "--cache-size"
|
||||
append_parm "$cfg" dnsforwardmax "--dns-forward-max"
|
||||
append_parm "$cfg" port "--port"
|
||||
@ -584,7 +839,9 @@ dnsmasq_start()
|
||||
append_parm "$cfg" "maxport" "--max-port"
|
||||
append_parm "$cfg" "domain" "--domain"
|
||||
append_parm "$cfg" "local" "--server"
|
||||
config_list_foreach "$cfg" "listen_address" append_listenaddress
|
||||
config_list_foreach "$cfg" "server" append_server
|
||||
config_list_foreach "$cfg" "rev_server" append_rev_server
|
||||
config_list_foreach "$cfg" "address" append_address
|
||||
config_list_foreach "$cfg" "ipset" append_ipset
|
||||
config_list_foreach "$cfg" "interface" append_interface
|
||||
@ -592,7 +849,6 @@ dnsmasq_start()
|
||||
config_list_foreach "$cfg" "addnhosts" append_addnhosts
|
||||
config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
|
||||
append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases"
|
||||
append_parm "$cfg" "resolvfile" "--resolv-file" "/tmp/resolv.conf.auto"
|
||||
append_parm "$cfg" "serversfile" "--servers-file"
|
||||
append_parm "$cfg" "tftp_root" "--tftp-root"
|
||||
append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
|
||||
@ -603,12 +859,21 @@ dnsmasq_start()
|
||||
|
||||
config_get_bool ADD_LOCAL_DOMAIN "$cfg" add_local_domain 1
|
||||
config_get_bool ADD_LOCAL_HOSTNAME "$cfg" add_local_hostname 1
|
||||
config_get ADD_LOCAL_FQDN "$cfg" add_local_fqdn ""
|
||||
config_get ADD_WAN_FQDN "$cfg" add_wan_fqdn 0
|
||||
|
||||
if [ -z "$ADD_LOCAL_FQDN" ] ; then
|
||||
# maintain support for previous UCI
|
||||
ADD_LOCAL_FQDN="$ADD_LOCAL_HOSTNAME"
|
||||
fi
|
||||
|
||||
config_get_bool readethers "$cfg" readethers
|
||||
[ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers
|
||||
|
||||
config_get resolvfile $cfg resolvfile
|
||||
config_get dhcpscript $cfg dhcpscript
|
||||
config_get user_dhcpscript $cfg dhcpscript
|
||||
if has_handler || [ -n "$user_dhcpscript" ]; then
|
||||
xappend "--dhcp-script=$DHCPSCRIPT"
|
||||
fi
|
||||
|
||||
config_get leasefile $cfg leasefile "/tmp/dhcp.leases"
|
||||
[ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile"
|
||||
@ -621,6 +886,8 @@ dnsmasq_start()
|
||||
[ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch "$resolvfile"
|
||||
fi
|
||||
|
||||
[ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile"
|
||||
|
||||
config_get hostsfile "$cfg" dhcphostsfile
|
||||
[ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
|
||||
|
||||
@ -667,10 +934,11 @@ dnsmasq_start()
|
||||
}
|
||||
|
||||
dhcp_option_add "$cfg" "" 0
|
||||
dhcp_option_add "$cfg" "" 2
|
||||
|
||||
xappend "--dhcp-broadcast=tag:needs-broadcast"
|
||||
|
||||
xappend "--addn-hosts=$HOSTFILE"
|
||||
xappend "--addn-hosts=$(dirname $HOSTFILE)"
|
||||
|
||||
config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq.d"
|
||||
[ ! -d "$dnsmasqconfdir" ] && mkdir -p $dnsmasqconfdir
|
||||
@ -700,37 +968,31 @@ dnsmasq_start()
|
||||
config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg"
|
||||
config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg"
|
||||
|
||||
# add own hostname
|
||||
[ $ADD_LOCAL_HOSTNAME -eq 1 ] && {
|
||||
local lanaddr lanaddr6
|
||||
local ulaprefix="$(uci_get network @globals[0] ula_prefix)"
|
||||
local hostname="$(uci_get system @system[0] hostname Lede)"
|
||||
|
||||
network_get_ipaddr lanaddr "lan" && {
|
||||
dhcp_domain_add "" "$hostname" "$lanaddr"
|
||||
}
|
||||
|
||||
[ -n "$ulaprefix" ] && network_get_ipaddrs6 lanaddr6 "lan" && {
|
||||
for lanaddr6 in $lanaddr6; do
|
||||
case "$lanaddr6" in
|
||||
"${ulaprefix%%:/*}"*)
|
||||
dhcp_domain_add "" "$hostname" "$lanaddr6"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
echo >> $CONFIGFILE_TMP
|
||||
config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg"
|
||||
config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg"
|
||||
echo >> $CONFIGFILE_TMP
|
||||
|
||||
config_get odhcpd_is_active odhcpd maindhcp
|
||||
if [ "$odhcpd_is_active" != "1" ]; then
|
||||
config_get_bool boguspriv "$cfg" boguspriv 1
|
||||
[ "$boguspriv" -gt 0 ] && {
|
||||
xappend "--bogus-priv"
|
||||
[ -r "$RFC6761FILE" ] && xappend "--conf-file=$RFC6761FILE"
|
||||
}
|
||||
|
||||
if [ "$DNSMASQ_DHCP_VER" -gt 4 ] ; then
|
||||
# Enable RA feature for when/if it is constructed,
|
||||
# and RA is selected per interface pool (RA, DHCP, or both),
|
||||
# but no one (should) want RA broadcast in syslog
|
||||
config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
|
||||
xappend "--enable-ra"
|
||||
xappend "--quiet-ra"
|
||||
append_bool "$cfg" quietdhcp "--quiet-dhcp6"
|
||||
|
||||
elif [ "$DNSMASQ_DHCP_VER" -gt 0 ] ; then
|
||||
config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
|
||||
fi
|
||||
|
||||
|
||||
echo >> $CONFIGFILE_TMP
|
||||
config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg"
|
||||
echo >> $CONFIGFILE_TMP
|
||||
@ -752,6 +1014,7 @@ dnsmasq_start()
|
||||
procd_open_instance $cfg
|
||||
procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq."${cfg}".pid
|
||||
procd_set_param file $CONFIGFILE
|
||||
[ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript"
|
||||
procd_set_param respawn
|
||||
|
||||
local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf"
|
||||
@ -760,7 +1023,7 @@ dnsmasq_start()
|
||||
fi
|
||||
|
||||
procd_add_jail dnsmasq ubus log
|
||||
procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $dhcpscript /etc/hosts /etc/ethers $EXTRA_MOUNT
|
||||
procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT
|
||||
procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile
|
||||
|
||||
procd_close_instance
|
||||
|
4
package/network/services/dnsmasq/files/dnsmasq_acl.json
Normal file
4
package/network/services/dnsmasq/files/dnsmasq_acl.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"user": "dnsmasq",
|
||||
"publish": [ "dnsmasq" ]
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/procd.sh
|
||||
|
||||
TIMEVALIDFILE="/var/state/dnsmasqsec"
|
||||
|
||||
[ "$ACTION" = stratum ] || exit 0
|
||||
@ -7,8 +9,6 @@ TIMEVALIDFILE="/var/state/dnsmasqsec"
|
||||
[ -f "$TIMEVALIDFILE" ] || {
|
||||
echo "ntpd says time is valid" >$TIMEVALIDFILE
|
||||
/etc/init.d/dnsmasq enabled && {
|
||||
pid=$(pidof dnsmasq)
|
||||
[ "$(readlink /proc/$pid/exe)" = "/usr/sbin/dnsmasq" ] && kill -SIGHUP $pid \
|
||||
|| /etc/init.d/dnsmasq restart
|
||||
procd_send_signal dnsmasq
|
||||
}
|
||||
}
|
||||
|
15
package/network/services/dnsmasq/files/rfc6761.conf
Normal file
15
package/network/services/dnsmasq/files/rfc6761.conf
Normal file
@ -0,0 +1,15 @@
|
||||
# RFC6761 included configuration file for dnsmasq
|
||||
#
|
||||
# includes a list of domains that should not be forwarded to Internet name servers
|
||||
# to reduce burden on them, asking questions that they won't know the answer to.
|
||||
|
||||
server=/bind/
|
||||
server=/example/
|
||||
server=/example.com/
|
||||
server=/example.org/
|
||||
server=/example.net/
|
||||
server=/invalid/
|
||||
server=/local/
|
||||
server=/localhost/
|
||||
server=/onion/
|
||||
server=/test/
|
@ -1,47 +0,0 @@
|
||||
--- a/src/dhcp.c
|
||||
+++ b/src/dhcp.c
|
||||
@@ -147,7 +147,7 @@ void dhcp_packet(time_t now, int pxe_fd)
|
||||
ssize_t sz;
|
||||
int iface_index = 0, unicast_dest = 0, is_inform = 0;
|
||||
int rcvd_iface_index;
|
||||
- struct in_addr iface_addr;
|
||||
+ struct in_addr iface_addr, *addrp = NULL;
|
||||
struct iface_param parm;
|
||||
#ifdef HAVE_LINUX_NETWORK
|
||||
struct arpreq arp_req;
|
||||
@@ -277,11 +277,9 @@ void dhcp_packet(time_t now, int pxe_fd)
|
||||
{
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
if (ioctl(daemon->dhcpfd, SIOCGIFADDR, &ifr) != -1 )
|
||||
- iface_addr = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr;
|
||||
- else
|
||||
{
|
||||
- my_syslog(MS_DHCP | LOG_WARNING, _("DHCP packet received on %s which has no address"), ifr.ifr_name);
|
||||
- return;
|
||||
+ addrp = &iface_addr;
|
||||
+ iface_addr = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr;
|
||||
}
|
||||
|
||||
for (tmp = daemon->dhcp_except; tmp; tmp = tmp->next)
|
||||
@@ -300,7 +298,7 @@ void dhcp_packet(time_t now, int pxe_fd)
|
||||
parm.relay_local.s_addr = 0;
|
||||
parm.ind = iface_index;
|
||||
|
||||
- if (!iface_check(AF_INET, (struct all_addr *)&iface_addr, ifr.ifr_name, NULL))
|
||||
+ if (!iface_check(AF_INET, (struct all_addr *)addrp, ifr.ifr_name, NULL))
|
||||
{
|
||||
/* If we failed to match the primary address of the interface, see if we've got a --listen-address
|
||||
for a secondary */
|
||||
@@ -320,6 +318,12 @@ void dhcp_packet(time_t now, int pxe_fd)
|
||||
complete_context(match.addr, iface_index, NULL, match.netmask, match.broadcast, &parm);
|
||||
}
|
||||
|
||||
+ if (!addrp)
|
||||
+ {
|
||||
+ my_syslog(MS_DHCP | LOG_WARNING, _("DHCP packet received on %s which has no address"), ifr.ifr_name);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (!iface_enumerate(AF_INET, &parm, complete_context))
|
||||
return;
|
||||
|
@ -44,67 +44,22 @@
|
||||
(buffer = safe_malloc(BUFF_SZ)) &&
|
||||
(ipset_sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER)) != -1 &&
|
||||
(bind(ipset_sock, (struct sockaddr *)&snl, sizeof(snl)) != -1))
|
||||
@@ -168,62 +149,16 @@ static int new_add_to_ipset(const char *
|
||||
}
|
||||
|
||||
|
||||
-static int old_add_to_ipset(const char *setname, const struct all_addr *ipaddr, int remove)
|
||||
-{
|
||||
- socklen_t size;
|
||||
- struct ip_set_req_adt_get {
|
||||
- unsigned op;
|
||||
- unsigned version;
|
||||
- union {
|
||||
- char name[IPSET_MAXNAMELEN];
|
||||
- uint16_t index;
|
||||
- } set;
|
||||
- char typename[IPSET_MAXNAMELEN];
|
||||
- } req_adt_get;
|
||||
- struct ip_set_req_adt {
|
||||
- unsigned op;
|
||||
- uint16_t index;
|
||||
- uint32_t ip;
|
||||
- } req_adt;
|
||||
-
|
||||
- if (strlen(setname) >= sizeof(req_adt_get.set.name))
|
||||
- {
|
||||
- errno = ENAMETOOLONG;
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- req_adt_get.op = 0x10;
|
||||
- req_adt_get.version = 3;
|
||||
- strcpy(req_adt_get.set.name, setname);
|
||||
- size = sizeof(req_adt_get);
|
||||
- if (getsockopt(ipset_sock, SOL_IP, 83, &req_adt_get, &size) < 0)
|
||||
- return -1;
|
||||
- req_adt.op = remove ? 0x102 : 0x101;
|
||||
- req_adt.index = req_adt_get.set.index;
|
||||
- req_adt.ip = ntohl(ipaddr->addr.addr4.s_addr);
|
||||
- if (setsockopt(ipset_sock, SOL_IP, 83, &req_adt, sizeof(req_adt)) < 0)
|
||||
- return -1;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-
|
||||
int add_to_ipset(const char *setname, const struct all_addr *ipaddr, int flags, int remove)
|
||||
{
|
||||
int af = AF_INET;
|
||||
|
||||
#ifdef HAVE_IPV6
|
||||
@@ -217,17 +198,10 @@ int add_to_ipset(const char *setname, co
|
||||
if (flags & F_IPV6)
|
||||
- {
|
||||
{
|
||||
af = AF_INET6;
|
||||
- /* old method only supports IPv4 */
|
||||
- if (old_kernel)
|
||||
- return -1;
|
||||
- }
|
||||
- {
|
||||
- errno = EAFNOSUPPORT ;
|
||||
- ret = -1;
|
||||
- }
|
||||
}
|
||||
#endif
|
||||
|
||||
- return old_kernel ? old_add_to_ipset(setname, ipaddr, remove) : new_add_to_ipset(setname, ipaddr, af, remove);
|
||||
+ return new_add_to_ipset(setname, ipaddr, af, remove);
|
||||
}
|
||||
- if (ret != -1)
|
||||
- ret = old_kernel ? old_add_to_ipset(setname, ipaddr, remove) : new_add_to_ipset(setname, ipaddr, af, remove);
|
||||
+ ret = new_add_to_ipset(setname, ipaddr, af, remove);
|
||||
|
||||
#endif
|
||||
if (ret == -1)
|
||||
my_syslog(LOG_ERR, _("failed to update ipset %s: %s"), setname, strerror(errno));
|
||||
|
@ -1,149 +0,0 @@
|
||||
From f6bea86c78ba9efbd01da3dd2fb18764ec806290 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
|
||||
Date: Wed, 7 Sep 2016 09:35:07 +0100
|
||||
Subject: [PATCH] dnsmasq: compile time option NO_ID
|
||||
|
||||
Some consider it good practice to obscure software version numbers to
|
||||
clients. Compiling with -DNO_ID removes the *.bind info structure.
|
||||
This includes: version, author, copyright, cachesize, cache insertions,
|
||||
evictions, misses & hits, auth & servers.
|
||||
|
||||
Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
|
||||
---
|
||||
src/cache.c | 2 ++
|
||||
src/config.h | 5 +++++
|
||||
src/dnsmasq.h | 4 ++++
|
||||
src/option.c | 8 ++++++--
|
||||
src/rfc1035.c | 3 ++-
|
||||
5 files changed, 19 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/cache.c
|
||||
+++ b/src/cache.c
|
||||
@@ -1290,6 +1290,7 @@ void cache_add_dhcp_entry(char *host_nam
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifndef NO_ID
|
||||
int cache_make_stat(struct txt_record *t)
|
||||
{
|
||||
static char *buff = NULL;
|
||||
@@ -1385,6 +1386,7 @@ int cache_make_stat(struct txt_record *t
|
||||
*buff = len;
|
||||
return 1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* There can be names in the cache containing control chars, don't
|
||||
mess up logging or open security holes. */
|
||||
--- a/src/config.h
|
||||
+++ b/src/config.h
|
||||
@@ -120,6 +120,8 @@ HAVE_LOOP
|
||||
HAVE_INOTIFY
|
||||
use the Linux inotify facility to efficiently re-read configuration files.
|
||||
|
||||
+NO_ID
|
||||
+ Don't report *.bind CHAOS info to clients.
|
||||
NO_IPV6
|
||||
NO_TFTP
|
||||
NO_DHCP
|
||||
@@ -434,6 +436,9 @@ static char *compile_opts =
|
||||
"no-"
|
||||
#endif
|
||||
"DNSSEC "
|
||||
+#ifdef NO_ID
|
||||
+"no-ID "
|
||||
+#endif
|
||||
#ifndef HAVE_LOOP
|
||||
"no-"
|
||||
#endif
|
||||
--- a/src/dnsmasq.h
|
||||
+++ b/src/dnsmasq.h
|
||||
@@ -286,6 +286,7 @@ struct naptr {
|
||||
struct naptr *next;
|
||||
};
|
||||
|
||||
+#ifndef NO_ID
|
||||
#define TXT_STAT_CACHESIZE 1
|
||||
#define TXT_STAT_INSERTS 2
|
||||
#define TXT_STAT_EVICTIONS 3
|
||||
@@ -293,6 +294,7 @@ struct naptr {
|
||||
#define TXT_STAT_HITS 5
|
||||
#define TXT_STAT_AUTH 6
|
||||
#define TXT_STAT_SERVERS 7
|
||||
+#endif
|
||||
|
||||
struct txt_record {
|
||||
char *name;
|
||||
@@ -1078,7 +1080,9 @@ void cache_add_dhcp_entry(char *host_nam
|
||||
struct in_addr a_record_from_hosts(char *name, time_t now);
|
||||
void cache_unhash_dhcp(void);
|
||||
void dump_cache(time_t now);
|
||||
+#ifndef NO_ID
|
||||
int cache_make_stat(struct txt_record *t);
|
||||
+#endif
|
||||
char *cache_get_name(struct crec *crecp);
|
||||
char *cache_get_cname_target(struct crec *crecp);
|
||||
struct crec *cache_enumerate(int init);
|
||||
--- a/src/option.c
|
||||
+++ b/src/option.c
|
||||
@@ -657,7 +657,8 @@ static int atoi_check8(char *a, int *res
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
-
|
||||
+
|
||||
+#ifndef NO_ID
|
||||
static void add_txt(char *name, char *txt, int stat)
|
||||
{
|
||||
struct txt_record *r = opt_malloc(sizeof(struct txt_record));
|
||||
@@ -670,13 +671,14 @@ static void add_txt(char *name, char *tx
|
||||
*(r->txt) = len;
|
||||
memcpy((r->txt)+1, txt, len);
|
||||
}
|
||||
-
|
||||
+
|
||||
r->stat = stat;
|
||||
r->name = opt_string_alloc(name);
|
||||
r->next = daemon->txt;
|
||||
daemon->txt = r;
|
||||
r->class = C_CHAOS;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static void do_usage(void)
|
||||
{
|
||||
@@ -4515,6 +4517,7 @@ void read_opts(int argc, char **argv, ch
|
||||
daemon->soa_expiry = SOA_EXPIRY;
|
||||
daemon->max_port = MAX_PORT;
|
||||
|
||||
+#ifndef NO_ID
|
||||
add_txt("version.bind", "dnsmasq-" VERSION, 0 );
|
||||
add_txt("authors.bind", "Simon Kelley", 0);
|
||||
add_txt("copyright.bind", COPYRIGHT, 0);
|
||||
@@ -4527,6 +4530,7 @@ void read_opts(int argc, char **argv, ch
|
||||
add_txt("auth.bind", NULL, TXT_STAT_AUTH);
|
||||
#endif
|
||||
add_txt("servers.bind", NULL, TXT_STAT_SERVERS);
|
||||
+#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
--- a/src/rfc1035.c
|
||||
+++ b/src/rfc1035.c
|
||||
@@ -1264,6 +1264,7 @@ size_t answer_request(struct dns_header
|
||||
unsigned long ttl = daemon->local_ttl;
|
||||
int ok = 1;
|
||||
log_query(F_CONFIG | F_RRNAME, name, NULL, "<TXT>");
|
||||
+#ifndef NO_ID
|
||||
/* Dynamically generate stat record */
|
||||
if (t->stat != 0)
|
||||
{
|
||||
@@ -1271,7 +1272,7 @@ size_t answer_request(struct dns_header
|
||||
if (!cache_make_stat(t))
|
||||
ok = 0;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
if (ok && add_resource_record(header, limit, &trunc, nameoffset, &ansp,
|
||||
ttl, NULL,
|
||||
T_TXT, t->class, "t", t->len, t->txt))
|
@ -35,13 +35,13 @@ Signed-off-by: Steven Barth <steven@midlink.org>
|
||||
+ if (difftime(now, base) >= 0 && difftime(timestamp_time, now) <= 0)
|
||||
{
|
||||
/* time already OK, update timestamp, and do key checking from the start. */
|
||||
if (utime(daemon->timestamp_file, NULL) == -1)
|
||||
if (utimes(daemon->timestamp_file, NULL) == -1)
|
||||
@@ -493,7 +500,7 @@ int setup_timestamp(void)
|
||||
|
||||
close(fd);
|
||||
|
||||
- timestamp_time = timbuf.actime = timbuf.modtime = 1420070400; /* 1-1-2015 */
|
||||
+ timestamp_time = timbuf.actime = timbuf.modtime = base;
|
||||
if (utime(daemon->timestamp_file, &timbuf) == 0)
|
||||
goto check_and_exit;
|
||||
}
|
||||
- timestamp_time = 1420070400; /* 1-1-2015 */
|
||||
+ timestamp_time = base; /* 1-1-2015 */
|
||||
tv[0].tv_sec = tv[1].tv_sec = timestamp_time;
|
||||
tv[0].tv_usec = tv[1].tv_usec = 0;
|
||||
if (utimes(daemon->timestamp_file, tv) == 0)
|
||||
|
@ -7,7 +7,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
|
||||
|
||||
--- a/src/dnsmasq.h
|
||||
+++ b/src/dnsmasq.h
|
||||
@@ -82,7 +82,7 @@ typedef unsigned long long u64;
|
||||
@@ -88,7 +88,7 @@ typedef unsigned long long u64;
|
||||
#if defined(HAVE_SOLARIS_NETWORK)
|
||||
# include <sys/sockio.h>
|
||||
#endif
|
||||
|
126
package/network/services/dnsmasq/patches/240-ubus.patch
Normal file
126
package/network/services/dnsmasq/patches/240-ubus.patch
Normal file
@ -0,0 +1,126 @@
|
||||
--- a/src/dnsmasq.c
|
||||
+++ b/src/dnsmasq.c
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "dnsmasq.h"
|
||||
|
||||
+#include <libubus.h>
|
||||
+
|
||||
struct daemon *daemon;
|
||||
|
||||
static volatile pid_t pid = 0;
|
||||
@@ -32,6 +34,62 @@ static void fatal_event(struct event_des
|
||||
static int read_event(int fd, struct event_desc *evp, char **msg);
|
||||
static void poll_resolv(int force, int do_reload, time_t now);
|
||||
|
||||
+static struct ubus_context *ubus;
|
||||
+static struct blob_buf b;
|
||||
+
|
||||
+static struct ubus_object_type ubus_object_type = {
|
||||
+ .name = "dnsmasq",
|
||||
+};
|
||||
+
|
||||
+static struct ubus_object ubus_object = {
|
||||
+ .name = "dnsmasq",
|
||||
+ .type = &ubus_object_type,
|
||||
+};
|
||||
+
|
||||
+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name)
|
||||
+{
|
||||
+ if (!ubus || !ubus_object.has_subscribers)
|
||||
+ return;
|
||||
+
|
||||
+ blob_buf_init(&b, 0);
|
||||
+ if (mac)
|
||||
+ blobmsg_add_string(&b, "mac", mac);
|
||||
+ if (ip)
|
||||
+ blobmsg_add_string(&b, "ip", ip);
|
||||
+ if (name)
|
||||
+ blobmsg_add_string(&b, "name", name);
|
||||
+ ubus_notify(ubus, &ubus_object, type, b.head, -1);
|
||||
+}
|
||||
+
|
||||
+static void set_ubus_listeners(void)
|
||||
+{
|
||||
+ if (!ubus)
|
||||
+ return;
|
||||
+
|
||||
+ poll_listen(ubus->sock.fd, POLLIN);
|
||||
+ poll_listen(ubus->sock.fd, POLLERR);
|
||||
+ poll_listen(ubus->sock.fd, POLLHUP);
|
||||
+}
|
||||
+
|
||||
+static void check_ubus_listeners()
|
||||
+{
|
||||
+ if (!ubus) {
|
||||
+ ubus = ubus_connect(NULL);
|
||||
+ if (ubus)
|
||||
+ ubus_add_object(ubus, &ubus_object);
|
||||
+ else
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (poll_check(ubus->sock.fd, POLLIN))
|
||||
+ ubus_handle_event(ubus);
|
||||
+
|
||||
+ if (poll_check(ubus->sock.fd, POLLHUP)) {
|
||||
+ ubus_free(ubus);
|
||||
+ ubus = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int bind_fallback = 0;
|
||||
@@ -911,6 +969,7 @@ int main (int argc, char **argv)
|
||||
set_dbus_listeners();
|
||||
#endif
|
||||
|
||||
+ set_ubus_listeners();
|
||||
#ifdef HAVE_DHCP
|
||||
if (daemon->dhcp || daemon->relay4)
|
||||
{
|
||||
@@ -1041,6 +1100,8 @@ int main (int argc, char **argv)
|
||||
check_dbus_listeners();
|
||||
#endif
|
||||
|
||||
+ check_ubus_listeners();
|
||||
+
|
||||
check_dns_listeners(now);
|
||||
|
||||
#ifdef HAVE_TFTP
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -85,7 +85,7 @@ all : $(BUILDDIR)
|
||||
@cd $(BUILDDIR) && $(MAKE) \
|
||||
top="$(top)" \
|
||||
build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \
|
||||
- build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs)" \
|
||||
+ build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) -lubox -lubus" \
|
||||
-f $(top)/Makefile dnsmasq
|
||||
|
||||
mostly_clean :
|
||||
--- a/src/dnsmasq.h
|
||||
+++ b/src/dnsmasq.h
|
||||
@@ -1397,6 +1397,8 @@ void emit_dbus_signal(int action, struct
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name);
|
||||
+
|
||||
/* ipset.c */
|
||||
#ifdef HAVE_IPSET
|
||||
void ipset_init(void);
|
||||
--- a/src/rfc2131.c
|
||||
+++ b/src/rfc2131.c
|
||||
@@ -1621,6 +1621,10 @@ static void log_packet(char *type, void
|
||||
daemon->namebuff,
|
||||
string ? string : "",
|
||||
err ? err : "");
|
||||
+ if (!strcmp(type, "DHCPACK"))
|
||||
+ ubus_event_bcast("dhcp.ack", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL);
|
||||
+ else if (!strcmp(type, "DHCPRELEASE"))
|
||||
+ ubus_event_bcast("dhcp.release", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL);
|
||||
}
|
||||
|
||||
static void log_options(unsigned char *start, u32 xid)
|
@ -378,6 +378,7 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y
|
||||
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
|
||||
# CONFIG_MIPS_CMDLINE_FROM_DTB is not set
|
||||
# CONFIG_MIPS_ELF_APPENDED_DTB is not set
|
||||
CONFIG_MIPS_FPU_EMULATOR=y
|
||||
# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
|
||||
CONFIG_MIPS_L1_CACHE_SHIFT=5
|
||||
CONFIG_MIPS_MACHINE=y
|
||||
|
@ -0,0 +1,50 @@
|
||||
From 12acd136913ccdf394eeb2bc8686ff5505368119 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Oct 2017 10:21:26 +0200
|
||||
Subject: [PATCH] net: bgmac: enable master mode for BCM54210E and B50212E PHYs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
There are 4 very similar PHYs:
|
||||
0x600d84a1: BCM54210E (rev B0)
|
||||
0x600d84a2: BCM54210E (rev B1)
|
||||
0x600d84a5: B50212E (rev B0)
|
||||
0x600d84a6: B50212E (rev B1)
|
||||
that need setting master mode manually. It's because they run in slave
|
||||
mode by default with Automatic Slave/Master configuration disabled which
|
||||
can lead to unreliable connection with massive ping loss.
|
||||
|
||||
So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY
|
||||
connected to the bgmac supported ethernet device. Telling PHY driver to
|
||||
setup PHY properly solves this issue.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bgmac-bcma.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
@@ -159,13 +159,19 @@ static int bgmac_probe(struct bcma_devic
|
||||
|
||||
if (!bgmac_is_bcm4707_family(core) &&
|
||||
!(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) {
|
||||
+ struct phy_device *phydev;
|
||||
+
|
||||
mii_bus = bcma_mdio_mii_register(bgmac);
|
||||
if (IS_ERR(mii_bus)) {
|
||||
err = PTR_ERR(mii_bus);
|
||||
goto err;
|
||||
}
|
||||
-
|
||||
bgmac->mii_bus = mii_bus;
|
||||
+
|
||||
+ phydev = mdiobus_get_phy(bgmac->mii_bus, bgmac->phyaddr);
|
||||
+ if (ci->id == BCMA_CHIP_ID_BCM53573 && phydev &&
|
||||
+ (phydev->drv->phy_id & phydev->drv->phy_id_mask) == PHY_ID_BCM54210E)
|
||||
+ phydev->dev_flags |= PHY_BRCM_EN_MASTER_MODE;
|
||||
}
|
||||
|
||||
if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) {
|
@ -0,0 +1,54 @@
|
||||
From 2355a6546a053b1c16ebefd6ce1f0cccc00e1da5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Oct 2017 10:21:25 +0200
|
||||
Subject: [PATCH] net: phy: broadcom: support new device flag for setting
|
||||
master mode
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Some of Broadcom's PHYs run by default in slave mode with Automatic
|
||||
Slave/Master configuration disabled. It stops them from working properly
|
||||
with some devices.
|
||||
|
||||
So far it has been verified for BCM54210E and BCM50212E which don't
|
||||
work well with Intel's I217-LM and I218-LM:
|
||||
http://ark.intel.com/products/60019/Intel-Ethernet-Connection-I217-LM
|
||||
http://ark.intel.com/products/71307/Intel-Ethernet-Connection-I218-LM
|
||||
I was told there is massive ping loss.
|
||||
|
||||
This commit adds support for a new flag which can be set by an ethernet
|
||||
driver to fixup PHY setup.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/phy/broadcom.c | 6 ++++++
|
||||
include/linux/brcmphy.h | 1 +
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/broadcom.c
|
||||
+++ b/drivers/net/phy/broadcom.c
|
||||
@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct
|
||||
val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
|
||||
bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
|
||||
|
||||
+ if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
|
||||
+ val = phy_read(phydev, MII_CTRL1000);
|
||||
+ val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
|
||||
+ phy_write(phydev, MII_CTRL1000, val);
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/include/linux/brcmphy.h
|
||||
+++ b/include/linux/brcmphy.h
|
||||
@@ -59,6 +59,7 @@
|
||||
#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
|
||||
#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
|
||||
#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
|
||||
+#define PHY_BRCM_EN_MASTER_MODE 0x00010000
|
||||
|
||||
/* Broadcom BCM7xxx specific workarounds */
|
||||
#define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff)
|
@ -14,7 +14,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
@@ -230,6 +230,7 @@ static int bgmac_probe(struct bcma_devic
|
||||
@@ -236,6 +236,7 @@ static int bgmac_probe(struct bcma_devic
|
||||
bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
|
||||
bgmac->feature_flags |= BGMAC_FEAT_NO_RESET;
|
||||
bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;
|
||||
|
@ -0,0 +1,50 @@
|
||||
From 12acd136913ccdf394eeb2bc8686ff5505368119 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Thu, 12 Oct 2017 10:21:26 +0200
|
||||
Subject: [PATCH] net: bgmac: enable master mode for BCM54210E and B50212E PHYs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
There are 4 very similar PHYs:
|
||||
0x600d84a1: BCM54210E (rev B0)
|
||||
0x600d84a2: BCM54210E (rev B1)
|
||||
0x600d84a5: B50212E (rev B0)
|
||||
0x600d84a6: B50212E (rev B1)
|
||||
that need setting master mode manually. It's because they run in slave
|
||||
mode by default with Automatic Slave/Master configuration disabled which
|
||||
can lead to unreliable connection with massive ping loss.
|
||||
|
||||
So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY
|
||||
connected to the bgmac supported ethernet device. Telling PHY driver to
|
||||
setup PHY properly solves this issue.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bgmac-bcma.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
@@ -159,13 +159,19 @@ static int bgmac_probe(struct bcma_devic
|
||||
|
||||
if (!bgmac_is_bcm4707_family(core) &&
|
||||
!(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) {
|
||||
+ struct phy_device *phydev;
|
||||
+
|
||||
mii_bus = bcma_mdio_mii_register(bgmac);
|
||||
if (IS_ERR(mii_bus)) {
|
||||
err = PTR_ERR(mii_bus);
|
||||
goto err;
|
||||
}
|
||||
-
|
||||
bgmac->mii_bus = mii_bus;
|
||||
+
|
||||
+ phydev = bgmac->mii_bus->phy_map[bgmac->phyaddr];
|
||||
+ if (ci->id == BCMA_CHIP_ID_BCM53573 && phydev &&
|
||||
+ (phydev->drv->phy_id & phydev->drv->phy_id_mask) == PHY_ID_BCM54210E)
|
||||
+ phydev->dev_flags |= PHY_BRCM_EN_MASTER_MODE;
|
||||
}
|
||||
|
||||
if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) {
|
@ -1,6 +1,5 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Subject: [PATCH 1/2] net: phy: cherry-pick Broadcom drivers updates from
|
||||
v4.10-rc1
|
||||
Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.10
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
@ -1,10 +1,18 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Subject: [PATCH 2/2] net: phy: pick Broadcom drivers updates from net-next for
|
||||
4.11
|
||||
Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.11
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This includes following upstream commits:
|
||||
62e13097c46c net: phy: broadcom: rehook BCM54612E specific init
|
||||
0fc9ae107669 net: phy: broadcom: add support for BCM54210E
|
||||
5e7bfa6cb0a9 net: phy: bcm-phy-lib: clean up remaining AUXCTL register defines
|
||||
8293c7bcdef1 net: phy: broadcom: drop duplicated define for RGMII SKEW delay
|
||||
85b4685da52f net: phy: broadcom: use auxctl reading helper in BCM54612E code
|
||||
039a7b8592ab net: phy: bcm7xxx: Implement EGPHY workaround for 7278
|
||||
582d0ac397ca net: phy: bcm7xxx: Add entry for BCM7278
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
|
@ -0,0 +1,37 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.15
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This includes following upstream commits:
|
||||
2355a6546a05 net: phy: broadcom: support new device flag for setting master mode
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
|
||||
--- a/drivers/net/phy/broadcom.c
|
||||
+++ b/drivers/net/phy/broadcom.c
|
||||
@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct
|
||||
val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
|
||||
bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
|
||||
|
||||
+ if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
|
||||
+ val = phy_read(phydev, MII_CTRL1000);
|
||||
+ val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
|
||||
+ phy_write(phydev, MII_CTRL1000, val);
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/include/linux/brcmphy.h
|
||||
+++ b/include/linux/brcmphy.h
|
||||
@@ -59,6 +59,7 @@
|
||||
#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
|
||||
#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
|
||||
#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
|
||||
+#define PHY_BRCM_EN_MASTER_MODE 0x00010000
|
||||
|
||||
/* Broadcom BCM7xxx specific workarounds */
|
||||
#define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff)
|
@ -78,7 +78,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
struct bgmac *bgmac_alloc(struct device *dev);
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
@@ -230,6 +230,7 @@ static int bgmac_probe(struct bcma_devic
|
||||
@@ -236,6 +236,7 @@ static int bgmac_probe(struct bcma_devic
|
||||
bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
|
||||
bgmac->feature_flags |= BGMAC_FEAT_NO_RESET;
|
||||
bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;
|
||||
|
Loading…
Reference in New Issue
Block a user