Merge Official Source

This commit is contained in:
CN_SZTL 2020-07-20 22:56:49 +08:00
commit 99d03f1381
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
12 changed files with 118 additions and 37 deletions

View File

@ -110,6 +110,9 @@ mac80211_hostapd_setup_base() {
json_get_values ht_capab_list ht_capab tx_burst
json_get_values channel_list channels
[ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \
channel_list="$channel"
set_default noscan 0
[ "$noscan" -gt 0 ] && hostapd_noscan=1

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vxlan
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -7,6 +7,50 @@
init_proto "$@"
}
proto_vxlan_setup_peer() {
type bridge &> /dev/null || {
proto_notify_error "$cfg" "MISSING_BRIDGE_COMMAND"
exit
}
local peer_config="$1"
local vxlan
local lladdr
local dst
local src_vni
local vni
local port
local via
config_get vxlan "${peer_config}" "vxlan"
config_get lladdr "${peer_config}" "lladdr"
config_get dst "${peer_config}" "dst"
config_get src_vni "${peer_config}" "src_vni"
config_get vni "${peer_config}" "vni"
config_get port "${peer_config}" "port"
config_get via "${peer_config}" "via"
[ "$cfg" = "$vxlan" ] || {
# This peer section belongs to another device
return
}
[ -n "${dst}" ] || {
proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
exit
}
bridge fdb append \
${lladdr:-00:00:00:00:00:00} \
dev ${cfg} \
dst ${dst} \
${src_vni:+src_vni $src_vni} \
${vni:+vni $vni} \
${port:+port $port} \
${via:+via $via}
}
vxlan_generic_setup() {
local cfg="$1"
local mode="$2"
@ -18,7 +62,6 @@ vxlan_generic_setup() {
local port vid ttl tos mtu macaddr zone rxcsum txcsum
json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum
proto_init_update "$link" 1
proto_add_tunnel
@ -47,6 +90,9 @@ vxlan_generic_setup() {
proto_close_data
proto_send_update "$cfg"
config_load network
config_foreach proto_vxlan_setup_peer "vxlan_peer"
}
proto_vxlan_setup() {
@ -55,12 +101,6 @@ proto_vxlan_setup() {
local ipaddr peeraddr
json_get_vars ipaddr peeraddr tunlink
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
proto_block_restart "$cfg"
exit
}
( proto_add_host_dependency "$cfg" '' "$tunlink" )
[ -z "$ipaddr" ] && {
@ -85,12 +125,6 @@ proto_vxlan6_setup() {
local ip6addr peer6addr
json_get_vars ip6addr peer6addr tunlink
[ -z "$peer6addr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
proto_block_restart "$cfg"
exit
}
( proto_add_host_dependency "$cfg" '' "$tunlink" )
[ -z "$ip6addr" ] && {

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_UPSTREAM_VERSION:=2.81
PKG_UPSTREAM_VERSION:=2.82
PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
PKG_HASH:=749ca903537c5197c26444ac24b0dce242cf42595fdfe6b9a5b9e4c7ad32f8fb
PKG_HASH:=84523646f3116bb5e1151efb66e645030f6e6a8256f29aab444777a343ebc132
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

View File

@ -14,7 +14,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -94,10 +94,6 @@ int main (int argc, char **argv)
@@ -95,10 +95,6 @@ int main (int argc, char **argv)
read_opts(argc, argv, compile_opts);
@ -27,7 +27,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1110,7 +1110,7 @@ extern struct daemon {
@@ -1112,7 +1112,7 @@ extern struct daemon {
int inotifyfd;
#endif
#if defined(HAVE_LINUX_NETWORK)
@ -36,7 +36,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
#elif defined(HAVE_BSD_NETWORK)
int dhcp_raw_fd, dhcp_icmp_fd, routefd;
#endif
@@ -1290,9 +1290,6 @@ int read_write(int fd, unsigned char *pa
@@ -1292,9 +1292,6 @@ int read_write(int fd, unsigned char *pa
void close_fds(long max_fd, int spare1, int spare2, int spare3);
int wildcard_match(const char* wildcard, const char* match);
int wildcard_matchn(const char* wildcard, const char* match, int num);
@ -141,16 +141,16 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
my_syslog(LOG_ERR, _("failed to update ipset %s: %s"), setname, strerror(errno));
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -82,8 +82,7 @@ void netlink_init(void)
}
@@ -92,8 +92,7 @@ char *netlink_init(void)
iov.iov_len = 100;
iov.iov_base = safe_malloc(iov.iov_len);
if (daemon->netlinkfd == -1 ||
- (daemon->kernel_version >= KERNEL_VERSION(2,6,30) &&
- setsockopt(daemon->netlinkfd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &opt, sizeof(opt)) == -1) ||
+ (setsockopt(daemon->netlinkfd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &opt, sizeof(opt)) == -1) ||
getsockname(daemon->netlinkfd, (struct sockaddr *)&addr, &slen) == -1)
die(_("cannot create netlink socket: %s"), NULL, EC_MISC);
- if (daemon->kernel_version >= KERNEL_VERSION(2,6,30) &&
- setsockopt(daemon->netlinkfd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &opt, sizeof(opt)) == -1)
+ if (setsockopt(daemon->netlinkfd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &opt, sizeof(opt)) == -1)
return _("warning: failed to set NETLINK_NO_ENOBUFS on netlink socket");
return NULL;
--- a/src/util.c
+++ b/src/util.c
@@ -786,22 +786,3 @@ int wildcard_matchn(const char* wildcard

View File

@ -0,0 +1,37 @@
From cefc52e6b93731c713f1bba1cb5e7e92105b758b Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Fri, 3 Jul 2020 23:00:34 +0200
Subject: [PATCH] dfs: enter DFS state if no available channel is found
Previously hostapd would not stop transmitting when a DFS event was
detected and no available channel to switch to was available.
Disable and re-enable the interface to enter DFS state. This way, TX
does not happen until the kernel notifies hostapd about the NOP
expiring.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
src/ap/dfs.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -1066,8 +1066,15 @@ static int hostapd_dfs_start_channel_swi
&oper_centr_freq_seg0_idx,
&oper_centr_freq_seg1_idx,
&skip_radar);
- if (!channel)
- return err;
+ if (!channel) {
+ /*
+ * Toggle interface state to enter DFS state
+ * until NOP is finished.
+ */
+ hostapd_disable_iface(iface);
+ hostapd_enable_iface(iface);
+ return 0;
+ }
if (!skip_radar) {
iface->freq = channel->freq;
iface->conf->channel = channel->chan;

View File

@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
PKG_SOURCE_DATE:=2020-07-17
PKG_SOURCE_VERSION:=268126a3b159fbd488eb56ebbd19c7384f1aa8a5
PKG_MIRROR_HASH:=77f143f600570c26f9305a744e8cad9c799c71b7873b4cbcff3151c43d796671
PKG_SOURCE_DATE:=2020-07-20
PKG_SOURCE_VERSION:=66ae2d947ea463c53de1bf2ed5491c9926694f02
PKG_MIRROR_HASH:=c66fb1d6f89c110b59cc53595754522272a9e62aaf1970a5aea34fe528ec3dcd
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0

View File

@ -44,8 +44,8 @@
wifi {
label = "wlan";
gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_WLAN>;
gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
};

View File

@ -40,7 +40,7 @@
wifi {
label = "wifi";
gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_WLAN>;
linux,code = <KEY_RFKILL>;
};
};

View File

@ -44,8 +44,8 @@
wifi {
label = "wlan";
gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_WLAN>;
gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
};

View File

@ -40,7 +40,7 @@
wifi {
label = "wifi";
gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_WLAN>;
linux,code = <KEY_RFKILL>;
};
};

View File

@ -204,8 +204,15 @@ static struct device_info boards[] = {
"SupportList:\r\n"
"CPE210(TP-LINK|EU|N300-2|45550000):3.0\r\n"
"CPE210(TP-LINK|UN|N300-2|00000000):3.0\r\n"
"CPE210(TP-LINK|US|N300-2|55530000):3.0\r\n"
"CPE210(TP-LINK|UN|N300-2):3.0\r\n"
"CPE210(TP-LINK|EU|N300-2):3.0\r\n",
"CPE210(TP-LINK|EU|N300-2):3.0\r\n"
"CPE210(TP-LINK|EU|N300-2|45550000):3.1\r\n"
"CPE210(TP-LINK|UN|N300-2|00000000):3.1\r\n"
"CPE210(TP-LINK|US|N300-2|55530000):3.1\r\n"
"CPE210(TP-LINK|EU|N300-2|45550000):3.20\r\n"
"CPE210(TP-LINK|UN|N300-2|00000000):3.20\r\n"
"CPE210(TP-LINK|US|N300-2|55530000):3.20\r\n",
.support_trail = '\xff',
.soft_ver = NULL,