uqmi: inherit firewall zone membership to virtual sub interfaces

This commit is contained in:
CN_SZTL 2019-08-16 13:01:10 +08:00
parent 974b540cb9
commit 240eaaa74a
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 15 additions and 5 deletions

8
package/network/utils/uqmi/Makefile Executable file → Normal file
View File

@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uqmi
PKG_RELEASE:=5
PKG_RELEASE:=7
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
PKG_SOURCE_DATE:=2016-12-19
PKG_SOURCE_VERSION:=8ceeab690d8c6f1e3afbd4bcaee7bc2ba3fbe165
PKG_MIRROR_HASH:=b3637ff04e51769137af1c5e173e73311e11c3c2dcc49eeaca6aa3520f61d247
PKG_SOURCE_DATE:=2019-06-27
PKG_SOURCE_VERSION:=1965c713937495a5cb029165c16acdb6572c3f87
PKG_MIRROR_HASH:=3c39b1c1f20b7d523b0891d08b3d10233331ada8e11d0b55cfd4882816308951
PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
PKG_LICENSE:=GPL-2.0

View File

@ -83,7 +83,7 @@ proto_qmi_setup() {
fi
done
if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"' > /dev/null; then
if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"\|"Invalid QMI command"' > /dev/null; then
[ -n "$pincode" ] && {
uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || {
echo "Unable to verify PIN"
@ -298,6 +298,9 @@ proto_qmi_setup() {
}
proto_close_data
proto_send_update "$interface"
local zone="$(fw3 -q network "$interface" 2>/dev/null)"
[ -n "$pdh_6" ] && {
if [ -z "$dhcpv6" -o "$dhcpv6" = 0 ]; then
json_load "$(uqmi -s -d $device --set-client-id wds,$cid_6 --get-current-settings)"
@ -318,6 +321,11 @@ proto_qmi_setup() {
proto_add_dns_server "$dns1_6"
proto_add_dns_server "$dns2_6"
}
[ -n "$zone" ] && {
proto_add_data
json_add_string zone "$zone"
proto_close_data
}
proto_send_update "$interface"
else
json_init
@ -328,6 +336,7 @@ proto_qmi_setup() {
proto_add_dynamic_defaults
# RFC 7278: Extend an IPv6 /64 Prefix to LAN
json_add_string extendprefix 1
[ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
fi
@ -340,6 +349,7 @@ proto_qmi_setup() {
json_add_string proto "dhcp"
[ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
proto_add_dynamic_defaults
[ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
}