Merge pull request #887 from tcatm/master

tayga: allow more flexible routing
This commit is contained in:
Steven Barth 2015-02-10 14:43:28 +01:00
commit 90df5a2f5b

View file

@ -14,8 +14,8 @@ proto_tayga_setup() {
local iface="$2"
local link="tayga-$cfg"
local ipv4_addr ipv6_addr prefix dynamic_pool ipaddr ip6addr
json_get_vars ipv4_addr ipv6_addr prefix dynamic_pool ipaddr ip6addr
local ipv4_addr ipv6_addr prefix dynamic_pool ipaddr ip6addr noroutes
json_get_vars ipv4_addr ipv6_addr prefix dynamic_pool ipaddr ip6addr noroutes
[ -z "$ipv4_addr" -o -z "$prefix" ] && {
proto_notify_error "$cfg" "REQUIRED_PARAMETERS_MISSING"
proto_block_restart "$cfg"
@ -49,6 +49,8 @@ proto_tayga_setup() {
[ -n "$ipaddr" ] && proto_add_ipv4_address "$ipaddr" "255.255.255.255"
[ -n "$ip6addr" ] && proto_add_ipv6_address "$ip6addr" "128"
[ "$noroutes" != 1 ] && {
[ -n "$ipv6_addr" ] && proto_add_ipv6_route "$ipv6_addr" "128"
[ -n "$dynamic_pool" ] && {
local pool="${dynamic_pool%%/*}"
@ -60,6 +62,7 @@ proto_tayga_setup() {
local mask6="${prefix##*/}"
proto_add_ipv6_route "$prefix6" "$mask6"
}
}
proto_send_update "$cfg"
@ -85,6 +88,7 @@ proto_tayga_init_config() {
proto_config_add_string "dynamic_pool"
proto_config_add_string "ipaddr"
proto_config_add_string "ip6addr:ip6addr"
proto_config_add_boolean "noroutes"
}
[ -n "$INCLUDE_ONLY" ] || {