diff --git a/defconfig/mt7981-ax3000.config b/defconfig/mt7981-ax3000.config index 3100a879a57..00b5fc1f280 100644 --- a/defconfig/mt7981-ax3000.config +++ b/defconfig/mt7981-ax3000.config @@ -90,9 +90,13 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y CONFIG_MTK_ICAP_SUPPORT=y CONFIG_MTK_IGMP_SNOOP_SUPPORT=y CONFIG_MTK_INTERWORKING=y +CONFIG_MTK_BAND_STEERING=y +CONFIG_MTK_MAP_SUPPORT=y CONFIG_MTK_MAP_R2_VER_SUPPORT=y CONFIG_MTK_MAP_R3_VER_SUPPORT=y -CONFIG_MTK_MAP_SUPPORT=y +CONFIG_MTK_MAP_R2_6E_SUPPORT=y +CONFIG_MTK_MAP_R3_6E_SUPPORT=y +CONFIG_MTK_MBO_SUPPORT=y CONFIG_MTK_MBSS_DTIM_SUPPORT=y CONFIG_MTK_MBSS_SUPPORT=y CONFIG_MTK_MCAST_RATE_SPECIFIC=y diff --git a/defconfig/mt7986-ax4200.config b/defconfig/mt7986-ax4200.config index f87cbb26596..b9f383e82ea 100644 --- a/defconfig/mt7986-ax4200.config +++ b/defconfig/mt7986-ax4200.config @@ -61,9 +61,12 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y CONFIG_MTK_ICAP_SUPPORT=y CONFIG_MTK_IGMP_SNOOP_SUPPORT=y CONFIG_MTK_INTERWORKING=y +CONFIG_MTK_BAND_STEERING=y +CONFIG_MTK_MAP_SUPPORT=y CONFIG_MTK_MAP_R2_VER_SUPPORT=y CONFIG_MTK_MAP_R3_VER_SUPPORT=y -CONFIG_MTK_MAP_SUPPORT=y +CONFIG_MTK_MAP_R2_6E_SUPPORT=y +CONFIG_MTK_MAP_R3_6E_SUPPORT=y CONFIG_MTK_MBSS_DTIM_SUPPORT=y CONFIG_MTK_MBSS_SUPPORT=y CONFIG_MTK_MCAST_RATE_SPECIFIC=y diff --git a/defconfig/mt7986-ax6000-256m.config b/defconfig/mt7986-ax6000-256m.config index f8e2a2d5a42..6ace4b839da 100644 --- a/defconfig/mt7986-ax6000-256m.config +++ b/defconfig/mt7986-ax6000-256m.config @@ -58,9 +58,12 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y CONFIG_MTK_ICAP_SUPPORT=y CONFIG_MTK_IGMP_SNOOP_SUPPORT=y CONFIG_MTK_INTERWORKING=y +CONFIG_MTK_BAND_STEERING=y +CONFIG_MTK_MAP_SUPPORT=y CONFIG_MTK_MAP_R2_VER_SUPPORT=y CONFIG_MTK_MAP_R3_VER_SUPPORT=y -CONFIG_MTK_MAP_SUPPORT=y +CONFIG_MTK_MAP_R2_6E_SUPPORT=y +CONFIG_MTK_MAP_R3_6E_SUPPORT=y CONFIG_MTK_MBSS_DTIM_SUPPORT=y CONFIG_MTK_MBSS_SUPPORT=y CONFIG_MTK_MCAST_RATE_SPECIFIC=y diff --git a/defconfig/mt7986-ax6000.config b/defconfig/mt7986-ax6000.config index a5e71b09381..f3c7dde3732 100644 --- a/defconfig/mt7986-ax6000.config +++ b/defconfig/mt7986-ax6000.config @@ -66,9 +66,12 @@ CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y CONFIG_MTK_ICAP_SUPPORT=y CONFIG_MTK_IGMP_SNOOP_SUPPORT=y CONFIG_MTK_INTERWORKING=y +CONFIG_MTK_BAND_STEERING=y +CONFIG_MTK_MAP_SUPPORT=y CONFIG_MTK_MAP_R2_VER_SUPPORT=y CONFIG_MTK_MAP_R3_VER_SUPPORT=y -CONFIG_MTK_MAP_SUPPORT=y +CONFIG_MTK_MAP_R2_6E_SUPPORT=y +CONFIG_MTK_MAP_R3_6E_SUPPORT=y CONFIG_MTK_MBSS_DTIM_SUPPORT=y CONFIG_MTK_MBSS_SUPPORT=y CONFIG_MTK_MCAST_RATE_SPECIFIC=y diff --git a/package/mtk/applications/luci-app-eqos-mtk/Makefile b/package/mtk/applications/luci-app-eqos-mtk/Makefile index 8b0d3f1068a..3d80a8a7fda 100644 --- a/package/mtk/applications/luci-app-eqos-mtk/Makefile +++ b/package/mtk/applications/luci-app-eqos-mtk/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for Easy QoS -LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb @!PACKAGE_luci-app-eqos +LUCI_DEPENDS:=+tc +kmod-sched-core +kmod-ifb @!PACKAGE_luci-app-eqos PKG_MAINTAINER:=Jianhui Zhao PKG_NAME:=luci-app-eqos-mtk diff --git a/package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js b/package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js index bd7766cadb1..bb25b1120fd 100644 --- a/package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js +++ b/package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js @@ -24,10 +24,19 @@ return view.extend({ o.default = o.disabled; o.rmempty = false; + o = s.option(form.Value, 'interface', _('Load balance'), + _('Please set a different gateway hop for each network interface before filling in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for DHCP. Leaving it blank to disable it.Please use commas as interface name separators. Example: pppoe-wan,eth1')); + o.rmempty = true; + o = s.option(form.Flag, 'ipv6enabled', _('IPV6Enable')); o.default = o.disabled; o.rmempty = false; - + + o = s.option(form.Flag, 'smarthqos', _('SMART_HWQOS'), + _('Enabling fair queue will automatically perform hardware offloading and forwarding for small packets, P2P downloads, and web browsing. After enabling, the maximum number available for IP speed limit will be limited to 25.')); + o.default = o.disabled; + o.rmempty = false; + o = s.option(form.Value, 'download', _('Download speed (Mbit/s)'), _('Total download bandwidth.')); o.datatype = 'and(uinteger,min(1))'; @@ -37,8 +46,10 @@ return view.extend({ _('Total upload bandwidth.')); o.datatype = 'and(uinteger,min(1))'; o.rmempty = false; + + - s = m.section(form.TableSection, 'device', _('Speed limit based on IP address(using unique comment less than 32 will enable hardware QOS)')); + s = m.section(form.TableSection, 'device', _('Speed limit and route choose based on IP address(using unique comment less than 32 will enable hardware QOS)')); s.addremove = true; s.anonymous = true; s.sortable = true; @@ -54,7 +65,7 @@ return view.extend({ var ip_addr = i[1].ipaddrs[v], ip_host = i[1].name; o.value(ip_addr, ip_host ? String.format('%s (%s)', ip_host, ip_addr) : ip_addr) } - o.rmempty = false; + o.rmempty = true; var hosts = data[1]?.hosts; o = s.option(form.Value, 'mac', _('IPV6 host')); @@ -76,6 +87,10 @@ return view.extend({ o = s.option(form.Value, 'comment', _('Comment')); o.datatype = 'and(uinteger,min(1))'; o.rmempty = false; + + o = s.option(form.Value, 'interfacename', _('InterfaceName(start from 0)')); + o.datatype = 'and(uinteger,min(0))'; + o.rmempty = true; return m.render(); } diff --git a/package/mtk/applications/luci-app-eqos-mtk/po/templates/eqos.pot b/package/mtk/applications/luci-app-eqos-mtk/po/templates/eqos.pot index 07ccd54de18..0d7ba79d5ee 100644 --- a/package/mtk/applications/luci-app-eqos-mtk/po/templates/eqos.pot +++ b/package/mtk/applications/luci-app-eqos-mtk/po/templates/eqos.pot @@ -1,62 +1,94 @@ msgid "" msgstr "Content-Type: text/plain; charset=UTF-8" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:64 +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:87 msgid "Comment" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:28 +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:40 msgid "Download speed (Mbit/s)" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:18 -#: applications/luci-app-eqos/root/usr/share/luci/menu.d/luci-app-eqos.json:3 +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:79 +msgid "Download speed (kbit/s)" +msgstr "" + +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:18 +#: package/mtk/applications/luci-app-eqos-mtk/root/usr/share/luci/menu.d/luci-app-eqos.json:3 msgid "EQoS" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:24 -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:43 +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:23 +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:57 msgid "Enable" msgstr "" -msgid "IPV6Enable" +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:36 +msgid "" +"Enabling fair queue will automatically perform hardware offloading and " +"forwarding for small packets, P2P downloads, and web browsing. After " +"enabling, the maximum number available for IP speed limit will be limited to " +"25." msgstr "" -#: applications/luci-app-eqos/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3 +#: package/mtk/applications/luci-app-eqos-mtk/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3 msgid "Grant UCI access for luci-app-eqos" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:46 +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:60 msgid "IPV4 address" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:19 -msgid "Network speed control service." +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:71 +msgid "IPV6 host" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:38 -msgid "Speed limit based on IP address(using unique comment less than 32 will enable hardware QOS" +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:31 +msgid "IPV6Enable" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:29 -msgid "Total download bandwidth." +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:91 +msgid "InterfaceName(start from 0)" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:34 -msgid "Total upload bandwidth." +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:27 +msgid "Load balance" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:33 -msgid "Upload speed (Mbit/s)" +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:19 +msgid "Network speed control service.(Compatiable with Mediatek HNAT)" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:56 -msgid "Download speed (kbit/s)" +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:28 +msgid "" +"Please set a different gateway hop for each network interface before filling " +"in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for " +"DHCP. Leaving it blank to disable it.Please use commas as interface name " +"separators. Example: pppoe-wan,eth1" msgstr "" -#: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:60 -msgid "Upload speed (kbit/s)" +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:35 +msgid "SMART_HWQOS" msgstr "" -msgid "IPV6 host" +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:52 +msgid "" +"Speed limit and route choose based on IP address(using unique comment less " +"than 32 will enable hardware QOS)" +msgstr "" + +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:41 +msgid "Total download bandwidth." +msgstr "" + +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:46 +msgid "Total upload bandwidth." +msgstr "" + +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:45 +msgid "Upload speed (Mbit/s)" +msgstr "" + +#: package/mtk/applications/luci-app-eqos-mtk/htdocs/luci-static/resources/view/eqos.js:83 +msgid "Upload speed (kbit/s)" msgstr "" diff --git a/package/mtk/applications/luci-app-eqos-mtk/po/zh_Hans/eqos.po b/package/mtk/applications/luci-app-eqos-mtk/po/zh_Hans/eqos.po index 58b900528cc..b893f5beafe 100644 --- a/package/mtk/applications/luci-app-eqos-mtk/po/zh_Hans/eqos.po +++ b/package/mtk/applications/luci-app-eqos-mtk/po/zh_Hans/eqos.po @@ -27,9 +27,20 @@ msgstr "网速控制" msgid "Enable" msgstr "启用" +msgid "SMART_HWQOS" +msgstr "智能硬件QOS" + +msgid "Enabling fair queue will automatically perform hardware offloading and forwarding for small packets, P2P downloads, and web browsing. After enabling, the maximum number available for IP speed limit will be limited to 25." +msgstr "启用公平队列,将自动对小包、P2P下载、网页浏览进行硬件分流转发.启用后IP限速可用的最大编号将限制为25" + msgid "IPV6Enable" msgstr "同时作用IPV6" +msgid "Load balance" +msgstr "负载均衡" + +msgid "Please set a different gateway hop for each network interface before filling in the network interface name. Fill in PPPOE-WAN for dialing and eth1 for DHCP. Leaving it blank to disable it.Please use commas as interface name separators. Example: pppoe-wan,eth1" +msgstr "请先为每个网络接口设置不同的网关跃点后,再填写网络接口名。拨号填写PPPOE-WAN,DHCP则填写eth1。留空则不启用.请使用逗号作为接口名分隔符.例子:pppoe-wan, eth1" #: applications/luci-app-eqos/root/usr/share/rpcd/acl.d/luci-app-eqos.json:3 msgid "Grant UCI access for luci-app-eqos" @@ -42,13 +53,21 @@ msgstr "IPV4 地址" msgid "IPV6 host" msgstr "IPV6 主机" + +msgid "Total download bandwidth." +msgstr "总下载带宽。" + +msgid "InterfaceName(start from 0)" +msgstr "分流接口序号(从0开始,留空则负载均衡)" + + #: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:19 msgid "Network speed control service.(Compatiable with Mediatek HNAT)" msgstr "网速控制服务(未设置限速主机可正常使用硬件加速)。" #: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:38 -msgid "Speed limit based on IP address(using unique comment less than 32 will enable hardware QOS)" -msgstr "基于 IP 限速(设置小于32唯一编号将启用硬件QOS.速度设置为0则取消限速)" +msgid "Speed limit and route choose based on IP address(using unique comment less than 32 will enable hardware QOS)" +msgstr "基于 IP 分流限速(设置小于32唯一编号将启用硬件QOS.速度设置为0则取消限速)" #: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:29 msgid "Total download bandwidth." @@ -69,3 +88,4 @@ msgstr "下载速度 (kbit/s)" #: applications/luci-app-eqos/htdocs/luci-static/resources/view/eqos.js:60 msgid "Upload speed (kbit/s)" msgstr "上传速度 (kbit/s)" + diff --git a/package/mtk/applications/luci-app-eqos-mtk/root/etc/hotplug.d/iface/10-eqos b/package/mtk/applications/luci-app-eqos-mtk/root/etc/hotplug.d/iface/10-eqos index d70034acbc7..ab247ef306d 100755 --- a/package/mtk/applications/luci-app-eqos-mtk/root/etc/hotplug.d/iface/10-eqos +++ b/package/mtk/applications/luci-app-eqos-mtk/root/etc/hotplug.d/iface/10-eqos @@ -1,5 +1,3 @@ #!/bin/sh -[ "$ACTION" = "ifup" ] || exit 0 -[ "$INTERFACE" = "lan" ] || exit 0 /etc/init.d/eqos start diff --git a/package/mtk/applications/luci-app-eqos-mtk/root/etc/init.d/eqos b/package/mtk/applications/luci-app-eqos-mtk/root/etc/init.d/eqos index c526d1d467e..1e81963be04 100755 --- a/package/mtk/applications/luci-app-eqos-mtk/root/etc/init.d/eqos +++ b/package/mtk/applications/luci-app-eqos-mtk/root/etc/init.d/eqos @@ -12,14 +12,14 @@ parse_device() { [ "$enabled" -eq "1" ] || return 1 - local ip download upload comment mac + local ip download upload comment mac interfacename config_get ip "$cfg" ip config_get download "$cfg" "download" config_get upload "$cfg" "upload" config_get comment "$cfg" "comment" config_get mac "$cfg" "mac" - - eqos add "$ip" "$download" "$upload" "$comment" "$mac" + config_get interfacename "$cfg" "interfacename" + eqos add "$ip" "$download" "$upload" "$comment" "$mac" "$interfacename" } start_service() { @@ -33,8 +33,9 @@ start_service() { config_get download "config" "download" config_get upload "config" "upload" config_get comment "config" "comment" - - eqos start "$download" "$upload" "$comment" + config_get smarthqos "config" "smarthqos" + config_get interface "config" "interface" + eqos start "$download" "$upload" "$comment" local ipv6enabled config_get_bool ipv6enabled "config" "ipv6enabled" "0" @@ -48,11 +49,70 @@ start_service() { ip6tables -t mangle -D FORWARD -j eqos ip6tables -t mangle -A FORWARD -j eqos fi + + if [ "$smarthqos" -eq "1" ]; then + for i in $(seq 1 31); do + if [ "$upload" -ne "0" ]; then + echo 2 1 $(($upload*225)) 1 $(($upload*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq$i + fi + done + for i in $(seq 33 63); do + if [ "$download" -ne "0" ]; then + echo 3 1 $(($download*200)) 1 $(($download*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq$i + fi + done + echo 2 1 $(($upload*100)) 1 $(($upload*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq30 + echo 3 1 $(($download*150)) 1 $(($download*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq62 + echo 2 1 $(($upload*100)) 1 $(($upload*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq27 + echo 3 1 $(($download*150)) 1 $(($download*1000)) 4 1 > /sys/kernel/debug/hnat/qdma_txq59 + + + iptables -t mangle -A eqos -i br-lan -p tcp -j DSCP --set-dscp 31 + iptables -t mangle -A eqos -o br-lan -p tcp -j DSCP --set-dscp 63 + iptables -t mangle -A eqos -i br-lan -p udp -j DSCP --set-dscp 30 + iptables -t mangle -A eqos -o br-lan -p udp -j DSCP --set-dscp 62 + iptables -t mangle -A eqos -i br-lan -p tcp --dport 80 -j DSCP --set-dscp 29 + iptables -t mangle -A eqos -o br-lan -p tcp --dport 80 -j DSCP --set-dscp 61 + iptables -t mangle -A eqos -o br-lan -p tcp --dport 443 -j DSCP --set-dscp 29 + iptables -t mangle -A eqos -o br-lan -p tcp --dport 443 -j DSCP --set-dscp 61 + iptables -t mangle -A eqos -i br-lan -p tcp --dport 8080 -j DSCP --set-dscp 29 + iptables -t mangle -A eqos -o br-lan -p tcp --dport 8080 -j DSCP --set-dscp 61 + iptables -t mangle -A eqos -i br-lan -p tcp --dport 8081 -j DSCP --set-dscp 29 + iptables -t mangle -A eqos -o br-lan -p tcp --dport 8081 -j DSCP --set-dscp 61 + iptables -t mangle -A eqos -i br-lan -m length --length :256 -j DSCP --set-dscp 28 + iptables -t mangle -A eqos -o br-lan -m length --length :256 -j DSCP --set-dscp 60 + iptables -t mangle -A eqos -i br-lan -p udp -m hashlimit --hashlimit-mode srcip,srcport --hashlimit-name udpout --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j DSCP --set-dscp 27 + iptables -t mangle -A eqos -o br-lan -p udp -m hashlimit --hashlimit-mode dstip,dstport --hashlimit-name udpin --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j DSCP --set-dscp 59 + + ip6tables -t mangle -A eqos -i br-lan -j MARK --set-mark 31 + ip6tables -t mangle -A eqos -o br-lan -j MARK --set-mark 63 + ip6tables -t mangle -A eqos -p udp -i br-lan -j MARK --set-mark 30 + ip6tables -t mangle -A eqos -p udp -o br-lan -j MARK --set-mark 62 + ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 80 -j MARK --set-mark 29 + ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 80 -j MARK --set-mark 61 + ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 443 -j MARK --set-mark 29 + ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 443 -j MARK --set-mark 61 + ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 8080 -j MARK --set-mark 29 + ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 8080 -j MARK --set-mark 61 + ip6tables -t mangle -A eqos -i br-lan -p tcp --dport 8081 -j MARK --set-mark 29 + ip6tables -t mangle -A eqos -o br-lan -p tcp --dport 8081 -j MARK --set-mark 61 + ip6tables -t mangle -A eqos -i br-lan -m length --length :256 -j MARK --set-mark 28 + ip6tables -t mangle -A eqos -o br-lan -m length --length :256 -j MARK --set-mark 60 + ip6tables -t mangle -A eqos -i br-lan -p udp -m hashlimit --hashlimit-mode srcip,srcport --hashlimit-name udp6out --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j MARK --set-mark 27 + ip6tables -t mangle -A eqos -o br-lan -p udp -m hashlimit --hashlimit-mode dstip,dstport --hashlimit-name udp6in --hashlimit-above 5/sec --hashlimit-burst 5 --hashlimit-htable-expire 10000 --hashlimit-htable-gcinterval 10000 -j MARK --set-mark 59 + fi + iptables -t mangle -F PREROUTING + if [ $interface ]; then + bash /usr/sbin/loadbalance "$interface" + fi + config_foreach parse_device "device" + } stop_service() { eqos stop + iptables -t mangle -F PREROUTING } reload_service() { diff --git a/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos b/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos index 998b12904fd..f22b9209c45 100755 --- a/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos +++ b/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/eqos @@ -101,7 +101,7 @@ case "$1" in macaddr="$6" cnt=$(tc class show dev $dev | wc -l) - + interface="$7" if [ $id -lt 32 ]; then iptables -t mangle -D eqos -s $ip -j DSCP --set-dscp ${id} iptables -t mangle -D eqos -d $ip -j DSCP --set-dscp ${idpair} @@ -134,6 +134,12 @@ case "$1" in tc class add dev ${dev}-ifb parent 1:1 classid 1:1$cnt htb rate ${up}kbit ceil ${up}kbit tc filter add dev ${dev}-ifb parent 1:0 protocol ip u32 match ip src $ip flowid 1:1$cnt fi + if [ $interface ]; then + iptables -t mangle -D PREROUTING -s $ip -m conntrack --ctstate NEW -j MARK --set-mark 2"$interface" + iptables -t mangle -A PREROUTING -s $ip -m conntrack --ctstate NEW -j MARK --set-mark 2"$interface" + iptables -t mangle -D PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark + iptables -t mangle -A PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark + fi ;; *) echo "Usage: $0 [options]" diff --git a/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/loadbalance b/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/loadbalance new file mode 100755 index 00000000000..ea29167c17d --- /dev/null +++ b/package/mtk/applications/luci-app-eqos-mtk/root/usr/sbin/loadbalance @@ -0,0 +1,45 @@ +interface=$1 +array=(${interface//,/ }) + PPP_NUM=0 + + for var in ${array[@]} + do + let PPP_NUM=PPP_NUM+1 + done + + i=0 + for var in ${array[@]} + do + ipaddr=$(ip route show |grep default | grep $var | awk '{print $3 }') + iptables -t mangle -D PREROUTING -i br-lan -m conntrack --ctstate NEW -m statistic --mode nth --every $PPP_NUM --packet $i -j CONNMARK --set-mark 2"$i" + iptables -t mangle -D PREROUTING -i br-lan -m connmark --mark 2"$i" -j MARK --set-mark 2"$i" + iptables -t mangle -A PREROUTING -i br-lan -m conntrack --ctstate NEW -m statistic --mode nth --every $PPP_NUM --packet $i -j CONNMARK --set-mark 2"$i" + iptables -t mangle -A PREROUTING -i br-lan -m connmark --mark 2"$i" -j MARK --set-mark 2"$i" + ip rule del table 2"$i"0 + ip rule add fwmark 2"$i" table 2"$i"0 + ip route del default table 2"$i"0 + ip route add default via $ipaddr dev $var table 2"$i"0 + let i=i+1 + done + + + i=0 + for var in ${array[@]} + do + ipaddr=$(ip route show |grep default | grep $var | awk '{print $3 }') + iptables -t mangle -D PREROUTING -m conntrack --ctstate NEW -d $ipaddr/24 -j MARK --set-mark 2"$i" + iptables -t mangle -A PREROUTING -m conntrack --ctstate NEW -d $ipaddr/24 -j MARK --set-mark 2"$i" + let i=i+1 + done + + iptables -t mangle -D PREROUTING -p tcp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20 + iptables -t mangle -A PREROUTING -p tcp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20 + + iptables -t mangle -D PREROUTING -p udp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20 + iptables -t mangle -A PREROUTING -p udp --dport 443 -m conntrack --ctstate NEW -j MARK --set-mark 20 + + iptables -t mangle -D POSTROUTING -m conntrack --ctstate NEW -j CONNMARK --save-mark + iptables -t mangle -A POSTROUTING -m conntrack --ctstate NEW -j CONNMARK --save-mark + iptables -t mangle -D PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark + iptables -t mangle -A PREROUTING -i br-lan -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark + ip route flush cache diff --git a/package/mtk/applications/luci-app-mtwifi-cfg/po/zh_Hans/mtwifi-cfg.po b/package/mtk/applications/luci-app-mtwifi-cfg/po/zh_Hans/mtwifi-cfg.po index 5f07af6759b..dd777ec6435 100644 --- a/package/mtk/applications/luci-app-mtwifi-cfg/po/zh_Hans/mtwifi-cfg.po +++ b/package/mtk/applications/luci-app-mtwifi-cfg/po/zh_Hans/mtwifi-cfg.po @@ -37,5 +37,17 @@ msgstr "无线硬件加速" msgid "Wireless configuration error" msgstr "无线网络设置错误" +msgid "802.11V roam steering threshold" +msgstr "802.11V漫游引导阈值" + +msgid "802.11V roam target bssid" +msgstr "802.11V漫游引导目标BSSID" + +msgid "only supports mt_wifi driver" +msgstr "仅支持MTK闭源驱动。确认路由器lan ip同一网段" + +msgid "Band Steering" +msgstr "引导已连接双频2.4G设备至5G频段" + msgid "At least one MBSSID needs to be reserved" msgstr "至少需要保留1个MBSSID" diff --git a/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js b/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js index e51407b2277..8cf67b077a2 100644 --- a/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js +++ b/package/mtk/applications/luci-app-mtwifi-cfg/root/usr/share/luci-app-mtwifi-cfg/wireless-mtk.js @@ -975,10 +975,10 @@ return view.extend({ o.onclick = ui.createHandlerFn(s, network_updown, s.section, s.map); if (!isDisabled) { - o = ss.taboption('general', CBIWifiFrequencyValue, '_freq', '
' + _('Operating frequency')); - o.ucisection = s.section; - } - + o = ss.taboption('general', CBIWifiFrequencyValue, '_freq', '
' + _('Operating frequency')); + o.ucisection = s.section; + } + if (hwtype == 'mac80211') { o = ss.taboption('general', form.Flag, 'legacy_rates', _('Allow legacy 802.11b rates'), _('Legacy or badly behaving devices may require legacy 802.11b rates to interoperate. Airtime efficiency may be significantly reduced where these are used. It is recommended to not allow 802.11b rates where possible.')); o.depends({'_freq': '2g', '!contains': true}); @@ -1052,8 +1052,11 @@ return view.extend({ if (is_dbdc_main) { o = ss.taboption('advanced', form.Flag, 'whnat', _('Wireless HWNAT')); - o.default = o.enabled; - + o.default = o.enabled; + + o = ss.taboption('advanced', form.Flag, 'bandsteering', _('Band Steering')); + o.default = o.disabled; + o = ss.taboption('advanced', form.Value, 'dtim_period', _('DTIM Interval'), _('Delivery Traffic Indication Message Interval')); o.optional = true; o.placeholder = 1; @@ -1328,6 +1331,11 @@ return view.extend({ o = ss.taboption('advanced', form.Flag, 'ieee80211k', _('802.11k'), _('Enables The 802.11k standard provides information to discover the best available access point')); o.default = o.enabled; o.depends('mode', 'ap'); + + o = ss.taboption('advanced', form.Flag, 'ieee80211r', _('802.11r'), _('only supports mt_wifi driver')); + o.default = o.disabled; + o.depends('mode', 'ap'); + o = ss.taboption('advanced', form.Value, 'wpa_group_rekey', _('Time interval for rekeying GTK'), _('sec')); o.optional = true; @@ -1340,6 +1348,19 @@ return view.extend({ o.placeholder = 0; o.datatype = 'range(-100,0)'; o.depends('mode', 'ap'); + + o = ss.taboption('advanced', form.Value, 'steeringthresold', _('802.11V roam steering threshold'), _('dBm')); + o.optional = true; + o.placeholder = 0; + o.datatype = 'range(-100,0)'; + o.depends('mode', 'ap'); + + o = ss.taboption('advanced', form.DynamicList, 'steeringbssid',_('802.11V roam target bssid'), _('MAC-List')); + o.datatype = 'macaddr'; + o.optional = true; + o.placeholder = 0; + o.depends('mode', 'ap'); + o = ss.taboption('advanced', form.Value, 'assocthres', _('Station associate threshold'), _('dBm')); o.optional = true; diff --git a/package/mtk/applications/mtwifi-cfg/Makefile b/package/mtk/applications/mtwifi-cfg/Makefile index 0103eac952a..fb248120975 100644 --- a/package/mtk/applications/mtwifi-cfg/Makefile +++ b/package/mtk/applications/mtwifi-cfg/Makefile @@ -16,7 +16,8 @@ define Package/mtwifi-cfg CATEGORY:=MTK Properties SUBMENU:=Applications TITLE:=mtwifi configure scripts for mt798x - DEPENDS:=+iwinfo +wifi-dats +lua-cjson +datconf-lua @!PACKAGE_luci-app-mtk @!PACKAGE_wifi-profile + DEPENDS:=+iwinfo +wifi-dats +lua-cjson +datconf-lua +USE_UCLIBC:libpthread +USE_UCLIBC:librt +libkvcutil +libopenssl \ + +libnl-tiny @!PACKAGE_luci-app-mtk @!PACKAGE_wifi-profile endef define Build/Compile @@ -27,6 +28,8 @@ define Package/mtwifi-cfg/install $(INSTALL_DIR) $(1)/lib/netifd/wireless/ $(1)/lib/wifi/ $(INSTALL_DIR) $(1)/etc/hotplug.d/net/ + $(INSTALL_DIR) $(1)/etc/map/ + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface/ $(INSTALL_BIN) ./files/netifd/mtwifi.sh $(1)/lib/netifd/wireless/ $(INSTALL_BIN) ./files/mtwifi.sh $(1)/lib/wifi/ @@ -37,6 +40,18 @@ define Package/mtwifi-cfg/install $(INSTALL_BIN) ./files/l1util/l1util $(1)/sbin/ $(INSTALL_BIN) ./files/l1util/l1dat_parser.lua $(1)/usr/lib/lua/ $(INSTALL_DATA) ./files/hotplug/10-mtwifi-detect $(1)/etc/hotplug.d/net/ + + $(INSTALL_BIN) ./files/wapp/100-startwapp $(1)/etc/hotplug.d/iface/ + $(INSTALL_BIN) ./files/wapp/startwapp.sh $(1)/sbin/ + $(INSTALL_BIN) ./files/wapp/bs20 $(1)/sbin/ + $(INSTALL_BIN) ./files/wapp/wapp $(1)/sbin/ + $(INSTALL_BIN) ./files/wapp/wappctrl $(1)/sbin/ + $(INSTALL_BIN) ./files/wapp/setbssid $(1)/sbin/ + $(INSTALL_BIN) ./files/wapp/steeringsta $(1)/sbin/ + $(INSTALL_DATA) ./files/wapp/mapd_cfg $(1)/etc/map/ + $(INSTALL_DATA) ./files/wapp/wapp_ap.conf $(1)/etc/ + $(INSTALL_DATA) ./files/wapp/wapp_ap_ra0.conf $(1)/etc/ + $(INSTALL_DATA) ./files/wapp/1905d.cfg $(1)/etc/map/ endef $(eval $(call BuildPackage,mtwifi-cfg)) diff --git a/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg b/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg index f97c299b897..ac3cea7bc3e 100755 --- a/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg +++ b/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_cfg @@ -226,6 +226,7 @@ function mtwifi_up(devname, cfg, restore_vifs, is_dbdc) mtwifi_cfg_foreach_vif(cfg, "ap", start_vif) mtwifi_cfg_foreach_vif(cfg, "sta", start_vif) + os.execute("startwapp.sh") end function mtwifi_down(devname, cfg) @@ -244,6 +245,7 @@ function mtwifi_down(devname, cfg) end end end + os.execute("startwapp.sh") return reset_vifs end @@ -542,6 +544,7 @@ function mtwifi_cfg_setup(argv) set_dat(dats, apidx, "HideSSID", v.config.hidden) set_dat(dats, apidx, "WmmCapable", v.config.wmm) set_dat(dats, apidx, "RRMEnable", v.config.ieee80211k) + set_dat(dats, apidx, "FtSupport", v.config.ieee80211r) set_dat(dats, apidx, "RekeyInterval", v.config.wpa_group_rekey) set_dat(dats, apidx, "MuMimoDlEnable", v.config.mumimo_dl) set_dat(dats, apidx, "MuMimoUlEnable", v.config.mumimo_ul) diff --git a/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_defs.lua b/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_defs.lua index 28762ba1d6a..359dc022440 100644 --- a/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_defs.lua +++ b/package/mtk/applications/mtwifi-cfg/files/mtwifi-cfg/mtwifi_defs.lua @@ -57,6 +57,7 @@ mtwifi_defs.vif_cfgs = { ["HT_STBC"] = "1", ["IgmpSnEnable"] = "0", ["RRMEnable"] = "1", + ["FtSupport"] = "0", ["VHT_BW_SIGNAL"] = "0", ["VHT_LDPC"] = "1", ["VHT_SGI"] = "1", @@ -87,6 +88,7 @@ mtwifi_defs.chip_cfgs = { ["beacon_int"] = { "BeaconPeriod" , "100"}, ["dtim_period"] = { "DtimPeriod", "1"}, ["whnat"] = { "WHNAT", "1"}, + ["bandsteering"] = { "BandSteering", "0"}, } mtwifi_defs.reinstall_cfgs = { @@ -98,6 +100,7 @@ mtwifi_defs.iwpriv_ap_cfgs = { -- uci config = iwpriv set cmd , default value ["kicklow"] = {"KickStaRssiLow", "0"}, ["assocthres"] = {"AssocReqRssiThres" , "0"}, + ["steeringthresold"] = {"Steeringthresold" , "0"}, } mtwifi_defs.enc2dat = { diff --git a/package/mtk/applications/mtwifi-cfg/files/mtwifi.sh b/package/mtk/applications/mtwifi-cfg/files/mtwifi.sh index adbdfa06691..da89804b06e 100755 --- a/package/mtk/applications/mtwifi-cfg/files/mtwifi.sh +++ b/package/mtk/applications/mtwifi-cfg/files/mtwifi.sh @@ -44,7 +44,7 @@ detect_mtwifi() { set wireless.${dev}.mu_beamformer=1 set wireless.${dev}.noscan=${htbsscoex} set wireless.${dev}.serialize=1 - + set wireless.default_${dev}=wifi-iface set wireless.default_${dev}.device=${dev} set wireless.default_${dev}.network=lan @@ -57,3 +57,4 @@ EOF done fi } + diff --git a/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh b/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh index 8bb11942e44..a947f9506b0 100755 --- a/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh +++ b/package/mtk/applications/mtwifi-cfg/files/netifd/mtwifi.sh @@ -15,15 +15,15 @@ MTWIFI_CFG_IFNAME_KEY="mtwifi_ifname" drv_mtwifi_init_device_config() { config_add_int txpower beacon_int dtim_period - config_add_boolean mu_beamformer dbdc_main whnat + config_add_boolean mu_beamformer dbdc_main whnat bandsteering config_add_string country twt } drv_mtwifi_init_iface_config() { - config_add_string 'ssid:string' macfilter bssid kicklow assocthres - config_add_boolean wmm hidden isolate ieee80211k + config_add_string 'ssid:string' macfilter bssid kicklow assocthres steeringthresold + config_add_boolean wmm hidden isolate ieee80211k ieee80211r config_add_int wpa_group_rekey frag rts - config_add_array 'maclist:list(macaddr)' + config_add_array 'maclist:list(macaddr)' 'steeringbssid:list(macaddr)' config_add_boolean mumimo_dl mumimo_ul ofdma_dl ofdma_ul amsdu autoba uapsd } diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/100-startwapp b/package/mtk/applications/mtwifi-cfg/files/wapp/100-startwapp new file mode 100755 index 00000000000..0ddc6ee9b8a --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/100-startwapp @@ -0,0 +1,3 @@ +#!/bin/sh + +startwapp.sh diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/1905d.cfg b/package/mtk/applications/mtwifi-cfg/files/wapp/1905d.cfg new file mode 100755 index 00000000000..7aeb658dc34 --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/1905d.cfg @@ -0,0 +1,38 @@ +# Controller's ALID +map_controller_alid=00:0c:43:88:88:88 + +# Has MAP agent on this device +map_agent=1 + +# This device is a MAP root +map_root=0 + +# Agent's ALID +map_agent_alid=00:0c:43:22:22:22 + +# Default Backhault Type +bh_type=eth + +#Config Band setting of each Radio +radio_band=24G;5G;5G; + +#bridge interface +br_inf=br-lan + +#lan interface + +map_ver=R1 + +#fixed al_mac of al_inf(only wifi inf) mac +al_inf=ra0 + +bss_config_priority=ra0;rax0;apclix0 + +#ethernet device name used to read the switch table +#do not set if not understanding +#ethernet_dev_name= + +decrypt_fail_threshold=10 +gtk_rekey_interval=3600 +#Enable Ethernet Onboarding on WAN PORT only +ob_wan_only=0 diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/bs20 b/package/mtk/applications/mtwifi-cfg/files/wapp/bs20 new file mode 100755 index 00000000000..25b1db40ce6 Binary files /dev/null and b/package/mtk/applications/mtwifi-cfg/files/wapp/bs20 differ diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/mapd_cfg b/package/mtk/applications/mtwifi-cfg/files/wapp/mapd_cfg new file mode 100755 index 00000000000..9c2b71ab26c --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/mapd_cfg @@ -0,0 +1,90 @@ +mode=0 +lan_interface=eth0 +wan_interface=eth1 +DeviceRole=0 +APSteerRssiTh=-54 +force_roam_rssi_th=-70 +BhPriority2G=0 +BhPriority5GL=1 +BhPriority5GH=1 +BhPriority6G=1 +ChPlanningIdleByteCount= +ChPlanningIdleTime= +ChPlanningUserPreferredChannel5G= +ChPlanningUserPreferredChannel5GH= +ChPlanningUserPreferredChannel2G= +ChPlanningUserPreferredChannel6G= +ChPlanningInitTimeout=120 +NtwrkOptBootupWaitTime=45 +NtwrkOptConnectWaitTime=45 +NtwrkOptDisconnectWaitTime=45 +NtwrkOptPeriodicity=3600 +NetworkOptimizationScoreMargin=100 +BandSwitchTime= +ScanThreshold2g=-88 +ScanThreshold5g=-88 +ScanThreshold6g=-88 +LowRSSIAPSteerEdge_RE=25 +BhProfile0Valid= +BhProfile0Ssid= +BhProfile0AuthMode= +BhProfile0EncrypType= +BhProfile0WpaPsk= +BhProfile0RaID= +BhProfile1Ssid= +BhProfile1AuthMode= +BhProfile1EncrypType= +BhProfile1WpaPsk= +BhProfile1Valid= +BhProfile1RaID= +BhProfile2Ssid= +BhProfile2AuthMode= +BhProfile2EncrypType= +BhProfile2WpaPsk= +BhProfile2Valid= +BhProfile2RaID= +ChPlanningEnable=0 +ChPlanningEnableR2= +SteerEnable=1 +NetworkOptimizationEnabled=0 +AutoBHSwitching=1 +DhcpCtl=0 +ThirdPartyConnection=0 +MAP_QuickChChange=1 +bss_config_priority=ra0;rax0;apclix0 +DualBH= +MetricRepIntv=60 +MaxAllowedScan= +BHSteerTimeout=120 +NtwrkOptPostCACTriggerTime=30 +role_detection_external=0 +NetworkOptPrefer5Gover2G=0 +NetworkOptPrefer5Gover2GRetryCnt=0 +NonMAPAPEnable=1 +CentralizedSteering=0 +ChPlanningEnableR2withBW= +DivergentChPlanning=0 +LastMapMode= +NtwrkOptDataCollectionTime=60 +ChPlanningScanValidTime=14400 +NetOptUserSetPriority=0 +DESerialNumber=v3.0 +DESoftwareVersion=v3.0 +DEExecutionEnv=Linux-Openwrt +DEChipsetVendor=MediaTek +DEStaConEventPath= +SetPSCChannel_6G=0 +client_mac= +CUOverloadTh_2G=70 +CUOverloadTh_5G_H=80 +CUOverloadTh_5G_L=80 +dpp-uri= +dst_ip= +dst_port= +index=1 +name= +priority=1 +protocol= +srcc_port= +src_ip= +ssid= diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/setbssid b/package/mtk/applications/mtwifi-cfg/files/wapp/setbssid new file mode 100755 index 00000000000..902723cc0fc --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/setbssid @@ -0,0 +1,25 @@ +ra0_7981_channel="$(uci get wireless.MT7981_1_1.channel)" +ra0_7986_channel="$(uci get wireless.MT7986_1_1.channel)" +rax0_7981_channel="$(uci get wireless.MT7981_1_2.channel)" +rax0_7986_channel="$(uci get wireless.MT7986_1_2.channel)" +if [ "$ra0_7981_channel" -gt "0" ];then + wappctrl ra0 mbo nebor_op_ch $ra0_7981_channel +fi +if [ "$ra0_7986_channel" -gt "0" ];then + wappctrl ra0 mbo nebor_op_ch $ra0_7986_channel +fi +if [ "$rax0_7981_channel" -gt "0" ];then + wappctrl rax0 mbo nebor_op_ch $rax0_7981_channel +fi +if [ "$rax0_7986_channel" -gt "0" ];then + wappctrl rax0 mbo nebor_op_ch $rax0_7986_channel +fi +bssid=$2 +array=(${bssid//\/ }) +for var in ${array[@]} + do + echo $var + wappctrl $1 mbo nebor_bssid $var + wappctrl $1 mbo add_test_nr $var + done + diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/startwapp.sh b/package/mtk/applications/mtwifi-cfg/files/wapp/startwapp.sh new file mode 100755 index 00000000000..bbe503a0f0d --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/startwapp.sh @@ -0,0 +1,105 @@ +killall bs20 +killall wapp +sleep 2 +br0_mac=$(cat /sys/class/net/br-lan/address) +ctrlr_al_mac=$br0_mac +agent_al_mac=$br0_mac +ra0=0 +rax0=0 +sed -i "s/map_controller_alid=.*/map_controller_alid=${ctrlr_al_mac}/g" /etc/map/1905d.cfg +sed -i "s/map_agent_alid=.*/map_agent_alid=${agent_al_mac}/g" /etc/map/1905d.cfg + + ra0_7981="$(uci get wireless.MT7981_1_1.bandsteering)" + ra0_7986="$(uci get wireless.MT7986_1_1.bandsteering)" + if [ "$ra0_7981" -eq "1" ] || [ "$ra0_7986" -eq "1" ]; then + ra0=1 + rax0=1 + fi + + ra0_7981="$(uci get wireless.MT7981_1_1.ieee80211r)" + ra0_7986="$(uci get wireless.MT7986_1_1.ieee80211r)" + if [ "$ra0_7981" -eq "1" ] || [ "$ra0_7986" -eq "1" ]; then + ra0=1 + fi + + ra0_7981="$(uci get wireless.default_MT7981_1_2.steeringthresold)" + ra0_7986="$(uci get wireless.default_MT7981_1_2.steeringthresold)" + if [ "$ra0_7981" -lt "0" ] || [ "$ra0_7986" -lt "0" ]; then + ra0=1 + fi + + ra0_7981="$(uci get wireless.default_MT7981_1_1.disabled)" + ra0_7986="$(uci get wireless.default_MT7986_1_1.disabled)" + if [ "$ra0_7981" -eq "1" ] || [ "$ra0_7986" -eq "1" ]; then + ra0=0 + rax0=0 + fi + + rax0_7981="$(uci get wireless.MT7981_1_2.ieee80211r)" + rax0_7986="$(uci get wireless.MT7986_1_2.ieee80211r)" + if [ "$rax0_7981" -eq "1" ] || [ "$rax0_7986" -eq "1" ]; then + rax0=1 + fi + + rax0_7981="$(uci get wireless.default_MT7981_1_2.steeringthresold)" + rax0_7986="$(uci get wireless.default_MT7986_1_2.steeringthresold)" + if [ "$rax0_7981" -lt "0" ] || [ "$rax0_7986" -lt "0" ]; then + rax0=1 + fi + + rax0_7981="$(uci get wireless.default_MT7981_1_2.disabled)" + rax0_7986="$(uci get wireless.default_MT7986_1_2.disabled)" + if [ "$rax0_7981" -eq "1" ] || [ "$rax0_7986" -eq "1" ]; then + rax0=0 + fi + + + if [ "$rax0" -eq "1" ] && [ "$ra0" -eq "1" ] ; then + wapp -d1 -v2 -cra0 -crax0 > /dev/null& + elif [ "$ra0" -eq "1" ] && [ "$rax0" -eq "0" ] ; then + wapp -d1 -v2 -cra0 > /dev/null& + elif [ "$rax0" -eq "1" ] && [ "$ra0" -eq "0" ] ; then + wapp -d1 -v2 -crax0 > /dev/null + fi +sleep 1 +if [ "$rax0" -eq "1" ] || [ "$ra0" -eq "1" ] ; then +iwpriv ra0 set mapR2Enable=0 +iwpriv ra0 set mapTSEnable=0 +iwpriv ra0 set mapR3Enable=0 +iwpriv ra0 set DppEnable=0 +iwpriv rax0 set mapR2Enable=0 +iwpriv rax0 set mapTSEnable=0 +iwpriv rax0 set mapR3Enable=0 +iwpriv rax0 set DppEnable=0 +iwpriv ra0 set mapEnable=2 +iwpriv rax0 set mapEnable=2 +bs20 & +wappctrl rax0 mbo reset_default +wappctrl ra0 mbo reset_default +rax0_7981="$(uci get wireless.default_MT7981_1_2.steeringbssid)" +rax0_7986="$(uci get wireless.default_MT7986_1_2.steeringbssid)" +if [ $rax0_7981 ]; then + bash setbssid rax0 "$rax0_7981" +fi + +if [ $rax0_7986 ]; then + bash setbssid rax0 "$rax0_7986" +fi + +ra0_7981="$(uci get wireless.default_MT7981_1_1.steeringbssid)" +bash setbssid ra0 "$ra0_7981" +ra0_7986="$(uci get wireless.default_MT7986_1_1.steeringbssid)" +if [ $ra0_7981 ]; then + bash setbssid ra0 "$ra0_7981" +fi + +if [ $ra0_7986 ]; then + bash setbssid ra0 "$ra0_7986" +fi + +fi + + + + + diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/steeringsta b/package/mtk/applications/mtwifi-cfg/files/wapp/steeringsta new file mode 100755 index 00000000000..f7003e49caf --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/steeringsta @@ -0,0 +1,11 @@ +#!/bin/sh +case "$1" in + "rax0") + wappctrl rax0 mbo steer_sta $2 + return 0 + ;; + *) + wappctrl ra0 mbo steer_sta $2 + return 0 + ;; +esac diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/wapp b/package/mtk/applications/mtwifi-cfg/files/wapp/wapp new file mode 100755 index 00000000000..a1d89f3dadb Binary files /dev/null and b/package/mtk/applications/mtwifi-cfg/files/wapp/wapp differ diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/wapp_ap.conf b/package/mtk/applications/mtwifi-cfg/files/wapp/wapp_ap.conf new file mode 100755 index 00000000000..8cae5dad7f3 --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/wapp_ap.conf @@ -0,0 +1,3 @@ +# conf_list +# all configuation files +conf_list=/etc/wapp_ap_ra0.conf diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/wapp_ap_ra0.conf b/package/mtk/applications/mtwifi-cfg/files/wapp/wapp_ap_ra0.conf new file mode 100755 index 00000000000..97b8294fc76 --- /dev/null +++ b/package/mtk/applications/mtwifi-cfg/files/wapp/wapp_ap_ra0.conf @@ -0,0 +1,475 @@ +##hospot2.0 ap configuration file## + +# Interface +# network interface name +interface=ra0 + +# Interworking +# 0: Disable +# 1: Enable +interworking=1 + +# Access Network Type +# 0: Private network +# 1: Private network with guest access +# 2: Chargeable public network +# 3: Free public network +# 4: Personal Device Network +# 5: Emergency Services Only Network +# 6-13: Reserved +#14: Test or experimental +#15: Wildcard +access_network_type=0 + +# Internet +# 0: Do not have connectivity to the Internet +# 1: The network provides connectivity to the Internet +internet=0 + +# Venue Group +# 0: Unspecified +# 1: Assembly +# 2: Business +# 3: Eductional +# 4: Factory and Industrial +# 5: Institutional +# 6: Mercantile +# 7: Residentail +# 8: Storage +# 9: Utility and Miscellaneous +#10: Vehicular +#11: Outdoor +#12-255 : Reserved +venue_group=0 + +# Venue Type +# Unspecified +# 0: Unspecified +# 1-255: Reserved +# +# Assembly +# 0: Unspecified ssembly +# 1: Arena +# 2: Stadium +# 3: Passenger Terminal (e.g airport, bus, ferry, train station) +# 4: Amphitheater +# 5: Amusement Part +# 6: Place of Worship +# 7: Convention Center +# 8: Library +# 9: Museum +# 10: Restaurant +# 11: Theater +# 12: Bar +# 13: Coffee Shop +# 14: Zoo or Aquarium +# 15: Emergency COordination Center +# 16-255: Reserved +# Business +# 0: Unspecified Business +# 1: Doctor or Dentist office +# 2: Bank +# 3: Fire Station +# 4: Police Station +# 5: Reserved +# 6: Post Office +# 7: Professtional Office +# 8: Research and Development Facility +# 9: Attorney Office +# 10-255: Reserved +# Eductional +# 0: Unspecified Educational +# 1: School, Primary +# 2: School, Secondary +# 3: University or College +# 4-255: Reserved +# Factory and Industrial +# 0: Unspecified Factory and INdustrial +# 1: Factory +# 2-255: Reserved +# Institutional +# 0: Unspecified Institutional +# 1: Hospital +# 2: Long-Term Care Facility +# 3: Alcohol and Drug Re-habilitation Center +# 4: Group Home +# 5: Prison or Jail +# 6-255: Reserved +# Mercantile +# 0: Unspecified Mercantile +# 1: Retail Store +# 2: Grocery Market +# 3: Automotive Serive Station +# 4: Shopping Mall +# 5: Gas Station +# 6-255: Reserved +# Residentail +# 0: Unspecified Residentail +# 1: Private Residence +# 2: Hotel or Motel +# 3: Dormitory +# 4: Boarding House +# 5-255: Reserved +# Storage +# 0: Unspecified Storage +# 1-255: Reserved +# Utility and Miscellaneous +# 0: Unspecified Utility and Miscellaneous +# 1-255: Reserved +# Vehicular +# 0: Unspecified Vehicular +# 1: Automobile or Truck +# 2: Airplane +# 3: Bus +# 4: Ferry +# 5: Ship or Boat +# 6: Train +# 7: Motor Bike +# 8-255: Reserved +# Outdoor +# 0:Unspecified Outdoor +# 1: Muni-mesh Network +# 2: City Park +# 3: Rest Area +# 4: Traffic Control +# 5: Bus Stop +# 6: Kiosk +# 7-255: Reserved +venue_type=8 + +# ANQP Query +# Enabled(1)/Disabled(0) +anqp_query=1 + +# MIH Information Service Advertisement Protocol +mih_support=0 + +# Venue Name +# language,name +venue_name=eng%{Wi-Fi Alliance +2989 Copper Road +Santa Clara, CA 95051, USA} +venue_name=chi%{Wi-Fi联盟实验室 +二九八九年库柏路 +圣克拉拉, 加利福尼亚95051, 美国} + +hessid=bssid + +roaming_consortium_oi=50-6F-9A,00-1B-C5-04-BD + +# Advertisement Protocol ID +# 0: Access Network Query Protocol +# 1: MIH Information Service +# 2: MIH Command and Event Service Capability Discovery +# 3: Emergency Alert System(EAS) +# 4-220 : Reserved +# 221: Vendor Specific +# 222-255: Reserved +advertisement_proto_id=0 + +domain_name=wi-fi.org + +# Network Autentication Type +# Network Authentication Type Indicator;Re-direct URL +network_auth_type=1 + +# IPv4Type +# 0: Address type not available +# 1: Public IPv4 address available +# 2: Port-restricted IPv4 address available +# 3: Single NATed private IPv4 address available +# 4: Double NATed private IPv4 address available +# 5: Port-restricted IPv4 address and single NATed IPv4 address available +# 6: Port-restricted IPv4 address and double NATed IPv4 address available +# 7: Availability of the address type in not known +# 8-63: Reserved +ipv4_type=3 + +# IPv6TYpe +# 0: Address type not available +# 1: Address type available +# 2: Availability of the address type not known +# 3: Reserved +ipv6_type=0 + +# anqp domain ID +anqp_domain_id=1 + +# Venue URL +venue_url=1,https://venue-server.r2m-testbed.wi-fi.org/floorplans/index.html +venue_url=1,https://venue-server.r2m-testbed.wi-fi.org/directory/index.html + +#Operator icon metadata +icon_metadata=160:76:eng:image/png:icon_red_eng.png + +# NAIRealmData +nai_realm_data={ + nai_realm=mail.example.com + eap_method=eap-ttls + auth_param=2:4 + auth_param=5:7 +} +nai_realm_data={ + nai_realm=cisco.com + eap_method=eap-ttls + auth_param=2:4 + auth_param=5:7 +} +nai_realm_data={ + nai_realm=wi-fi.org + eap_method=eap-ttls + auth_param=2:4 + auth_param=5:7 + eap_method=eap-tls + auth_param=5:6 +} +nai_realm_data={ + nai_realm=example.com + eap_method=eap-tls + auth_param=5:6 +} + +# Advice of Charge +advice_of_charge_data={ + advice_of_charge_type=0 + aoc_realm_encoding=0 + aoc_realm= + aoc_language=ENG + aoc_currency_code=USD + aoc_plan_info='Wi-Fi access for 1 hour, while you wait at the gate, $0.99' + aoc_language=FRA + aoc_currency_code=CAD + aoc_plan_info='AccèWi-Fi pendant 1 heure, pendant que vous attendez àa porte, 0,99 $' +} + +advice_of_charge_data={ + advice_of_charge_type=1 + aoc_realm_encoding=0 + aoc_realm= + aoc_language=ENG + aoc_currency_code=USD + aoc_plan_info='Download videos for your flight, $2.99 for 10GB' + aoc_language=FRA + aoc_currency_code=CAD + aoc_plan_info='Téchargez des vidé pour votre vol, 2,99 $ pour 10 Go' +} + +advice_of_charge_data={ + advice_of_charge_type=3 + aoc_realm_encoding=0 + aoc_realm='service-provider.com;federation.example.com' + aoc_language=ENG + aoc_currency_code=USD + aoc_plan_info='Free with your subscription!' +} + +# Terms and Conditions FileName +t_c_filename=0 + +# Terms and Conditions Server URL +t_c_server_url=https://tandc-server.r2m-testbed.wi-fi.org + +# Terms and Conditions TimeStamp +t_c_timestamp=0 + +#OSU Providers Nai list +osu_providers_nai_list=21,anonymous@hotspot.net + +# Following are HS2.0 ANQP response # +# OperatorFirendName +op_friendly_name=eng,Wi-Fi Alliance +op_friendly_name=chi,Wi-Fi联盟 + +# Connection Capability +proto_port={ + ip_protocol=1 + port=0 + status=0 +} +proto_port={ + ip_protocol=6 + port=20 + status=1 +} +proto_port={ + ip_protocol=6 + port=22 + status=0 +} +proto_port={ + ip_protocol=6 + port=80 + status=1 +} +proto_port={ + ip_protocol=6 + port=443 + status=1 +} +proto_port={ + ip_protocol=6 + port=1723 + status=0 +} +proto_port={ + ip_protocol=6 + port=5060 + status=0 +} +proto_port={ + ip_protocol=17 + port=500 + status=1 +} +proto_port={ + ip_protocol=17 + port=5060 + status=0 +} +proto_port={ + ip_protocol=17 + port=4500 + status=1 +} +proto_port={ + ip_protocol=50 + port=0 + status=1 +} + +wan_metrics=n/a + +# 3GPP cellular network information +plmn={ + mcc=310 + mnc=026 +} +plmn={ + mcc=208 + mnc=00 +} +plmn={ + mcc=208 + mnc=01 +} +plmn={ + mcc=208 + mnc=02 +} +plmn={ + mcc=450 + mnc=02 +} +plmn={ + mcc=450 + mnc=04 +} + +# Operating class +operating_class=81,115 + +preferred_candi_list_included=0 + +abridged=0 + +disassociation_imminent=0 + +bss_termination_included=0 + +ess_disassociation_imminent=1 + +disassociation_timer=100 + +validity_interval=200 + +# BSS Termination Duration +bss_termination_duration=n/a + +session_information_url=remediation-server.R2-testbed.wi-fi.org + +bss_transisition_candi_list_preferences=n/a + +timezone=UTC8 + +# Downstream Group-Aaddressed Forwrding +dgaf_disabled=0 + +proxy_arp=0 + +# 0: L2FilterDisable +# 1: L2FilterBuiltIn +# 2: L2FilterExternal +l2_filter=0 + +icmpv4_deny=0 + +# p2p management +p2p_cross_connect_permitted=0 + +mmpdu_size=1024 + +# 0: server reacheable +# 1: server not reachable for 2F test +# 2: server not reachable for 4F test +external_anqp_server_test=0 + +# GAS Comeback Delay in TUs +gas_cb_delay=1 + +hs2_openmode_test=0 + +icon_path=/etc/ + +osu_providers_list={ + osu_friendly_name=eng:SP Red Test Only + osu_friendly_name=kor:SP 레드 시험 만 + osu_server_uri=https://osu-server.R2-testbed-RKS.wi-fi.org:9443/OnlineSignup/services/ + osu_method=1 + icon=128:61:zxx:image/png:icon_red_zxx.png + icon=160:76:eng:image/png:icon_red_eng.png + osu_nai=n/a + osu_service_desc=eng:Free service for test purpose + osu_service_desc=kor:테스트 목적으로 무료 서비스 +} + +anonymous_nai=n/a + +osu_interface=ra1 + +# 0:encrypt osu ssid +# 1:legacy osu ssid +# 2:test mode +legacy_osu=2 + +# Qosmap +# 0: Disable +# 1: Enable +qosmap=1 + +dscp_range=08:15:0:7:255:255:16:31:32:39:255:255:40:47:255:255 + +dscp_exception=53:2:22:6 + +# BSS Load IE test +# 0: Disable daemon control, BSS IE control by driver +# 1: Enable daemon control, hs daemon set station count and cu to driver +# 2: Enable daemon control, hs daemon disable BSS Load IE to driver +qload_test=0 + +qload_cu=50 + +qload_sta_cnt=1 + +icon_tag=1 + +mbo_ap_cdcp=1 + +mbo_ap_assoc_disallow_reason=0 + +mbo_ap_assoc_retry_delay=0 + +mbo_ap_transition_reason_code=0 + +#0x40 +mbo_ap_capability=64 + diff --git a/package/mtk/applications/mtwifi-cfg/files/wapp/wappctrl b/package/mtk/applications/mtwifi-cfg/files/wapp/wappctrl new file mode 100755 index 00000000000..3ec54820e78 Binary files /dev/null and b/package/mtk/applications/mtwifi-cfg/files/wapp/wappctrl differ diff --git a/package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin b/package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin index 3bf6467735c..7081155681a 100644 Binary files a/package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin and b/package/mtk/drivers/mt_wifi/files/mt7981-default-eeprom/MT7981_iPAiLNA_EEPROM.bin differ diff --git a/package/mtk/drivers/mt_wifi/patches/020-wapp-increase--rssi.patch b/package/mtk/drivers/mt_wifi/patches/020-wapp-increase--rssi.patch new file mode 100644 index 00000000000..cbd593dec23 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches/020-wapp-increase--rssi.patch @@ -0,0 +1,18 @@ +--- a/mt_wifi/embedded/wapp/wapp.c 2022-11-27 21:58:55.000000000 +0800 ++++ b/mt_wifi/embedded/wapp/wapp.c 2023-12-28 22:29:52.260048734 +0800 +@@ -504,6 +504,12 @@ + } + + cli_info->uplink_rssi = RTMPAvgRssi(pAd, &mac_entry->RssiSample); ++ ++ cli_info->uplink += 400; ++ cli_info->downlink += 400; ++ cli_info->uplink_rssi += 30; ++ if (WMODE_CAP_5G(mac_entry->wdev->PhyMode)) ++ {cli_info->uplink_rssi -=25;}; + #ifdef CONFIG_DOT11V_WNM + cli_info->cli_caps.btm_capable = mac_entry->bBSSMantSTASupport == TRUE ? 1 : 0; + #endif + wext_send_wapp_qry_rsp(pAd->net_dev, &event); + } + } diff --git a/package/mtk/drivers/mt_wifi/patches/021-add-roam-steering-setting.patch b/package/mtk/drivers/mt_wifi/patches/021-add-roam-steering-setting.patch new file mode 100644 index 00000000000..269f0dd7661 --- /dev/null +++ b/package/mtk/drivers/mt_wifi/patches/021-add-roam-steering-setting.patch @@ -0,0 +1,128 @@ +--- a/mt_wifi/embedded/ap/ap.c 2022-11-27 21:58:55.000000000 +0800 ++++ b/mt_wifi/embedded/ap/ap.c 2024-01-02 09:12:33.129403401 +0800 +@@ -2892,6 +2892,11 @@ + VOID MacTableMaintenance(RTMP_ADAPTER *pAd) + { + int wcid, startWcid, i; ++ char path[20]={0}; ++ char arg1[6]={0}; ++ char arg2[24]={0}; ++ char *argv[]={path,arg1,arg2,NULL}; ++ char *envp[]={NULL}; + #ifdef DOT11_N_SUPPORT + BOOLEAN bRdgActive = FALSE; + BOOLEAN bRalinkBurstMode; +@@ -3963,6 +3968,24 @@ + } + + avgRssi = RTMPAvgRssi(pAd, &pEntry->RssiSample); ++ ++ if ( pEntry->RssiSample.Rssi_Updated && pMbss->SteeringThreshold && ++ (avgRssi < pMbss->SteeringThreshold)) { ++ ++ MTWF_DBG(pAd, DBG_CAT_AP, DBG_SUBCAT_ALL, DBG_LVL_NOTICE, ++ "Steering STA "MACSTR", RSSI SteeringThreshold Thres[%d]-[%d]\n", ++ MAC2STR(pEntry->Addr), pMbss->SteeringThreshold, avgRssi); ++ ++ if (WMODE_CAP_2G(pEntry->wdev->PhyMode)) { ++ snprintf(argv[0], sizeof(path), "/sbin/steeringsta"); ++ snprintf(argv[1], sizeof(arg1), "ra0"); ++ snprintf(argv[2], sizeof(arg2), ""MACSTR"",MAC2STR(pEntry->Addr));} ++ else { ++ snprintf(argv[0], sizeof(path), "/sbin/steeringsta"); ++ snprintf(argv[1], sizeof(arg1), "rax0"); ++ snprintf(argv[2], sizeof(arg2), ""MACSTR"",MAC2STR(pEntry->Addr));} ++ call_usermodehelper(path, argv, envp,UMH_NO_WAIT); ++ } + + if ( pEntry->RssiSample.Rssi_Updated && pMbss->RssiLowForStaKickOut && + (avgRssi < pMbss->RssiLowForStaKickOut)) { +@@ -3984,6 +4007,7 @@ + REASON_DEAUTH_STA_LEAVING); + #endif + } ++ + + if (bDisconnectSta) { + /* send wireless event - for ageout */ +--- a/mt_wifi/embedded/ap/ap_cfg.c 2022-11-27 21:58:55.000000000 +0800 ++++ b/mt_wifi/embedded/ap/ap_cfg.c 2024-01-01 00:53:22.132505954 +0800 +@@ -419,6 +419,7 @@ + INT Set_AP_ASSOC_REQ_RSSI_THRESHOLD(RTMP_ADAPTER *pAd, RTMP_STRING *arg); + + INT Set_AP_KickStaRssiLow_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); ++INT Set_AP_SteeringThreshold_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); + + INT Set_BasicRate_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); + +@@ -1251,6 +1252,7 @@ + #endif /* SPECIFIC_TX_POWER_SUPPORT */ + {"AssocReqRssiThres", Set_AP_ASSOC_REQ_RSSI_THRESHOLD}, + {"KickStaRssiLow", Set_AP_KickStaRssiLow_Proc}, ++ {"Steeringthresold", Set_AP_SteeringThreshold_Proc}, + {"PtkRekey", Set_PtkRekey_Proc}, + #ifdef OCE_SUPPORT + {"OceRssiThreshold", Set_OceRssiThreshold_Proc}, +@@ -14528,6 +14530,16 @@ + TRUE if all parameters are OK, FALSE otherwise + ========================================================================== + */ ++ ++/* ++ ========================================================================== ++ Description: ++ Set lower limit for AP steering a STA. ++ Return: ++ TRUE if all parameters are OK, FALSE otherwise ++ ========================================================================== ++*/ ++ + INT Set_AP_KickStaRssiLow_Proc( + IN PRTMP_ADAPTER pAd, + IN RTMP_STRING *arg) +@@ -14555,6 +14567,35 @@ + + return TRUE; + } ++ ++ ++INT Set_AP_SteeringThreshold_Proc( ++ IN PRTMP_ADAPTER pAd, ++ IN RTMP_STRING *arg) ++{ ++ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; ++ UCHAR apidx = pObj->ioctl_if; ++ UINT j; ++ CHAR rssi; ++ ++ rssi = os_str_tol(arg, 0, 10); ++ ++ if (rssi == 0) ++ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "Disable SteeringThreshold Function\n"); ++ else if (rssi > 0 || rssi < -100) { ++ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, "SteeringThreshold Value Error.\n"); ++ return FALSE; ++ } ++ ++ pAd->ApCfg.MBSSID[apidx].SteeringThreshold = rssi; ++ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "I/F(ra%d) SteeringThreshold=%d\n", apidx, ++ pAd->ApCfg.MBSSID[apidx].SteeringThreshold); ++ ++ for (j = BSS0; j < pAd->ApCfg.BssidNum; j++) ++ MTWF_DBG(pAd, DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_INFO, "%d. ==> %d\n", j, pAd->ApCfg.MBSSID[j].SteeringThreshold); ++ ++ return TRUE; ++} + + /* + ========================================================================== +--- a/mt_wifi/embedded/include/rtmp.h 2022-11-27 21:58:55.000000000 +0800 ++++ b/mt_wifi/embedded/include/rtmp.h 2024-01-01 01:04:57.047724405 +0800 +@@ -2971,6 +2971,7 @@ + /* YF@20120417: Avoid connecting to AP in Poor Env, value 0 fOr disable. */ + CHAR AssocReqRssiThreshold; + CHAR RssiLowForStaKickOut; ++ CHAR SteeringThreshold; + + #ifdef CUSTOMER_VENDOR_IE_SUPPORT + /*For AP vendor ie*/ diff --git a/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b0.dat b/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b0.dat index 5d1e5400280..007e4ed0b0e 100644 --- a/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b0.dat +++ b/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b0.dat @@ -232,7 +232,7 @@ LinkTestSupport=0 MACRepeaterEn= MACRepeaterOuiMode=2 MapEnable=0 -MapMode=0 +MapMode=2 MboSupport=1 MbssMaxStaNum=64 MeshAuthMode= diff --git a/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b1.dat b/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b1.dat index 051b1fb1086..fda40feda6c 100644 --- a/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b1.dat +++ b/package/mtk/drivers/wifi-profile/files/mt7981/mt7981.dbdc.b1.dat @@ -70,7 +70,7 @@ AuthMode=OPEN AutoChannelSelect=3 AutoChannelSkipList= AutoProvisionEn=0 -BandSteering=0 +BandSteering=1 BasicRate=15 BcnProt=0 BeaconPeriod=100 @@ -234,7 +234,7 @@ LinkTestSupport=0 MACRepeaterEn= MACRepeaterOuiMode=2 MapEnable=0 -MapMode=0 +MapMode=2 MboSupport=1 MbssMaxStaNum=64 MeshAuthMode= diff --git a/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b0.dat b/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b0.dat index 38307543984..bd8a9fb4f0e 100644 --- a/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b0.dat +++ b/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b0.dat @@ -72,6 +72,7 @@ AutoChannelSelect=3 AutoChannelSkipList= AutoProvisionEn=0 BandSteering=0 +QoSR1Enable=1 BasicRate=15 BcnProt=0 BeaconPeriod=100 diff --git a/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b1.dat b/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b1.dat index 6a131542d2f..23007f37246 100644 --- a/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b1.dat +++ b/package/mtk/drivers/wifi-profile/files/mt7986-ax4200/mt7986-ax4200.dbdc.b1.dat @@ -71,7 +71,8 @@ AuthMode=OPEN AutoChannelSelect=3 AutoChannelSkipList= AutoProvisionEn=0 -BandSteering=0 +BandSteering=1 +QoSR1Enable=1 BasicRate=15 BcnProt=0 BeaconPeriod=100 diff --git a/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b0.dat b/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b0.dat index ef25d7a6145..81dd7a82fc3 100644 --- a/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b0.dat +++ b/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b0.dat @@ -72,6 +72,7 @@ AutoChannelSelect=3 AutoChannelSkipList= AutoProvisionEn=0 BandSteering=0 +QoSR1Enable=1 BasicRate=15 BcnProt=0 BeaconPeriod=100 diff --git a/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b1.dat b/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b1.dat index a1e7b97120c..a116464d49c 100644 --- a/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b1.dat +++ b/package/mtk/drivers/wifi-profile/files/mt7986/mt7986-ax6000.dbdc.b1.dat @@ -71,7 +71,8 @@ AuthMode=OPEN AutoChannelSelect=3 AutoChannelSkipList= AutoProvisionEn=0 -BandSteering=0 +BandSteering=1 +QoSR1Enable=1 BasicRate=15 BcnProt=0 BeaconPeriod=100 diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 97ec3913205..419136ca184 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -13,14 +13,14 @@ PKG_RELEASE:=6 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/paulusmack/ppp -PKG_SOURCE_DATE:=2020-10-03 -PKG_SOURCE_VERSION:=ad3937a0a38a696eb1a37dbf8f92e8e6072cdccb -PKG_MIRROR_HASH:=c5b39615eb62728431b19f3ae5428eb1e2fc705b4b7b960228fe5b5d7b5a4bca +PKG_SOURCE_DATE:=2021-01-04 +PKG_SOURCE_VERSION:=4fb319056f168bb8379865b91b4fd3e1ada73f1e +PKG_MIRROR_HASH:=429cb5fcff36e1d8698766130711d4764347f08b83233dfb4831bea21616efef PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-4-Clause PKG_CPE_ID:=cpe:/a:samba:ppp -PKG_RELEASE_VERSION:=2.4.8 +PKG_RELEASE_VERSION:=2.4.9 PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE) PKG_BUILD_DEPENDS:=libpcap @@ -242,7 +242,7 @@ endef define Package/ppp-mod-pppoe/install $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION) - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/rp-pppoe.so \ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_RELEASE_VERSION)/pppoe.so \ $(1)/usr/lib/pppd/$(PKG_RELEASE_VERSION)/ endef diff --git a/package/network/services/ppp/files/etc/ppp/options b/package/network/services/ppp/files/etc/ppp/options index dbb2bdb3e25..61d535c2341 100644 --- a/package/network/services/ppp/files/etc/ppp/options +++ b/package/network/services/ppp/files/etc/ppp/options @@ -6,3 +6,5 @@ nopcomp nocrtscts lock maxfail 0 +lcp-echo-failure 5 +lcp-echo-interval 5 diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index fb98fa60c5a..08653b233e0 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -74,7 +74,7 @@ ppp_generic_init_config() { proto_config_add_string pppd_options proto_config_add_string 'connect:file' proto_config_add_string 'disconnect:file' - proto_config_add_string ipv6 + [ -e /proc/sys/net/ipv6 ] && proto_config_add_string ipv6 proto_config_add_boolean authfail proto_config_add_int mtu proto_config_add_string pppname @@ -88,7 +88,9 @@ ppp_generic_setup() { local config="$1"; shift local localip - json_get_vars ipv6 ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns + json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns + + [ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6 if [ "$ipv6" = 0 ]; then ipv6="" @@ -138,7 +140,6 @@ ppp_generic_setup() { ${localip:+$localip:} \ ${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adaptive} \ ${ipv6:++ipv6} \ - ${ipv6:-noipv6} \ ${autoipv6:+set AUTOIPV6=1} \ ${ip6table:+set IP6TABLE=$ip6table} \ ${peerdns:+set PEERDNS=$peerdns} \ @@ -150,9 +151,9 @@ ppp_generic_setup() { ${connect:+connect "$connect"} \ ${disconnect:+disconnect "$disconnect"} \ ip-up-script /lib/netifd/ppp-up \ - ipv6-up-script /lib/netifd/ppp6-up \ + ${ipv6:+ipv6-up-script /lib/netifd/ppp6-up} \ ip-down-script /lib/netifd/ppp-down \ - ipv6-down-script /lib/netifd/ppp-down \ + ${ipv6:+ipv6-down-script /lib/netifd/ppp-down} \ ${mtu:+mtu $mtu mru $mtu} \ "$@" $pppd_options } @@ -242,7 +243,7 @@ proto_pppoe_setup() { ppp_generic_setup "$config" \ $syncppp_option \ - plugin rp-pppoe.so \ + plugin pppoe.so \ ${ac:+rp_pppoe_ac "$ac"} \ ${service:+rp_pppoe_service "$service"} \ ${host_uniq:+host-uniq "$host_uniq"} \ @@ -339,7 +340,7 @@ proto_pptp_teardown() { [ -n "$INCLUDE_ONLY" ] || { add_protocol ppp - [ -f /usr/lib/pppd/*/rp-pppoe.so ] && add_protocol pppoe + [ -f /usr/lib/pppd/*/pppoe.so ] && add_protocol pppoe [ -f /usr/lib/pppd/*/pppoatm.so ] && add_protocol pppoa [ -f /usr/lib/pppd/*/pptp.so ] && add_protocol pptp } diff --git a/package/network/services/ppp/patches/010-use_target_for_configure.patch b/package/network/services/ppp/patches/010-use_target_for_configure.patch index 7deac0e446b..9e8618f83ce 100644 --- a/package/network/services/ppp/patches/010-use_target_for_configure.patch +++ b/package/network/services/ppp/patches/010-use_target_for_configure.patch @@ -9,16 +9,16 @@ Signed-off-by: Jo-Philipp Wich --- a/configure +++ b/configure -@@ -8,9 +8,9 @@ SYSCONF=/etc - # if [ -d /NextApps ]; then - # system="NeXTStep" - # else -- system=`uname -s` -- release=`uname -r` -- arch=`uname -m` -+ system=${UNAME_S:-`uname -s`} -+ release=${UNAME_R:-`uname -r`} -+ arch=${UNAME_M:-`uname -m`} - # fi +@@ -10,9 +10,9 @@ CROSS_COMPILE= + CC=cc + CFLAGS= + +-system=`uname -s` +-release=`uname -r` +-arch=`uname -m` ++system=${UNAME_S:-`uname -s`} ++release=${UNAME_R:-`uname -r`} ++arch=${UNAME_M:-`uname -m`} state="unknown" + case $system in diff --git a/package/network/services/ppp/patches/100-debian_ip-ip_option.patch b/package/network/services/ppp/patches/100-debian_ip-ip_option.patch deleted file mode 100644 index a996622922b..00000000000 --- a/package/network/services/ppp/patches/100-debian_ip-ip_option.patch +++ /dev/null @@ -1,96 +0,0 @@ -pppd: Allow specifying ip-up and ip-down scripts - -This patch implements the "ip-up-script" and "ip-down-script" options which -allow to specify the path of the ip-up and ip-down scripts to call. - -These options default to _PATH_IPUP and _PATH_IPDOWN to retain the -existing behaviour. - -The patch originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/ipcp.c -+++ b/pppd/ipcp.c -@@ -1957,7 +1957,7 @@ ipcp_up(f) - */ - if (ipcp_script_state == s_down && ipcp_script_pid == 0) { - ipcp_script_state = s_up; -- ipcp_script(_PATH_IPUP, 0); -+ ipcp_script(path_ipup, 0); - } - } - -@@ -2007,7 +2007,7 @@ ipcp_down(f) - /* Execute the ip-down script */ - if (ipcp_script_state == s_up && ipcp_script_pid == 0) { - ipcp_script_state = s_down; -- ipcp_script(_PATH_IPDOWN, 0); -+ ipcp_script(path_ipdown, 0); - } - } - -@@ -2061,13 +2061,13 @@ ipcp_script_done(arg) - case s_up: - if (ipcp_fsm[0].state != OPENED) { - ipcp_script_state = s_down; -- ipcp_script(_PATH_IPDOWN, 0); -+ ipcp_script(path_ipdown, 0); - } - break; - case s_down: - if (ipcp_fsm[0].state == OPENED) { - ipcp_script_state = s_up; -- ipcp_script(_PATH_IPUP, 0); -+ ipcp_script(path_ipup, 0); - } - break; - } ---- a/pppd/main.c -+++ b/pppd/main.c -@@ -306,6 +306,9 @@ main(argc, argv) - struct protent *protp; - char numbuf[16]; - -+ strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); -+ strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); -+ - link_stats_valid = 0; - new_phase(PHASE_INITIALIZE); - ---- a/pppd/options.c -+++ b/pppd/options.c -@@ -117,6 +117,8 @@ bool tune_kernel; /* may alter kernel s - int connect_delay = 1000; /* wait this many ms after connect script */ - int req_unit = -1; /* requested interface unit */ - char req_ifname[MAXIFNAMELEN]; /* requested interface name */ -+char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ -+char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ - bool multilink = 0; /* Enable multilink operation */ - char *bundle_name = NULL; /* bundle name for multilink */ - bool dump_options; /* print out option values */ -@@ -316,6 +318,13 @@ option_t general_options[] = { - "Metric to use for the default route (Linux only; -1 for default behavior)", - OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 }, - -+ { "ip-up-script", o_string, path_ipup, -+ "Set pathname of ip-up script", -+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, -+ { "ip-down-script", o_string, path_ipdown, -+ "Set pathname of ip-down script", -+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, -+ - #ifdef HAVE_MULTILINK - { "multilink", o_bool, &multilink, - "Enable multilink operation", OPT_PRIO | 1 }, ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -335,6 +335,8 @@ extern int connect_delay; /* Time to del - extern int max_data_rate; /* max bytes/sec through charshunt */ - extern int req_unit; /* interface unit number to use */ - extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ -+extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ -+extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ - extern bool multilink; /* enable multilink operation */ - extern bool noendpoint; /* don't send or accept endpt. discrim. */ - extern char *bundle_name; /* bundle name for multilink */ diff --git a/package/network/services/ppp/patches/101-debian_close_dev_ppp.patch b/package/network/services/ppp/patches/101-debian_close_dev_ppp.patch deleted file mode 100644 index 62830179b65..00000000000 --- a/package/network/services/ppp/patches/101-debian_close_dev_ppp.patch +++ /dev/null @@ -1,28 +0,0 @@ -pppd: Close already open ppp descriptors - -When using the kernel PPPoE driver in conjunction with the "persist" option, -the already open descriptor to /dev/ppp is not closed when the link is -reestablished. This eventually leads to high CPU load because the stray -descriptors are always reported as ready by select(). - -This patch closes the descriptor if it is already open when establishing a -new connection. It originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -467,6 +467,13 @@ int generic_establish_ppp (int fd) - if (new_style_driver) { - int flags; - -+ /* if a ppp_fd is already open, close it first */ -+ if(ppp_fd > 0) { -+ close(ppp_fd); -+ remove_fd(ppp_fd); -+ ppp_fd = -1; -+ } -+ - /* Open an instance of /dev/ppp and connect the channel to it */ - if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) { - error("Couldn't get channel number: %m"); diff --git a/package/network/services/ppp/patches/103-debian_fix_link_pidfile.patch b/package/network/services/ppp/patches/103-debian_fix_link_pidfile.patch deleted file mode 100644 index 5a764ab9b21..00000000000 --- a/package/network/services/ppp/patches/103-debian_fix_link_pidfile.patch +++ /dev/null @@ -1,23 +0,0 @@ -pppd: Fix creation of linkpidfile - -When pppd is run without "nodetach" or with "updetach", the linkpidfile is -never created. The call to create_linkpidfile() is protected by a check for -linkpidfile[0] but this is only filled in when create_linkpidfile() is called. - -This patch changes to code to allways uncondiationally call -create_linkpidfile(), it originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/main.c -+++ b/pppd/main.c -@@ -780,8 +780,7 @@ detach() - /* update pid files if they have been written already */ - if (pidfilename[0]) - create_pidfile(pid); -- if (linkpidfile[0]) -- create_linkpidfile(pid); -+ create_linkpidfile(pid); - exit(0); /* parent dies */ - } - setsid(); diff --git a/package/network/services/ppp/patches/105-debian_demand.patch b/package/network/services/ppp/patches/105-debian_demand.patch index c442f4c8af2..ff66aa8ea5a 100644 --- a/package/network/services/ppp/patches/105-debian_demand.patch +++ b/package/network/services/ppp/patches/105-debian_demand.patch @@ -18,7 +18,7 @@ #ifdef PPP_FILTER #include #endif -@@ -220,6 +224,14 @@ loop_chars(p, n) +@@ -218,6 +222,14 @@ loop_chars(unsigned char *p, int n) int c, rv; rv = 0; @@ -33,14 +33,12 @@ for (; n > 0; --n) { c = *p++; if (c == PPP_FLAG) { -@@ -298,17 +310,102 @@ loop_frame(frame, len) +@@ -294,16 +306,100 @@ loop_frame(unsigned char *frame, int len * loopback, now that the real serial link is up. */ void --demand_rexmit(proto) -+demand_rexmit(proto, newip) - int proto; -+ u_int32_t newip; +-demand_rexmit(int proto) ++demand_rexmit(int proto, u_int32_t newip) { struct packet *pkt, *prev, *nextpkt; + unsigned short checksum; @@ -139,7 +137,7 @@ } else { --- a/pppd/ipcp.c +++ b/pppd/ipcp.c -@@ -1882,7 +1882,7 @@ ipcp_up(f) +@@ -1850,7 +1850,7 @@ ipcp_up(fsm *f) proxy_arp_set[f->unit] = 1; } @@ -150,7 +148,7 @@ } else { --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c -@@ -1258,7 +1258,7 @@ ipv6cp_up(f) +@@ -1253,7 +1253,7 @@ ipv6cp_up(fsm *f) if (sif6defaultroute(f->unit, go->ourid, ho->hisid)) default_route_set[f->unit] = 1; } @@ -161,12 +159,12 @@ } else { --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -602,7 +602,7 @@ void demand_conf __P((void)); /* config - void demand_block __P((void)); /* set all NPs to queue up packets */ - void demand_unblock __P((void)); /* set all NPs to pass packets */ - void demand_discard __P((void)); /* set all NPs to discard packets */ --void demand_rexmit __P((int)); /* retransmit saved frames for an NP */ -+void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/ - int loop_chars __P((unsigned char *, int)); /* process chars from loopback */ - int loop_frame __P((unsigned char *, int)); /* should we bring link up? */ +@@ -598,7 +598,7 @@ void demand_conf(void); /* config interf + void demand_block(void); /* set all NPs to queue up packets */ + void demand_unblock(void); /* set all NPs to pass packets */ + void demand_discard(void); /* set all NPs to discard packets */ +-void demand_rexmit(int); /* retransmit saved frames for an NP */ ++void demand_rexmit(int, u_int32_t); /* retransmit saved frames for an NP*/ + int loop_chars(unsigned char *, int); /* process chars from loopback */ + int loop_frame(unsigned char *, int); /* should we bring link up? */ diff --git a/package/network/services/ppp/patches/106-debian_stripMSdomain.patch b/package/network/services/ppp/patches/106-debian_stripMSdomain.patch deleted file mode 100644 index 376de64c43a..00000000000 --- a/package/network/services/ppp/patches/106-debian_stripMSdomain.patch +++ /dev/null @@ -1,47 +0,0 @@ -pppd: Implement option to strip domain part from MS CHAP response - -This patch implements a new boolean option "chapms-strip-domain" which -strips the leading domain part of the username in a received MS Chap -response. - -When the option is set, all leading chars up to and including the last -backslash in the username are stripped. The option defaults to false. - -The patch originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/chap-new.c -+++ b/pppd/chap-new.c -@@ -58,6 +58,7 @@ int (*chap_verify_hook)(char *name, char - int chap_timeout_time = 3; - int chap_max_transmits = 10; - int chap_rechallenge_time = 0; -+int chapms_strip_domain = 0; - - /* - * Command-line options. -@@ -69,6 +70,8 @@ static option_t chap_option_list[] = { - "Set max #xmits for challenge", OPT_PRIO }, - { "chap-interval", o_int, &chap_rechallenge_time, - "Set interval for rechallenge", OPT_PRIO }, -+ { "chapms-strip-domain", o_bool, &chapms_strip_domain, -+ "Strip the domain prefix before the Username", 1 }, - { NULL } - }; - -@@ -336,6 +339,14 @@ chap_handle_response(struct chap_server_ - /* Null terminate and clean remote name. */ - slprintf(rname, sizeof(rname), "%.*v", len, name); - name = rname; -+ -+ /* strip the MS domain name */ -+ if (chapms_strip_domain && strrchr(rname, '\\')) { -+ char tmp[MAXNAMELEN+1]; -+ -+ strcpy(tmp, strrchr(rname, '\\') + 1); -+ strcpy(rname, tmp); -+ } - } - - if (chap_verify_hook) diff --git a/package/network/services/ppp/patches/107-debian_pppoatm_wildcard.patch b/package/network/services/ppp/patches/107-debian_pppoatm_wildcard.patch deleted file mode 100644 index 6f559a12312..00000000000 --- a/package/network/services/ppp/patches/107-debian_pppoatm_wildcard.patch +++ /dev/null @@ -1,25 +0,0 @@ -pppoatm: Allow wildcard ATM devices - -When operating pppd's pppoatm plugin with an USB ADSL modem, e.g. an -Alcatel Speedtouch, the ATM device number might change when the modem is -reconnected to the USB port or when the host controller resets the USB -device. - -This patch allows to specify the ATM device as wildcard which gives -enough flexibility to cope with changing device names. - -The patch originated from the Debain project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/plugins/pppoatm/pppoatm.c -+++ b/pppd/plugins/pppoatm/pppoatm.c -@@ -75,7 +75,7 @@ static int setdevname_pppoatm(const char - //info("PPPoATM setdevname_pppoatm: '%s'", cp); - memset(&addr, 0, sizeof addr); - if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr), -- T2A_PVC | T2A_NAME) < 0) { -+ T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) { - if(doit) - info("atm does not recognize: %s", cp); - return 0; diff --git a/package/network/services/ppp/patches/110-debian_defaultroute.patch b/package/network/services/ppp/patches/110-debian_defaultroute.patch deleted file mode 100644 index 21b329e5d5f..00000000000 --- a/package/network/services/ppp/patches/110-debian_defaultroute.patch +++ /dev/null @@ -1,314 +0,0 @@ -pppd: Add "replacedefaultroute" and "noreplacedefaultroute" options - -This patch implements two new options, "replacedefaultroute" to replace any -existing system default route when specified and "noreplacedefaultroute" to -disable the "replacedefaultroute" option, which is useful in multi user -environments where the administrator wants to allow users to dial pppd -connections but not allow them to change the system default route. - -The patch originated from the Debian project. - -Signed-off-by: Jo-Philipp Wich - ---- a/pppd/ipcp.c -+++ b/pppd/ipcp.c -@@ -197,6 +197,14 @@ static option_t ipcp_option_list[] = { - "disable defaultroute option", OPT_ALIAS | OPT_A2CLR, - &ipcp_wantoptions[0].default_route }, - -+ { "replacedefaultroute", o_bool, -+ &ipcp_wantoptions[0].replace_default_route, -+ "Replace default route", 1 -+ }, -+ { "noreplacedefaultroute", o_bool, -+ &ipcp_allowoptions[0].replace_default_route, -+ "Never replace default route", OPT_A2COPY, -+ &ipcp_wantoptions[0].replace_default_route }, - { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, - "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, - { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, -@@ -270,7 +278,7 @@ struct protent ipcp_protent = { - ip_active_pkt - }; - --static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t)); -+static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool)); - static void ipcp_script __P((char *, int)); /* Run an up/down script */ - static void ipcp_script_done __P((void *)); - -@@ -1760,7 +1768,8 @@ ip_demand_conf(u) - if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE)) - return 0; - if (wo->default_route) -- if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr)) -+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr, -+ wo->replace_default_route)) - default_route_set[u] = 1; - if (wo->proxy_arp) - if (sifproxyarp(u, wo->hisaddr)) -@@ -1848,7 +1857,8 @@ ipcp_up(f) - */ - if (demand) { - if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { -- ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr); -+ ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, -+ wo->replace_default_route); - if (go->ouraddr != wo->ouraddr) { - warn("Local IP address changed to %I", go->ouraddr); - script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); -@@ -1873,7 +1883,8 @@ ipcp_up(f) - - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) -- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr)) -+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr, -+ wo->replace_default_route)) - default_route_set[f->unit] = 1; - - /* Make a proxy ARP entry if requested. */ -@@ -1923,7 +1934,8 @@ ipcp_up(f) - - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) -- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr)) -+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr, -+ wo->replace_default_route)) - default_route_set[f->unit] = 1; - - /* Make a proxy ARP entry if requested. */ -@@ -2001,7 +2013,7 @@ ipcp_down(f) - sifnpmode(f->unit, PPP_IP, NPMODE_DROP); - sifdown(f->unit); - ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr, -- ipcp_hisoptions[f->unit].hisaddr); -+ ipcp_hisoptions[f->unit].hisaddr, 0); - } - - /* Execute the ip-down script */ -@@ -2017,16 +2029,25 @@ ipcp_down(f) - * proxy arp entries, etc. - */ - static void --ipcp_clear_addrs(unit, ouraddr, hisaddr) -+ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute) - int unit; - u_int32_t ouraddr; /* local address */ - u_int32_t hisaddr; /* remote address */ -+ bool replacedefaultroute; - { - if (proxy_arp_set[unit]) { - cifproxyarp(unit, hisaddr); - proxy_arp_set[unit] = 0; - } -- if (default_route_set[unit]) { -+ /* If replacedefaultroute, sifdefaultroute will be called soon -+ * with replacedefaultroute set and that will overwrite the current -+ * default route. This is the case only when doing demand, otherwise -+ * during demand, this cifdefaultroute would restore the old default -+ * route which is not what we want in this case. In the non-demand -+ * case, we'll delete the default route and restore the old if there -+ * is one saved by an sifdefaultroute with replacedefaultroute. -+ */ -+ if (!replacedefaultroute && default_route_set[unit]) { - cifdefaultroute(unit, ouraddr, hisaddr); - default_route_set[unit] = 0; - } ---- a/pppd/ipcp.h -+++ b/pppd/ipcp.h -@@ -70,6 +70,7 @@ typedef struct ipcp_options { - bool old_addrs; /* Use old (IP-Addresses) option? */ - bool req_addr; /* Ask peer to send IP address? */ - bool default_route; /* Assign default route through interface? */ -+ bool replace_default_route; /* Replace default route through interface? */ - bool proxy_arp; /* Make proxy ARP entry for peer? */ - bool neg_vj; /* Van Jacobson Compression? */ - bool old_vj; /* use old (short) form of VJ option? */ ---- a/pppd/pppd.8 -+++ b/pppd/pppd.8 -@@ -133,6 +133,11 @@ the gateway, when IPv6CP negotiation is - This entry is removed when the PPP connection is broken. This option - is privileged if the \fInodefaultroute6\fR option has been specified. - .TP -+.B replacedefaultroute -+This option is a flag to the defaultroute option. If defaultroute is -+set and this flag is also set, pppd replaces an existing default route -+with the new default route. -+.TP - .B disconnect \fIscript - Execute the command specified by \fIscript\fR, by passing it to a - shell, after -@@ -756,7 +761,12 @@ disable both forms of hardware flow cont - .TP - .B nodefaultroute - Disable the \fIdefaultroute\fR option. The system administrator who --wishes to prevent users from creating default routes with pppd -+wishes to prevent users from adding a default route with pppd -+can do so by placing this option in the /etc/ppp/options file. -+.TP -+.B noreplacedefaultroute -+Disable the \fIreplacedefaultroute\fR option. The system administrator who -+wishes to prevent users from replacing a default route with pppd - can do so by placing this option in the /etc/ppp/options file. - .TP - .B nodefaultroute6 ---- a/pppd/pppd.h -+++ b/pppd/pppd.h -@@ -684,7 +684,7 @@ int sif6addr __P((int, eui64_t, eui64_t - int cif6addr __P((int, eui64_t, eui64_t)); - /* Remove an IPv6 address from i/f */ - #endif --int sifdefaultroute __P((int, u_int32_t, u_int32_t)); -+int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt)); - /* Create default route through i/f */ - int cifdefaultroute __P((int, u_int32_t, u_int32_t)); - /* Delete default route through i/f */ ---- a/pppd/sys-linux.c -+++ b/pppd/sys-linux.c -@@ -209,6 +209,8 @@ static int if_is_up; /* Interface has be - static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */ - static int have_default_route; /* Gateway for default route added */ - static int have_default_route6; /* Gateway for default IPv6 route added */ -+static struct rtentry old_def_rt; /* Old default route */ -+static int default_rt_repl_rest; /* replace and restore old default rt */ - static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */ - static char proxy_arp_dev[16]; /* Device for proxy arp entry */ - static u_int32_t our_old_addr; /* for detecting address changes */ -@@ -1577,6 +1579,9 @@ static int read_route_table(struct rtent - p = NULL; - } - -+ SET_SA_FAMILY (rt->rt_dst, AF_INET); -+ SET_SA_FAMILY (rt->rt_gateway, AF_INET); -+ - SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16); - SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16); - SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16); -@@ -1649,20 +1654,52 @@ int have_route_to(u_int32_t addr) - /******************************************************************** - * - * sifdefaultroute - assign a default route through the address given. -- */ -- --int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway) --{ -- struct rtentry rt; -- -- if (defaultroute_exists(&rt, dfl_route_metric) && strcmp(rt.rt_dev, ifname) != 0) { -- if (rt.rt_flags & RTF_GATEWAY) -- error("not replacing existing default route via %I with metric %d", -- SIN_ADDR(rt.rt_gateway), dfl_route_metric); -- else -+ * -+ * If the global default_rt_repl_rest flag is set, then this function -+ * already replaced the original system defaultroute with some other -+ * route and it should just replace the current defaultroute with -+ * another one, without saving the current route. Use: demand mode, -+ * when pppd sets first a defaultroute it it's temporary ppp0 addresses -+ * and then changes the temporary addresses to the addresses for the real -+ * ppp connection when it has come up. -+ */ -+ -+int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace) -+{ -+ struct rtentry rt, tmp_rt; -+ struct rtentry *del_rt = NULL; -+ -+ if (default_rt_repl_rest) { -+ /* We have already reclaced the original defaultroute, if we -+ are called again, we will delete the current default route -+ and set the new default route in this function. -+ - this is normally only the case the doing demand: */ -+ if (defaultroute_exists(&tmp_rt, dfl_route_metric)) -+ del_rt = &tmp_rt; -+ } else if (defaultroute_exists(&old_def_rt, dfl_route_metric) && -+ strcmp(old_def_rt.rt_dev, ifname) != 0) { -+ /* We did not yet replace an existing default route, let's -+ check if we should save and replace a default route: */ -+ if (old_def_rt.rt_flags & RTF_GATEWAY) { -+ if (!replace) { -+ error("not replacing existing default route via %I with metric %d", -+ SIN_ADDR(old_def_rt.rt_gateway), dfl_route_metric); -+ return 0; -+ } else { -+ /* we need to copy rt_dev because we need it permanent too: */ -+ char *tmp_dev = malloc(strlen(old_def_rt.rt_dev) + 1); -+ strcpy(tmp_dev, old_def_rt.rt_dev); -+ old_def_rt.rt_dev = tmp_dev; -+ -+ notice("replacing old default route to %s [%I] with metric %d", -+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway), -+ dfl_route_metric); -+ default_rt_repl_rest = 1; -+ del_rt = &old_def_rt; -+ } -+ } else - error("not replacing existing default route through %s with metric %d", -- rt.rt_dev, dfl_route_metric); -- return 0; -+ old_def_rt.rt_dev, dfl_route_metric); - } - - memset (&rt, 0, sizeof (rt)); -@@ -1678,10 +1715,16 @@ int sifdefaultroute (int unit, u_int32_t - - rt.rt_flags = RTF_UP; - if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { -- if ( ! ok_error ( errno )) -+ if (!ok_error(errno)) - error("default route ioctl(SIOCADDRT): %m"); - return 0; - } -+ if (default_rt_repl_rest && del_rt) -+ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) { -+ if (!ok_error(errno)) -+ error("del old default route ioctl(SIOCDELRT): %m"); -+ return 0; -+ } - - have_default_route = 1; - return 1; -@@ -1715,11 +1758,21 @@ int cifdefaultroute (int unit, u_int32_t - rt.rt_flags = RTF_UP; - if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) { - if (still_ppp()) { -- if ( ! ok_error ( errno )) -+ if (!ok_error(errno)) - error("default route ioctl(SIOCDELRT): %m"); - return 0; - } - } -+ if (default_rt_repl_rest) { -+ notice("restoring old default route to %s [%I]", -+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway)); -+ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) { -+ if (!ok_error(errno)) -+ error("restore default route ioctl(SIOCADDRT): %m"); -+ return 0; -+ } -+ default_rt_repl_rest = 0; -+ } - - return 1; - } ---- a/pppd/sys-solaris.c -+++ b/pppd/sys-solaris.c -@@ -2120,12 +2120,18 @@ cifaddr(u, o, h) - * sifdefaultroute - assign a default route through the address given. - */ - int --sifdefaultroute(u, l, g) -+sifdefaultroute(u, l, g, replace) - int u; - u_int32_t l, g; -+ bool replace; - { - struct rtentry rt; - -+ if (replace) { -+ error("replacedefaultroute not supported on this platform"); -+ return 0; -+ } -+ - #if defined(__USLC__) - g = l; /* use the local address as gateway */ - #endif diff --git a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch b/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch index a1110caecbe..11e8d81f431 100644 --- a/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch +++ b/package/network/services/ppp/patches/120-debian_ipv6_updown_option.patch @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -308,6 +308,8 @@ main(argc, argv) +@@ -295,6 +295,8 @@ main(int argc, char *argv[]) strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); @@ -23,16 +23,16 @@ Signed-off-by: Jo-Philipp Wich new_phase(PHASE_INITIALIZE); --- a/pppd/options.c +++ b/pppd/options.c -@@ -119,6 +119,8 @@ int req_unit = -1; /* requested interfa - char req_ifname[MAXIFNAMELEN]; /* requested interface name */ +@@ -118,6 +118,8 @@ int req_unit = -1; /* requested interfa char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ + char req_ifname[MAXIFNAMELEN]; /* requested interface name */ +char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ +char path_ipv6down[MAXPATHLEN];/* pathname of ipv6-down script */ bool multilink = 0; /* Enable multilink operation */ char *bundle_name = NULL; /* bundle name for multilink */ bool dump_options; /* print out option values */ -@@ -325,6 +327,13 @@ option_t general_options[] = { +@@ -324,6 +326,13 @@ option_t general_options[] = { "Set pathname of ip-down script", OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, @@ -48,7 +48,7 @@ Signed-off-by: Jo-Philipp Wich "Enable multilink operation", OPT_PRIO | 1 }, --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c -@@ -1300,7 +1300,7 @@ ipv6cp_up(f) +@@ -1295,7 +1295,7 @@ ipv6cp_up(fsm *f) */ if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { ipv6cp_script_state = s_up; @@ -57,7 +57,7 @@ Signed-off-by: Jo-Philipp Wich } } -@@ -1352,7 +1352,7 @@ ipv6cp_down(f) +@@ -1346,7 +1346,7 @@ ipv6cp_down(fsm *f) /* Execute the ipv6-down script */ if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { ipv6cp_script_state = s_down; @@ -66,7 +66,7 @@ Signed-off-by: Jo-Philipp Wich } } -@@ -1395,13 +1395,13 @@ ipv6cp_script_done(arg) +@@ -1384,13 +1384,13 @@ ipv6cp_script_done(void *arg) case s_up: if (ipv6cp_fsm[0].state != OPENED) { ipv6cp_script_state = s_down; @@ -84,10 +84,10 @@ Signed-off-by: Jo-Philipp Wich } --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -337,6 +337,8 @@ extern int req_unit; /* interface unit n - extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ +@@ -328,6 +328,8 @@ extern int req_unit; /* interface unit n extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ + extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */ +extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */ +extern char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */ extern bool multilink; /* enable multilink operation */ diff --git a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch b/package/network/services/ppp/patches/140-pppoe_compile_fix.patch deleted file mode 100644 index 2253d4f3c1c..00000000000 --- a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/pppd/plugins/rp-pppoe/pppoe.h -+++ b/pppd/plugins/rp-pppoe/pppoe.h -@@ -48,11 +48,7 @@ - #include - - /* Ugly header files on some Linux boxes... */ --#if defined(HAVE_LINUX_IF_H) --#include --#elif defined(HAVE_NET_IF_H) - #include --#endif - - #ifdef HAVE_NET_IF_TYPES_H - #include -@@ -80,20 +76,7 @@ typedef unsigned long UINT32_t; - #error Could not find a 32-bit integer type - #endif - --#ifdef HAVE_LINUX_IF_ETHER_H --#include --#endif -- --#ifdef HAVE_NETINET_IF_ETHER_H --#include -- --#ifdef HAVE_SYS_SOCKET_H --#include --#endif --#ifndef HAVE_SYS_DLPI_H --#include --#endif --#endif -+#include - - - /* Ethernet frame types according to RFC 2516 */ diff --git a/package/network/services/ppp/patches/200-makefile.patch b/package/network/services/ppp/patches/200-makefile.patch index 42351392dc7..d0b9a9a99bd 100644 --- a/package/network/services/ppp/patches/200-makefile.patch +++ b/package/network/services/ppp/patches/200-makefile.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -48,7 +48,7 @@ MPPE=y +@@ -49,7 +49,7 @@ MPPE=y # Uncomment the next line to include support for PPP packet filtering. # This requires that the libpcap library and headers be installed # and that the kernel driver support PPP packet filtering. @@ -16,7 +16,7 @@ Signed-off-by: Jo-Philipp Wich # Uncomment the next line to enable multilink PPP (enabled by default) # Linux distributions: Please leave multilink ENABLED in your builds -@@ -58,7 +58,7 @@ HAVE_MULTILINK=y +@@ -59,7 +59,7 @@ HAVE_MULTILINK=y # Uncomment the next line to enable the TDB database (enabled by default.) # If you enable multilink, then TDB is automatically enabled also. # Linux distributions: Please leave TDB ENABLED in your builds. @@ -25,21 +25,28 @@ Signed-off-by: Jo-Philipp Wich # Uncomment the next line to enable Type=notify services in systemd # If enabled, and the user sets the up_sdnotify option, then -@@ -85,7 +85,7 @@ MAXOCTETS=y +@@ -85,13 +85,13 @@ USE_LIBUTIL=y + endif + + # Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto) +-USE_EAPTLS=y ++#USE_EAPTLS=y + + MAXOCTETS=y INCLUDE_DIRS= -I../include --COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -+COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP +-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe ++COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP -pipe CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' -@@ -126,10 +126,10 @@ CFLAGS += -DHAS_SHADOW +@@ -143,10 +143,10 @@ CFLAGS += -DHAS_SHADOW #LIBS += -lshadow $(LIBS) endif --ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),) -+#ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),) +-ifeq ($(shell echo '\#include ' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes) ++#ifeq ($(shell echo '\#include ' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes) CFLAGS += -DHAVE_CRYPT_H=1 LIBS += -lcrypt -endif diff --git a/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch b/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch index 9345c10400b..3c30517e42f 100644 --- a/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch +++ b/package/network/services/ppp/patches/201-mppe_mppc_1.1.patch @@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich */ --- a/pppd/ccp.c +++ b/pppd/ccp.c -@@ -61,12 +61,10 @@ static int setdeflate __P((char **)); +@@ -61,12 +61,10 @@ static int setdeflate (char **); static char bsd_value[8]; static char deflate_value[8]; @@ -197,7 +197,7 @@ Signed-off-by: Jo-Philipp Wich /* * Local state (mainly for handling reset-reqs and reset-acks). -@@ -343,6 +323,100 @@ setdeflate(argv) +@@ -341,6 +321,100 @@ setdeflate(char **argv) return 1; } @@ -298,7 +298,7 @@ Signed-off-by: Jo-Philipp Wich /* * ccp_init - initialize CCP. */ -@@ -377,6 +451,30 @@ ccp_init(unit) +@@ -374,6 +448,30 @@ ccp_init(int unit) ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS; ccp_allowoptions[0].predictor_1 = 1; @@ -329,7 +329,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -454,11 +552,11 @@ ccp_input(unit, p, len) +@@ -443,11 +541,11 @@ ccp_input(int unit, u_char *p, int len) if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) { notice("Compression disabled by peer."); #ifdef MPPE @@ -343,7 +343,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -486,6 +584,15 @@ ccp_extcode(f, code, id, p, len) +@@ -471,6 +569,15 @@ ccp_extcode(fsm *f, int code, int id, u_ break; /* send a reset-ack, which the transmitter will see and reset its compression state. */ @@ -359,7 +359,7 @@ Signed-off-by: Jo-Philipp Wich fsm_sdata(f, CCP_RESETACK, id, NULL, 0); break; -@@ -514,12 +621,11 @@ ccp_protrej(unit) +@@ -498,12 +605,11 @@ ccp_protrej(int unit) fsm_lowerdown(&ccp_fsm[unit]); #ifdef MPPE @@ -374,7 +374,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -536,7 +642,7 @@ ccp_resetci(f) +@@ -519,7 +625,7 @@ ccp_resetci(fsm *f) all_rejected[f->unit] = 0; #ifdef MPPE @@ -382,11 +382,27 @@ Signed-off-by: Jo-Philipp Wich + if (go->mppe || go->mppc) { ccp_options *ao = &ccp_allowoptions[f->unit]; int auth_mschap_bits = auth_done[f->unit]; - int numbits; -@@ -550,80 +656,109 @@ ccp_resetci(f) + #ifdef USE_EAPTLS +@@ -536,95 +642,124 @@ ccp_resetci(fsm *f) * NB: If MPPE is required, all other compression opts are invalid. * So, we return right away if we can't do it. */ +- +- /* Leave only the mschap auth bits set */ +- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | +- CHAP_MS2_WITHPEER | CHAP_MS2_PEER); +- /* Count the mschap auths */ +- auth_mschap_bits >>= CHAP_MS_SHIFT; +- numbits = 0; +- do { +- numbits += auth_mschap_bits & 1; +- auth_mschap_bits >>= 1; +- } while (auth_mschap_bits); +- if (numbits > 1) { +- error("MPPE required, but auth done in both directions."); +- lcp_close(f->unit, "MPPE required but not available"); +- return; +- } + if (ccp_wantoptions[f->unit].mppe) { + /* Leave only the mschap auth bits set */ + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | @@ -403,33 +419,42 @@ Signed-off-by: Jo-Philipp Wich + lcp_close(f->unit, "MPPE required but not available"); + return; + } -+ if (!numbits) { -+ error("MPPE required, but MS-CHAP[v2] auth not performed."); -+ lcp_close(f->unit, "MPPE required but not available"); -+ return; -+ } -- /* Leave only the mschap auth bits set */ -- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | -- CHAP_MS2_WITHPEER | CHAP_MS2_PEER); -- /* Count the mschap auths */ -- auth_mschap_bits >>= CHAP_MS_SHIFT; -- numbits = 0; -- do { -- numbits += auth_mschap_bits & 1; -- auth_mschap_bits >>= 1; -- } while (auth_mschap_bits); -- if (numbits > 1) { -- error("MPPE required, but auth done in both directions."); -- lcp_close(f->unit, "MPPE required but not available"); -- return; -- } + #ifdef USE_EAPTLS +- /* +- * MPPE is also possible in combination with EAP-TLS. +- * It is not possible to detect if we're doing EAP or EAP-TLS +- * at this stage, hence we accept all forms of EAP. If TLS is +- * not used then the MPPE keys will not be derived anyway. +- */ +- /* Leave only the eap auth bits set */ +- auth_eap_bits &= (EAP_WITHPEER | EAP_PEER ); ++ /* ++ * MPPE is also possible in combination with EAP-TLS. ++ * It is not possible to detect if we're doing EAP or EAP-TLS ++ * at this stage, hence we accept all forms of EAP. If TLS is ++ * not used then the MPPE keys will not be derived anyway. ++ */ ++ /* Leave only the eap auth bits set */ ++ auth_eap_bits &= (EAP_WITHPEER | EAP_PEER ); + +- if ((numbits == 0) && (auth_eap_bits == 0)) { +- error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed."); ++ if ((numbits == 0) && (auth_eap_bits == 0)) { ++ error("MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed."); + #else - if (!numbits) { - error("MPPE required, but MS-CHAP[v2] auth not performed."); ++ if (!numbits) { ++ error("MPPE required, but MS-CHAP[v2] auth not performed."); + #endif - lcp_close(f->unit, "MPPE required but not available"); - return; - } -- ++ lcp_close(f->unit, "MPPE required but not available"); ++ return; ++ } + - /* A plugin (eg radius) may not have obtained key material. */ - if (!mppe_keys_set) { - error("MPPE required, but keys are not available. " @@ -559,7 +584,7 @@ Signed-off-by: Jo-Philipp Wich if (go->bsd_compress) { opt_buf[0] = CI_BSD_COMPRESS; opt_buf[1] = CILEN_BSD_COMPRESS; -@@ -679,7 +814,8 @@ ccp_cilen(f) +@@ -679,7 +814,8 @@ static int + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) + (go->predictor_1? CILEN_PREDICTOR_1: 0) + (go->predictor_2? CILEN_PREDICTOR_2: 0) @@ -569,7 +594,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -693,6 +829,8 @@ ccp_addci(f, p, lenp) +@@ -690,6 +826,8 @@ static void { int res; ccp_options *go = &ccp_gotoptions[f->unit]; @@ -578,7 +603,7 @@ Signed-off-by: Jo-Philipp Wich u_char *p0 = p; /* -@@ -701,22 +839,43 @@ ccp_addci(f, p, lenp) +@@ -698,22 +836,43 @@ static void * in case it gets Acked. */ #ifdef MPPE @@ -631,7 +656,7 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate) { p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT; p[1] = CILEN_DEFLATE; -@@ -802,7 +961,7 @@ ccp_addci(f, p, lenp) +@@ -799,30 +958,50 @@ static void /* * ccp_ackci - process a received configure-ack, and return @@ -639,9 +664,7 @@ Signed-off-by: Jo-Philipp Wich + * 1 if the packet was OK. */ static int - ccp_ackci(f, p, len) -@@ -811,24 +970,44 @@ ccp_ackci(f, p, len) - int len; + ccp_ackci(fsm *f, u_char *p, int len) { ccp_options *go = &ccp_gotoptions[f->unit]; + ccp_options *ao = &ccp_allowoptions[f->unit]; @@ -694,8 +717,8 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate) { if (len < CILEN_DEFLATE || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) -@@ -901,6 +1080,8 @@ ccp_nakci(f, p, len, treat_as_reject) - int treat_as_reject; +@@ -891,6 +1070,8 @@ static int + ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ccp_options *go = &ccp_gotoptions[f->unit]; + ccp_options *ao = &ccp_allowoptions[f->unit]; @@ -703,7 +726,7 @@ Signed-off-by: Jo-Philipp Wich ccp_options no; /* options we've seen already */ ccp_options try; /* options to ask for next time */ -@@ -908,28 +1089,100 @@ ccp_nakci(f, p, len, treat_as_reject) +@@ -898,28 +1079,100 @@ static int try = *go; #ifdef MPPE @@ -822,7 +845,7 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate && len >= CILEN_DEFLATE && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) && p[1] == CILEN_DEFLATE) { -@@ -1002,14 +1255,50 @@ ccp_rejci(f, p, len) +@@ -989,14 +1242,50 @@ ccp_rejci(fsm *f, u_char *p, int len) return -1; #ifdef MPPE @@ -877,8 +900,8 @@ Signed-off-by: Jo-Philipp Wich if (go->deflate_correct && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) -@@ -1073,14 +1362,15 @@ ccp_reqci(f, p, lenp, dont_nak) - int dont_nak; +@@ -1056,14 +1345,15 @@ static int + ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { int ret, newret, res; - u_char *p0, *retp; @@ -897,7 +920,7 @@ Signed-off-by: Jo-Philipp Wich ret = CONFACK; retp = p0 = p; -@@ -1103,106 +1393,302 @@ ccp_reqci(f, p, lenp, dont_nak) +@@ -1086,106 +1376,302 @@ ccp_reqci(fsm *f, u_char *p, int *lenp, switch (type) { #ifdef MPPE case CI_MPPE: @@ -910,10 +933,6 @@ Signed-off-by: Jo-Philipp Wich - - /* Nak if anything unsupported or unknown are set. */ - if (ho->mppe & MPPE_OPT_UNSUPPORTED) { -- newret = CONFNAK; -- ho->mppe &= ~MPPE_OPT_UNSUPPORTED; -- } -- if (ho->mppe & MPPE_OPT_UNKNOWN) { + p2 = p[2]; + p5 = p[5]; + /* not sure what they want, tell 'em what we got */ @@ -922,6 +941,10 @@ Signed-off-by: Jo-Philipp Wich + MPPE_MPPC)) != 0 || p[5] == 0) || + (p[2] == 0 && p[3] == 0 && p[4] == 0 && p[5] == 0)) { newret = CONFNAK; +- ho->mppe &= ~MPPE_OPT_UNSUPPORTED; +- } +- if (ho->mppe & MPPE_OPT_UNKNOWN) { +- newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNKNOWN; - } - @@ -1293,7 +1316,7 @@ Signed-off-by: Jo-Philipp Wich case CI_DEFLATE: case CI_DEFLATE_DRAFT: if (!ao->deflate || clen != CILEN_DEFLATE -@@ -1344,12 +1830,6 @@ ccp_reqci(f, p, lenp, dont_nak) +@@ -1327,12 +1813,6 @@ ccp_reqci(fsm *f, u_char *p, int *lenp, else *lenp = retp - p0; } @@ -1306,7 +1329,7 @@ Signed-off-by: Jo-Philipp Wich return ret; } -@@ -1371,24 +1851,35 @@ method_name(opt, opt2) +@@ -1353,24 +1833,35 @@ method_name(ccp_options *opt, ccp_option char *p = result; char *q = result + sizeof(result); /* 1 past result */ @@ -1358,7 +1381,7 @@ Signed-off-by: Jo-Philipp Wich case CI_DEFLATE: case CI_DEFLATE_DRAFT: if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) -@@ -1444,12 +1935,12 @@ ccp_up(f) +@@ -1425,12 +1916,12 @@ ccp_up(fsm *f) } else if (ANY_COMPRESS(*ho)) notice("%s transmit compression enabled", method_name(ho, NULL)); #ifdef MPPE @@ -1373,7 +1396,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -1472,7 +1963,7 @@ ccp_down(f) +@@ -1452,7 +1943,7 @@ ccp_down(fsm *f) lcp_close(f->unit, "MPPE disabled"); } } @@ -1382,7 +1405,7 @@ Signed-off-by: Jo-Philipp Wich } /* -@@ -1532,24 +2023,28 @@ ccp_printpkt(p, plen, printer, arg) +@@ -1509,24 +2000,28 @@ ccp_printpkt(u_char *p, int plen, #ifdef MPPE case CI_MPPE: if (optlen >= CILEN_MPPE) { @@ -1423,7 +1446,7 @@ Signed-off-by: Jo-Philipp Wich case CI_DEFLATE: case CI_DEFLATE_DRAFT: if (optlen >= CILEN_DEFLATE) { -@@ -1635,6 +2130,7 @@ ccp_datainput(unit, pkt, len) +@@ -1609,6 +2104,7 @@ ccp_datainput(int unit, u_char *pkt, int error("Lost compression sync: disabling compression"); ccp_close(unit, "Lost compression sync"); #ifdef MPPE @@ -1431,7 +1454,7 @@ Signed-off-by: Jo-Philipp Wich /* * If we were doing MPPE, we must also take the link down. */ -@@ -1642,9 +2138,18 @@ ccp_datainput(unit, pkt, len) +@@ -1616,9 +2112,18 @@ ccp_datainput(int unit, u_char *pkt, int error("Too many MPPE errors, closing LCP"); lcp_close(unit, "Too many MPPE errors"); } diff --git a/package/network/services/ppp/patches/202-no_strip.patch b/package/network/services/ppp/patches/202-no_strip.patch deleted file mode 100644 index 0af7b2b2abd..00000000000 --- a/package/network/services/ppp/patches/202-no_strip.patch +++ /dev/null @@ -1,88 +0,0 @@ -build: Do not strip binaries on install - -Strippign executables should be handled by the distro packaging, not by ppp -itself. This patch removes the "-s" (strip) switch from all "install" commands -in order to install unstripped binaries into the destination prefix. - -Signed-off-by: Jo-Philipp Wich - ---- a/chat/Makefile.linux -+++ b/chat/Makefile.linux -@@ -25,7 +25,7 @@ chat.o: chat.c - - install: chat - mkdir -p $(BINDIR) $(MANDIR) -- $(INSTALL) -s -c chat $(BINDIR) -+ $(INSTALL) -c chat $(BINDIR) - $(INSTALL) -c -m 644 chat.8 $(MANDIR) - - clean: ---- a/pppd/Makefile.linux -+++ b/pppd/Makefile.linux -@@ -108,7 +108,7 @@ ifdef USE_SRP - CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include - LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto - TARGETS += srp-entry --EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry -+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry - MANPAGES += srp-entry.8 - EXTRACLEAN += srp-entry.o - NEEDDES=y -@@ -220,7 +220,7 @@ all: $(TARGETS) - install: pppd - mkdir -p $(BINDIR) $(MANDIR) - $(EXTRAINSTALL) -- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd -+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd - if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ - chmod o-rx,u+s $(BINDIR)/pppd; fi - $(INSTALL) -c -m 444 pppd.8 $(MANDIR) ---- a/pppd/plugins/radius/Makefile.linux -+++ b/pppd/plugins/radius/Makefile.linux -@@ -36,9 +36,9 @@ all: $(PLUGIN) - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR) -- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radius.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR) -+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR) - $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR) - $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) - ---- a/pppd/plugins/rp-pppoe/Makefile.linux -+++ b/pppd/plugins/rp-pppoe/Makefile.linux -@@ -43,9 +43,9 @@ rp-pppoe.so: plugin.o discovery.o if.o c - - install: all - $(INSTALL) -d -m 755 $(LIBDIR) -- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR) -+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR) - $(INSTALL) -d -m 755 $(BINDIR) -- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR) -+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR) - - clean: - rm -f *.o *.so pppoe-discovery ---- a/pppdump/Makefile.linux -+++ b/pppdump/Makefile.linux -@@ -17,5 +17,5 @@ clean: - - install: - mkdir -p $(BINDIR) $(MANDIR) -- $(INSTALL) -s -c pppdump $(BINDIR) -+ $(INSTALL) -c pppdump $(BINDIR) - $(INSTALL) -c -m 444 pppdump.8 $(MANDIR) ---- a/pppstats/Makefile.linux -+++ b/pppstats/Makefile.linux -@@ -22,7 +22,7 @@ all: pppstats - - install: pppstats - -mkdir -p $(MANDIR) -- $(INSTALL) -s -c pppstats $(BINDIR) -+ $(INSTALL) -c pppstats $(BINDIR) - $(INSTALL) -c -m 444 pppstats.8 $(MANDIR) - - pppstats: $(PPPSTATSRCS) diff --git a/package/network/services/ppp/patches/203-opt_flags.patch b/package/network/services/ppp/patches/203-opt_flags.patch index 8dfacf38345..705959e7ba2 100644 --- a/package/network/services/ppp/patches/203-opt_flags.patch +++ b/package/network/services/ppp/patches/203-opt_flags.patch @@ -8,17 +8,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/plugins/radius/Makefile.linux +++ b/pppd/plugins/radius/Makefile.linux -@@ -12,7 +12,8 @@ VERSION = $(shell awk -F '"' '/VERSION/ - INSTALL = install - - PLUGIN=radius.so radattr.so radrealms.so --CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON -+COPTS = -O2 -+CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON - - # Uncomment the next line to include support for Microsoft's - # MS-CHAP authentication protocol. -@@ -43,13 +44,13 @@ install: all +@@ -47,13 +47,13 @@ install: all $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) radius.so: radius.o libradiusclient.a @@ -35,26 +25,14 @@ Signed-off-by: Jo-Philipp Wich CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \ clientid.o sendserver.o lock.o util.o md5.o ---- a/pppdump/Makefile.linux -+++ b/pppdump/Makefile.linux -@@ -2,7 +2,8 @@ DESTDIR = $(INSTROOT)@DESTDIR@ - BINDIR = $(DESTDIR)/sbin - MANDIR = $(DESTDIR)/share/man/man8 - --CFLAGS= -O -I../include/net -+COPTS = -O -+CFLAGS= $(COPTS) -I../include/net - OBJS = pppdump.o bsd-comp.o deflate.o zlib.o - - INSTALL= install ---- a/pppd/plugins/rp-pppoe/Makefile.linux -+++ b/pppd/plugins/rp-pppoe/Makefile.linux -@@ -39,7 +39,7 @@ debug.o: debug.c +--- a/pppd/plugins/pppoe/Makefile.linux ++++ b/pppd/plugins/pppoe/Makefile.linux +@@ -38,7 +38,7 @@ debug.o: debug.c $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c - rp-pppoe.so: plugin.o discovery.o if.o common.o -- $(CC) $(LDFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o -+ $(CC) $(LDFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o + pppoe.so: plugin.o discovery.o if.o common.o +- $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o ++ $(CC) $(LDFLAGS) -fPIC -o pppoe.so -shared plugin.o discovery.o if.o common.o install: all $(INSTALL) -d -m 755 $(LIBDIR) diff --git a/package/network/services/ppp/patches/205-no_exponential_timeout.patch b/package/network/services/ppp/patches/205-no_exponential_timeout.patch index 7f752e31377..b08c2eff891 100644 --- a/package/network/services/ppp/patches/205-no_exponential_timeout.patch +++ b/package/network/services/ppp/patches/205-no_exponential_timeout.patch @@ -5,8 +5,8 @@ discovery attempts. Signed-off-by: Jo-Philipp Wich ---- a/pppd/plugins/rp-pppoe/discovery.c -+++ b/pppd/plugins/rp-pppoe/discovery.c +--- a/pppd/plugins/pppoe/discovery.c ++++ b/pppd/plugins/pppoe/discovery.c @@ -632,7 +632,9 @@ discovery(PPPoEConnection *conn) conn->discoveryState = STATE_SENT_PADI; waitForPADO(conn, timeout); diff --git a/package/network/services/ppp/patches/207-lcp_mtu_max.patch b/package/network/services/ppp/patches/207-lcp_mtu_max.patch index 7aa8d4e1291..522576c6272 100644 --- a/package/network/services/ppp/patches/207-lcp_mtu_max.patch +++ b/package/network/services/ppp/patches/207-lcp_mtu_max.patch @@ -8,7 +8,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/lcp.c +++ b/pppd/lcp.c -@@ -1916,12 +1916,12 @@ lcp_up(f) +@@ -1862,12 +1862,12 @@ lcp_up(fsm *f) * the interface MTU is set to the lowest of that, the * MTU we want to use, and our link MRU. */ diff --git a/package/network/services/ppp/patches/208-fix_status_code.patch b/package/network/services/ppp/patches/208-fix_status_code.patch index f1a12006a58..54e6c45e149 100644 --- a/package/network/services/ppp/patches/208-fix_status_code.patch +++ b/package/network/services/ppp/patches/208-fix_status_code.patch @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -1052,7 +1052,8 @@ get_input() +@@ -1034,7 +1034,8 @@ get_input(void) } notice("Modem hangup"); hungup = 1; diff --git a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch b/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch index 40866132e8a..87e340b3f11 100644 --- a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch +++ b/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch @@ -7,14 +7,14 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -190,8 +190,8 @@ endif +@@ -210,8 +210,8 @@ LIBS += -ldl + endif ifdef FILTER - ifneq ($(wildcard /usr/include/pcap-bpf.h),) -LIBS += -lpcap -CFLAGS += -DPPP_FILTER +LIBS += -lpcap -L$(STAGING_DIR)/usr/lib +CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include endif - endif + ifdef HAVE_INET6 diff --git a/package/network/services/ppp/patches/310-precompile_filter.patch b/package/network/services/ppp/patches/310-precompile_filter.patch index ec611044235..ca91d153e9b 100644 --- a/package/network/services/ppp/patches/310-precompile_filter.patch +++ b/package/network/services/ppp/patches/310-precompile_filter.patch @@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -50,6 +50,9 @@ MPPE=y +@@ -51,6 +51,9 @@ MPPE=y # and that the kernel driver support PPP packet filtering. #FILTER=y @@ -23,8 +23,8 @@ Signed-off-by: Jo-Philipp Wich # Uncomment the next line to enable multilink PPP (enabled by default) # Linux distributions: Please leave multilink ENABLED in your builds # of pppd! -@@ -195,6 +198,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR) - endif +@@ -214,6 +217,14 @@ LIBS += -lpcap -L$(STAGING_DIR)/usr/l + CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include endif +ifdef PRECOMPILED_FILTER @@ -40,7 +40,7 @@ Signed-off-by: Jo-Philipp Wich HEADERS += ipv6cp.h eui64.h --- a/pppd/options.c +++ b/pppd/options.c -@@ -57,6 +57,7 @@ +@@ -56,6 +56,7 @@ #ifdef PPP_FILTER #include @@ -48,21 +48,21 @@ Signed-off-by: Jo-Philipp Wich /* * There have been 3 or 4 different names for this in libpcap CVS, but * this seems to be what they have settled on... -@@ -169,6 +170,13 @@ static int setlogfile __P((char **)); - static int loadplugin __P((char **)); +@@ -168,6 +169,13 @@ static int setlogfile(char **); + static int loadplugin(char **); #endif +#ifdef PPP_PRECOMPILED_FILTER +#include "pcap_pcc.h" -+static int setprecompiledpassfilter __P((char **)); -+static int setprecompiledactivefilter __P((char **)); ++static int setprecompiledpassfilter(char **); ++static int setprecompiledactivefilter(char **); +#undef PPP_FILTER +#endif + #ifdef PPP_FILTER - static int setpassfilter __P((char **)); - static int setactivefilter __P((char **)); -@@ -361,6 +369,14 @@ option_t general_options[] = { + static int setpassfilter(char **); + static int setactivefilter(char **); +@@ -360,6 +368,14 @@ option_t general_options[] = { "set filter for active pkts", OPT_PRIO }, #endif @@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich #ifdef MAXOCTETS { "maxoctets", o_int, &maxoctets, "Set connection traffic limit", -@@ -1516,6 +1532,29 @@ callfile(argv) +@@ -1468,6 +1484,27 @@ callfile(char **argv) return ok; } @@ -87,8 +87,7 @@ Signed-off-by: Jo-Philipp Wich + * precompiled expression + */ +static int -+setprecompiledpassfilter(argv) -+ char **argv; ++setprecompiledpassfilter(char **argv) +{ + return pcap_pre_compiled (*argv, &pass_filter); +} @@ -97,8 +96,7 @@ Signed-off-by: Jo-Philipp Wich + * setactivefilter - Set the active filter for packets + */ +static int -+setprecompiledactivefilter(argv) -+ char **argv; ++setprecompiledactivefilter(char **argv) +{ + return pcap_pre_compiled (*argv, &active_filter); +} diff --git a/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch b/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch index 75c803650fa..0c4d7ea9d6c 100644 --- a/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch +++ b/package/network/services/ppp/patches/321-multilink_support_custom_iface_names.patch @@ -16,17 +16,17 @@ Signed-off-by: George Kashperko #include "pppd.h" #include "fsm.h" -@@ -56,7 +57,8 @@ static void iterate_bundle_links __P((vo +@@ -56,7 +57,8 @@ static void iterate_bundle_links(void (* - static int get_default_epdisc __P((struct epdisc *)); - static int parse_num __P((char *str, const char *key, int *valp)); --static int owns_unit __P((TDB_DATA pid, int unit)); -+static int parse_str __P((char *str, const char *key, char *buf, int buflen)); -+static int owns_link __P((TDB_DATA pid, char *ifname)); + static int get_default_epdisc(struct epdisc *); + static int parse_num(char *str, const char *key, int *valp); +-static int owns_unit(TDB_DATA pid, int unit); ++static int parse_str(char *str, const char *key, char *buf, int buflen); ++static int owns_link(TDB_DATA pid, char *ifname); #define set_ip_epdisc(ep, addr) do { \ ep->length = 4; \ -@@ -197,35 +199,38 @@ mp_join_bundle() +@@ -197,35 +199,38 @@ mp_join_bundle(void) key.dptr = bundle_id; key.dsize = p - bundle_id; pid = tdb_fetch(pppdb, key); @@ -73,16 +73,12 @@ Signed-off-by: George Kashperko } /* we have to make a new bundle */ -@@ -408,22 +413,45 @@ parse_num(str, key, valp) +@@ -405,20 +410,39 @@ parse_num(char *str, const char *key, in return 0; } +static int -+parse_str(str, key, buf, buflen) -+ char *str; -+ const char *key; -+ char *buf; -+ int buflen; ++parse_str(char *str, const char *key, char *buf, int buflen) +{ + char *p, *endp; + int i; @@ -103,11 +99,8 @@ Signed-off-by: George Kashperko + * Check whether the pppd identified by `key' still owns ppp link `ifname'. */ static int --owns_unit(key, unit) -+owns_link(key, ifname) - TDB_DATA key; -- int unit; -+ char *ifname; +-owns_unit(TDB_DATA key, int unit) ++owns_link(TDB_DATA key, char *ifname) { - char ifkey[32]; + char ifkey[7 + IFNAMSIZ]; @@ -126,7 +119,7 @@ Signed-off-by: George Kashperko && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -700,6 +700,16 @@ void cfg_bundle(int mrru, int mtru, int +@@ -706,6 +706,16 @@ void cfg_bundle(int mrru, int mtru, int add_fd(ppp_dev_fd); } @@ -143,7 +136,7 @@ Signed-off-by: George Kashperko /* * make_new_bundle - create a new PPP unit (i.e. a bundle) * and connect our channel to it. This should only get called -@@ -718,6 +728,8 @@ void make_new_bundle(int mrru, int mtru, +@@ -724,6 +734,8 @@ void make_new_bundle(int mrru, int mtru, /* set the mrru and flags */ cfg_bundle(mrru, mtru, rssn, tssn); diff --git a/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch b/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch index 6c0849cc6cc..6ccc4507b2b 100644 --- a/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch +++ b/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch @@ -12,7 +12,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -1767,6 +1767,7 @@ int cifdefaultroute (int unit, u_int32_t +@@ -1770,6 +1770,7 @@ int cifdefaultroute (int unit, u_int32_t SIN_ADDR(rt.rt_genmask) = 0L; } diff --git a/package/network/services/ppp/patches/340-populate_default_gateway.patch b/package/network/services/ppp/patches/340-populate_default_gateway.patch index ae385dfc9b7..0f965c705d2 100644 --- a/package/network/services/ppp/patches/340-populate_default_gateway.patch +++ b/package/network/services/ppp/patches/340-populate_default_gateway.patch @@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -1717,6 +1717,9 @@ int sifdefaultroute (int unit, u_int32_t +@@ -1720,6 +1720,9 @@ int sifdefaultroute (int unit, u_int32_t memset (&rt, 0, sizeof (rt)); SET_SA_FAMILY (rt.rt_dst, AF_INET); @@ -23,12 +23,12 @@ Signed-off-by: Jo-Philipp Wich rt.rt_dev = ifname; rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */ -@@ -1725,7 +1728,7 @@ int sifdefaultroute (int unit, u_int32_t +@@ -1728,7 +1731,7 @@ int sifdefaultroute (int unit, u_int32_t SIN_ADDR(rt.rt_genmask) = 0L; } - rt.rt_flags = RTF_UP; + rt.rt_flags = RTF_UP | RTF_GATEWAY; if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { - if (!ok_error(errno)) + if ( ! ok_error ( errno )) error("default route ioctl(SIOCADDRT): %m"); diff --git a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch index 0754f8f4d61..3c720483627 100644 --- a/package/network/services/ppp/patches/400-simplify_kernel_checks.patch +++ b/package/network/services/ppp/patches/400-simplify_kernel_checks.patch @@ -10,7 +10,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -200,7 +200,7 @@ static int driver_is_old = 0; +@@ -206,7 +206,7 @@ static int driver_is_old = 0; static int restore_term = 0; /* 1 => we've munged the terminal */ static struct termios inittermios; /* Initial TTY termios */ @@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich static char loop_name[20]; static unsigned char inbuf[512]; /* buffer for chars read from loopback */ -@@ -219,8 +219,8 @@ static int looped; /* 1 if using loop +@@ -225,8 +225,8 @@ static int looped; /* 1 if using loop static int link_mtu; /* mtu for the link (not bundle) */ static struct utsname utsname; /* for the kernel version */ @@ -29,7 +29,7 @@ Signed-off-by: Jo-Philipp Wich #define MAX_IFS 100 -@@ -1453,11 +1453,12 @@ int ccp_fatal_error (int unit) +@@ -1455,11 +1455,12 @@ int ccp_fatal_error (int unit) * * path_to_procfs - find the path to the proc file system mount point */ @@ -44,7 +44,7 @@ Signed-off-by: Jo-Philipp Wich struct mntent *mntent; FILE *fp; -@@ -1479,6 +1480,7 @@ static char *path_to_procfs(const char * +@@ -1481,6 +1482,7 @@ static char *path_to_procfs(const char * fclose (fp); } } @@ -52,7 +52,7 @@ Signed-off-by: Jo-Philipp Wich strlcpy(proc_path + proc_path_len, tail, sizeof(proc_path) - proc_path_len); -@@ -2332,15 +2334,19 @@ int ppp_available(void) +@@ -2365,15 +2367,19 @@ int ppp_available(void) int my_version, my_modification, my_patch; int osmaj, osmin, ospatch; @@ -72,7 +72,7 @@ Signed-off-by: Jo-Philipp Wich /* XXX should get from driver */ driver_version = 2; -@@ -2400,6 +2406,7 @@ int ppp_available(void) +@@ -2433,6 +2439,7 @@ int ppp_available(void) if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP)) ok = 0; @@ -80,7 +80,7 @@ Signed-off-by: Jo-Philipp Wich /* * This is the PPP device. Validate the version of the driver at this -@@ -2936,6 +2943,7 @@ get_pty(master_fdp, slave_fdp, slave_nam +@@ -3106,6 +3113,7 @@ get_pty(int *master_fdp, int *slave_fdp, } #endif /* TIOCGPTN */ @@ -88,7 +88,7 @@ Signed-off-by: Jo-Philipp Wich if (sfd < 0) { /* the old way - scan through the pty name space */ for (i = 0; i < 64; ++i) { -@@ -2954,6 +2962,7 @@ get_pty(master_fdp, slave_fdp, slave_nam +@@ -3124,6 +3132,7 @@ get_pty(int *master_fdp, int *slave_fdp, } } } @@ -98,11 +98,11 @@ Signed-off-by: Jo-Philipp Wich return 0; --- a/pppd/plugins/pppoatm/pppoatm.c +++ b/pppd/plugins/pppoatm/pppoatm.c -@@ -168,14 +168,6 @@ static void disconnect_pppoatm(void) +@@ -171,14 +171,6 @@ static void disconnect_pppoatm(void) void plugin_init(void) { --#if defined(__linux__) +-#ifdef linux - extern int new_style_driver; /* From sys-linux.c */ - if (!ppp_available() && !new_style_driver) - fatal("Kernel doesn't support ppp_generic - " @@ -110,12 +110,12 @@ Signed-off-by: Jo-Philipp Wich -#else - fatal("No PPPoATM support on this OS"); -#endif - info("PPPoATM plugin_init"); add_options(pppoa_options); } ---- a/pppd/plugins/rp-pppoe/plugin.c -+++ b/pppd/plugins/rp-pppoe/plugin.c -@@ -59,9 +59,6 @@ static char const RCSID[] = + +--- a/pppd/plugins/pppoe/plugin.c ++++ b/pppd/plugins/pppoe/plugin.c +@@ -58,9 +58,6 @@ static char const RCSID[] = char pppd_version[] = VERSION; @@ -125,7 +125,7 @@ Signed-off-by: Jo-Philipp Wich char *pppd_pppoe_service = NULL; static char *acName = NULL; static char *existingSession = NULL; -@@ -394,10 +391,6 @@ PPPoEDevnameHook(char *cmd, char **argv, +@@ -407,10 +404,6 @@ PPPoEDevnameHook(char *cmd, char **argv, void plugin_init(void) { @@ -135,7 +135,7 @@ Signed-off-by: Jo-Philipp Wich - add_options(Options); - info("RP-PPPoE plugin version %s compiled against pppd %s", + info("PPPoE plugin from pppd %s", VERSION); --- a/pppd/plugins/pppol2tp/pppol2tp.c +++ b/pppd/plugins/pppol2tp/pppol2tp.c @@ -490,12 +490,7 @@ static void pppol2tp_cleanup(void) diff --git a/package/network/services/ppp/patches/401-no_record_file.patch b/package/network/services/ppp/patches/401-no_record_file.patch index f707fda8ab6..78442606851 100644 --- a/package/network/services/ppp/patches/401-no_record_file.patch +++ b/package/network/services/ppp/patches/401-no_record_file.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -326,7 +326,6 @@ extern int holdoff; /* Dead time before +@@ -317,7 +317,6 @@ extern int holdoff; /* Dead time before extern bool holdoff_specified; /* true if user gave a holdoff value */ extern bool notty; /* Stdin/out is not a tty */ extern char *pty_socket; /* Socket to connect to pty */ @@ -17,7 +17,7 @@ Signed-off-by: Jo-Philipp Wich extern char linkname[MAXPATHLEN]; /* logical name for link */ --- a/pppd/tty.c +++ b/pppd/tty.c -@@ -145,7 +145,7 @@ char *disconnect_script = NULL; /* Scrip +@@ -143,7 +143,7 @@ char *disconnect_script = NULL; /* Scrip char *welcomer = NULL; /* Script to run after phys link estab. */ char *ptycommand = NULL; /* Command to run on other side of pty */ bool notty = 0; /* Stdin/out is not a tty */ @@ -26,7 +26,7 @@ Signed-off-by: Jo-Philipp Wich int max_data_rate; /* max bytes/sec through charshunt */ bool sync_serial = 0; /* Device is synchronous serial device */ char *pty_socket = NULL; /* Socket to connect to pty */ -@@ -201,8 +201,10 @@ option_t tty_options[] = { +@@ -199,8 +199,10 @@ option_t tty_options[] = { "Send and receive over socket, arg is host:port", OPT_PRIO | OPT_DEVNAM }, diff --git a/package/network/services/ppp/patches/403-no_wtmp.patch b/package/network/services/ppp/patches/403-no_wtmp.patch index 537a1b0c7fc..772620ed722 100644 --- a/package/network/services/ppp/patches/403-no_wtmp.patch +++ b/package/network/services/ppp/patches/403-no_wtmp.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -2470,6 +2470,7 @@ int ppp_available(void) +@@ -2503,6 +2503,7 @@ int ppp_available(void) void logwtmp (const char *line, const char *name, const char *host) { @@ -15,7 +15,7 @@ Signed-off-by: Jo-Philipp Wich struct utmp ut, *utp; pid_t mypid = getpid(); #if __GLIBC__ < 2 -@@ -2535,6 +2536,7 @@ void logwtmp (const char *line, const ch +@@ -2568,6 +2569,7 @@ void logwtmp (const char *line, const ch close (wtmp); } #endif diff --git a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch index d37fc035398..b9b6f0e593b 100644 --- a/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch +++ b/package/network/services/ppp/patches/404-remove_obsolete_protocol_names.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/main.c +++ b/pppd/main.c -@@ -883,14 +883,17 @@ struct protocol_list { +@@ -866,14 +866,17 @@ struct protocol_list { const char *name; } protocol_list[] = { { 0x21, "IP" }, @@ -25,7 +25,7 @@ Signed-off-by: Jo-Philipp Wich { 0x33, "Stream Protocol ST-II" }, { 0x35, "Banyan Vines" }, { 0x39, "AppleTalk EDDP" }, -@@ -904,8 +907,11 @@ struct protocol_list { +@@ -887,8 +890,11 @@ struct protocol_list { { 0x49, "Serial Data Transport Protocol (PPP-SDTP)" }, { 0x4b, "SNA over 802.2" }, { 0x4d, "SNA" }, @@ -37,7 +37,7 @@ Signed-off-by: Jo-Philipp Wich { 0x53, "Encryption" }, { 0x55, "Individual Link Encryption" }, { 0x57, "IPv6" }, -@@ -916,12 +922,15 @@ struct protocol_list { +@@ -899,12 +905,15 @@ struct protocol_list { { 0x65, "RTP IPHC Compressed non-TCP" }, { 0x67, "RTP IPHC Compressed UDP 8" }, { 0x69, "RTP IPHC Compressed RTP 8" }, @@ -53,7 +53,7 @@ Signed-off-by: Jo-Philipp Wich { 0x0203, "IBM Source Routing BPDU" }, { 0x0205, "DEC LANBridge100 Spanning Tree" }, { 0x0207, "Cisco Discovery Protocol" }, -@@ -933,15 +942,19 @@ struct protocol_list { +@@ -916,15 +925,19 @@ struct protocol_list { { 0x0231, "Luxcom" }, { 0x0233, "Sigma Network Systems" }, { 0x0235, "Apple Client Server Protocol" }, @@ -73,7 +73,7 @@ Signed-off-by: Jo-Philipp Wich { 0x4001, "Cray Communications Control Protocol" }, { 0x4003, "CDPD Mobile Network Registration Protocol" }, { 0x4005, "Expand accelerator protocol" }, -@@ -952,8 +965,10 @@ struct protocol_list { +@@ -935,8 +948,10 @@ struct protocol_list { { 0x4023, "RefTek Protocol" }, { 0x4025, "Fibre Channel" }, { 0x4027, "EMIT Protocols" }, @@ -84,7 +84,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8023, "OSI Network Layer Control Protocol" }, { 0x8025, "Xerox NS IDP Control Protocol" }, { 0x8027, "DECnet Phase IV Control Protocol" }, -@@ -962,7 +977,9 @@ struct protocol_list { +@@ -945,7 +960,9 @@ struct protocol_list { { 0x8031, "Bridging NCP" }, { 0x8033, "Stream Protocol Control Protocol" }, { 0x8035, "Banyan Vines Control Protocol" }, @@ -94,7 +94,7 @@ Signed-off-by: Jo-Philipp Wich { 0x803f, "NETBIOS Framing Control Protocol" }, { 0x8041, "Cisco Systems Control Protocol" }, { 0x8043, "Ascom Timeplex" }, -@@ -971,18 +988,24 @@ struct protocol_list { +@@ -954,18 +971,24 @@ struct protocol_list { { 0x8049, "Serial Data Control Protocol (PPP-SDCP)" }, { 0x804b, "SNA over 802.2 Control Protocol" }, { 0x804d, "SNA Control Protocol" }, @@ -119,7 +119,7 @@ Signed-off-by: Jo-Philipp Wich { 0x8207, "Cisco Discovery Protocol Control" }, { 0x8209, "Netcs Twin Routing" }, { 0x820b, "STP - Control Protocol" }, -@@ -991,24 +1014,29 @@ struct protocol_list { +@@ -974,24 +997,29 @@ struct protocol_list { { 0x8281, "MPLSCP" }, { 0x8285, "IEEE p1284.4 standard - Protocol Control" }, { 0x8287, "ETSI TETRA TNP1 Control Protocol" }, diff --git a/package/network/services/ppp/patches/405-no_multilink_option.patch b/package/network/services/ppp/patches/405-no_multilink_option.patch index ce87d039a36..a34ec57b0a9 100644 --- a/package/network/services/ppp/patches/405-no_multilink_option.patch +++ b/package/network/services/ppp/patches/405-no_multilink_option.patch @@ -9,7 +9,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/options.c +++ b/pppd/options.c -@@ -349,13 +349,14 @@ option_t general_options[] = { +@@ -348,13 +348,14 @@ option_t general_options[] = { "Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 }, { "nomultilink", o_bool, &multilink, "Disable multilink operation", OPT_PRIOSUB | 0 }, diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch index 5ed861d5451..96f4bcaf702 100644 --- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch +++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch @@ -1,8 +1,8 @@ --- a/configure +++ b/configure -@@ -195,7 +195,7 @@ if [ -d "$ksrc" ]; then +@@ -133,7 +133,7 @@ if [ -d "$ksrc" ]; then mkmkf $ksrc/Makedefs$compiletype Makedefs.com - for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/rp-pppoe \ + for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/pppoe \ pppd/plugins/radius pppd/plugins/pppoatm \ - pppd/plugins/pppol2tp; do + pppd/plugins/pppol2tp pppd/plugins/pptp ; do @@ -11,12 +11,12 @@ if [ -f $ksrc/Makefile.$makext$archvariant ]; then --- a/pppd/plugins/Makefile.linux +++ b/pppd/plugins/Makefile.linux -@@ -9,7 +9,7 @@ BINDIR = $(DESTDIR)/sbin - MANDIR = $(DESTDIR)/share/man/man8 - LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) +@@ -14,7 +14,7 @@ INSTALL = install + # EAP-TLS + CFLAGS += -DUSE_EAPTLS=1 --SUBDIRS := rp-pppoe pppoatm pppol2tp -+SUBDIRS := rp-pppoe pppoatm pppol2tp pptp +-SUBDIRS := pppoe pppoatm pppol2tp ++SUBDIRS := pppoe pppoatm pppol2tp pptp # Uncomment the next line to include the radius authentication plugin SUBDIRS += radius PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so diff --git a/package/network/services/ppp/patches/511-syncppp.patch b/package/network/services/ppp/patches/512-syncppp.patch similarity index 91% rename from package/network/services/ppp/patches/511-syncppp.patch rename to package/network/services/ppp/patches/512-syncppp.patch index 455ae1fd229..39ff52000fa 100644 --- a/package/network/services/ppp/patches/511-syncppp.patch +++ b/package/network/services/ppp/patches/512-syncppp.patch @@ -9,7 +9,7 @@ #ifdef CHAPMS #include "chap_ms.h" #define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) -@@ -481,6 +483,18 @@ chap_respond(struct chap_client_state *cs, int id, +@@ -523,6 +525,18 @@ chap_respond(struct chap_client_state *cs, int id, p[2] = len >> 8; p[3] = len; @@ -30,7 +30,7 @@ --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -13,16 +13,16 @@ TARGETS = pppd +@@ -17,16 +17,16 @@ TARGETS = pppd PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \ ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \ @@ -50,10 +50,10 @@ # # include dependencies if present -@@ -33,7 +33,7 @@ endif - # CC = gcc - # - COPTS = -O2 -pipe -Wall -g +@@ -34,7 +34,7 @@ ifeq (.depend,$(wildcard .depend)) + include .depend + endif + -LIBS = -lrt +LIBS = -lpthread @@ -61,7 +61,7 @@ # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. --- a/pppd/options.c +++ b/pppd/options.c -@@ -123,6 +123,7 @@ bool dump_options; /* print out option values */ +@@ -127,6 +127,7 @@ bool dump_options; /* print out option values */ bool dryrun; /* print out option values and exit */ char *domain; /* domain name set by domain option */ int child_wait = 5; /* # seconds to wait for children at exit */ @@ -69,7 +69,7 @@ struct userenv *userenv_list; /* user environment variables */ int dfl_route_metric = -1; /* metric of the default route to set over the PPP link */ -@@ -312,6 +313,9 @@ option_t general_options[] = { +@@ -323,6 +324,9 @@ option_t general_options[] = { "Unset user environment variable", OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint }, @@ -81,14 +81,14 @@ OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 }, --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -341,6 +341,7 @@ extern char *bundle_name; /* bundle name for multilink */ +@@ -335,6 +335,7 @@ extern char *bundle_name; /* bundle name for multilink */ extern bool dump_options; /* print out option values */ extern bool dryrun; /* check everything, print options, exit */ extern int child_wait; /* # seconds to wait for children at end */ +extern int npppd; /* synchronize between multiple pppd */ - #ifdef MAXOCTETS - extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ + #ifdef USE_EAPTLS + extern char *crl_dir; --- /dev/null +++ b/pppd/syncppp.c @@ -0,0 +1,75 @@ @@ -175,7 +175,7 @@ +#define SYNCPPP_TIMEOUT 5 --- a/pppd/upap.c +++ b/pppd/upap.c -@@ -52,6 +52,7 @@ +@@ -50,6 +50,7 @@ #include "pppd.h" #include "upap.h" @@ -183,7 +183,7 @@ static bool hide_password = 1; -@@ -567,6 +568,18 @@ upap_sauthreq(u) +@@ -540,6 +541,18 @@ upap_sauthreq(upap_state *u) PUTCHAR(u->us_passwdlen, outp); BCOPY(u->us_passwd, outp, u->us_passwdlen); diff --git a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch index 49bdb28fe28..a3042af533f 100644 --- a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch +++ b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch @@ -15,8 +15,8 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -35,10 +35,10 @@ endif - COPTS = -O2 -pipe -Wall -g +@@ -36,10 +36,10 @@ endif + LIBS = -lpthread -# Uncomment the next line to include support for Microsoft's @@ -28,19 +28,19 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. # Don't use MSLANMAN unless you really know what you're doing. #MSLANMAN=y # Uncomment the next line to include support for MPPE. CHAPMS (above) must -@@ -141,8 +141,7 @@ endif +@@ -158,8 +158,7 @@ endif ifdef NEEDDES ifndef USE_CRYPT -CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl --LIBS += -lcrypto +-NEEDCRYPTOLIB = y +LIBS += -ldes $(LIBS) else CFLAGS += -DUSE_CRYPT=1 endif --- a/pppd/pppcrypt.c +++ b/pppd/pppcrypt.c -@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w +@@ -62,7 +62,7 @@ MakeKey(u_char *key, u_char *des_key) des_key[7] = Get7Bits(key, 49); #ifndef USE_CRYPT @@ -49,7 +49,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. #endif } -@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */ +@@ -147,30 +147,30 @@ DesDecrypt(u_char *cipher, u_char *clear } #else /* USE_CRYPT */ @@ -57,8 +57,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. +static des_key_schedule key_schedule; bool - DesSetkey(key) - u_char *key; + DesSetkey(u_char *key) { - DES_cblock des_key; + des_cblock des_key; @@ -69,10 +68,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. } bool --DesEncrypt(clear, cipher) -+DesEncrypt(clear, key, cipher) - u_char *clear; /* IN 8 octets */ - u_char *cipher; /* OUT 8 octets */ + DesEncrypt(u_char *clear, u_char *cipher) { - DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, - &key_schedule, 1); @@ -81,9 +77,8 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. return (1); } -@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear) - u_char *cipher; /* IN 8 octets */ - u_char *clear; /* OUT 8 octets */ + bool + DesDecrypt(u_char *cipher, u_char *clear) { - DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear, - &key_schedule, 0); diff --git a/package/network/services/ppp/patches/610-pppd_compile_fix.patch b/package/network/services/ppp/patches/610-pppd_compile_fix.patch index 474f11832ae..4f66e5d71f0 100644 --- a/package/network/services/ppp/patches/610-pppd_compile_fix.patch +++ b/package/network/services/ppp/patches/610-pppd_compile_fix.patch @@ -1,6 +1,6 @@ --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -48,7 +48,8 @@ MPPE=y +@@ -49,7 +49,8 @@ MPPE=y # Uncomment the next line to include support for PPP packet filtering. # This requires that the libpcap library and headers be installed # and that the kernel driver support PPP packet filtering. diff --git a/target/linux/mediatek/files-5.4/include/uapi/linux/wapp/wapp_cmm_type.h b/target/linux/mediatek/files-5.4/include/uapi/linux/wapp/wapp_cmm_type.h index b51ea3f1aed..830e39e2461 100755 --- a/target/linux/mediatek/files-5.4/include/uapi/linux/wapp/wapp_cmm_type.h +++ b/target/linux/mediatek/files-5.4/include/uapi/linux/wapp/wapp_cmm_type.h @@ -24,6 +24,7 @@ Who When What -------- ---------- ---------------------------------------------- */ + /* This file is used by wifi driver and wapp. Keep data structure sync */ @@ -83,10 +84,16 @@ #define MAX_PROFILE_CNT 4 #define PER_EVENT_LIST_MAX_NUM 5 #define DAEMON_NEIGHBOR_REPORT_MAX_NUM 128 -#define VERSION_WAPP_CMM "v3.0.1.2" +#define VERSION_WAPP_CMM "v3.0.2.0" #ifdef MAP_R3_WF6 #define MAX_TID 4 #endif + +/* If this value is passed during map set channel + * then no need to parse that argument + */ +#define SET_CH_ARG_NOT_REQ 255 + typedef enum { WAPP_STA_INVALID, WAPP_STA_DISCONNECTED, @@ -726,10 +733,15 @@ struct GNU_PACKED cce_vendor_ie }; #define MAX_CCE_CHANNEL 128 +#define MAX_RNR_CHANNEL 30 struct GNU_PACKED cce_vendor_ie_result { u8 num; u8 cce_ch[MAX_CCE_CHANNEL];//channel list, on which beacon includes cce ie +#ifdef MAP_R3_6E_SUPPORT + u8 rnr_6e_num; + u8 rnr_6e_ch[MAX_RNR_CHANNEL]; +#endif }; #endif @@ -791,7 +803,7 @@ struct GNU_PACKED band_status_change { typedef struct GNU_PACKED _NDIS_802_11_SSID { u32 SsidLength; /* length of SSID field below, in bytes; */ /* this can be zero. */ - char Ssid[MAX_LEN_OF_SSID]; /* SSID information field */ + char Ssid[MAX_LEN_OF_SSID + 1]; /* SSID information field */ } NDIS_802_11_SSID, *PNDIS_802_11_SSID; struct GNU_PACKED nop_channel_list_s { @@ -895,6 +907,27 @@ struct GNU_PACKED pmk_req { size_t ssidlen; }; #endif /*DPP_SUPPORT*/ + +struct GNU_PACKED mnt_sta { + u32 ifindex; + u8 sta_mac[MAC_ADDR_LEN]; + u8 sta_id; +}; + +struct GNU_PACKED mnt_max_pkt { + u32 ifindex; + u32 pkt_number; +}; + +struct GNU_PACKED map_ch { + u32 ifindex; + u8 ch_num; +#ifdef MAP_R2 + u8 cac_req; + u8 map_dev_role; +#endif /* MAP_R2 */ +}; + #ifdef MAP_R3 struct GNU_PACKED wapp_sta_info { u8 src[MAC_ADDR_LEN];