quectel-cm: add sourcefilter/delegate option support

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Chen Minqiang
2024-05-26 20:50:27 +08:00
committed by Tianling Shen
parent a8f83a131a
commit fc0a552b83
2 changed files with 7 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=quectel-cm
PKG_VERSION:=1.6.5
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

View File

@@ -19,6 +19,8 @@ proto_quectel_init_config() {
proto_config_add_string "pdptype"
proto_config_add_boolean "dhcp"
proto_config_add_boolean "dhcpv6"
proto_config_add_boolean "sourcefilter"
proto_config_add_boolean "delegate"
proto_config_add_int "mtu"
proto_config_add_defaults
}
@@ -26,12 +28,12 @@ proto_quectel_init_config() {
proto_quectel_setup() {
local interface="$1"
local device apn auth username password pincode delay pdptype
local dhcp dhcpv6 mtu $PROTO_DEFAULT_OPTIONS
local dhcp dhcpv6 sourcefilter delegate mtu $PROTO_DEFAULT_OPTIONS
local ip4table ip6table
local pid zone
json_get_vars device apn auth username password pincode delay
json_get_vars pdptype dhcp dhcpv6 ip4table
json_get_vars pdptype dhcp dhcpv6 sourcefilter delegate ip4table
json_get_vars ip6table mtu $PROTO_DEFAULT_OPTIONS
[ -n "$delay" ] && sleep "$delay"
@@ -96,6 +98,8 @@ proto_quectel_setup() {
[ -z "$ip6table" ] || json_add_string ip6table "$ip6table"
# RFC 7278: Extend an IPv6 /64 Prefix to LAN
json_add_string extendprefix 1
[ "$delegate" = "0" ] && json_add_boolean delegate "0"
[ "$sourcefilter" = "0" ] && json_add_boolean sourcefilter "0"
[ -z "$zone" ] || json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"