mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 21:24:31 +04:00
tunneldigger: add broker_selection option to expose load balancing capabilities
Using the broker_selection param makes it possible to decide by use (default), always use the first available broker to connect or select a random broker See also:51a5e46ad1/client/l2tp_client.c (L1331-L1333)Signed-off-by: Florian Maurer <f.maurer@outlook.de> (cherry picked from commit296c15c1f2)
This commit is contained in:
committed by
Nick Hainke
parent
9d839fe5a7
commit
3f75acf66a
@@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=tunneldigger
|
PKG_NAME:=tunneldigger
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE_URL:=https://github.com/wlanslovenija/tunneldigger.git
|
PKG_SOURCE_URL:=https://github.com/wlanslovenija/tunneldigger.git
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ config broker
|
|||||||
option uuid 'abcd'
|
option uuid 'abcd'
|
||||||
option interface 'l2tp0'
|
option interface 'l2tp0'
|
||||||
option limit_bw_down '1024'
|
option limit_bw_down '1024'
|
||||||
|
option broker_selection 'usage'
|
||||||
option enabled '0'
|
option enabled '0'
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ parse_broker() {
|
|||||||
config_get hook_script "$section" hook_script
|
config_get hook_script "$section" hook_script
|
||||||
config_get bind_interface "$section" bind_interface
|
config_get bind_interface "$section" bind_interface
|
||||||
config_get group "$section" group
|
config_get group "$section" group
|
||||||
|
config_get broker_selection "$section" broker_selection
|
||||||
|
|
||||||
[ $enabled -eq 0 ] && return
|
[ $enabled -eq 0 ] && return
|
||||||
|
|
||||||
@@ -38,6 +39,20 @@ parse_broker() {
|
|||||||
network_get_device _bind_interface "${bind_interface}" || _bind_interface="${bind_interface}"
|
network_get_device _bind_interface "${bind_interface}" || _bind_interface="${bind_interface}"
|
||||||
append broker_opts "-I ${_bind_interface}"
|
append broker_opts "-I ${_bind_interface}"
|
||||||
}
|
}
|
||||||
|
[ ! -z "${broker_selection}" ] && {
|
||||||
|
# Set broker selection.
|
||||||
|
case "${broker_selection}" in
|
||||||
|
usage)
|
||||||
|
append broker_opts "-a"
|
||||||
|
;;
|
||||||
|
first)
|
||||||
|
append broker_opts "-g"
|
||||||
|
;;
|
||||||
|
random)
|
||||||
|
append broker_opts "-r"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
if [ -z "$uuid" ]; then
|
if [ -z "$uuid" ]; then
|
||||||
missing uuid
|
missing uuid
|
||||||
|
|||||||
Reference in New Issue
Block a user