mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 06:08:08 +00:00
6in4: allow specifying tunnel device name
Accept 'device' option, allowing to specify custom l3 device name, instead of default autogenerated one (prefix "6in4-" + interface name) Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com> Link: https://github.com/openwrt/openwrt/pull/15961 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
e8d6db7146
commit
cdb535ac32
@ -45,10 +45,12 @@ proto_6in4_setup() {
|
|||||||
local iface="$2"
|
local iface="$2"
|
||||||
local link="6in4-$cfg"
|
local link="6in4-$cfg"
|
||||||
|
|
||||||
local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey
|
local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey device
|
||||||
json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey
|
json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey device
|
||||||
json_for_each_item proto_6in4_add_prefix ip6prefix ip6prefixes
|
json_for_each_item proto_6in4_add_prefix ip6prefix ip6prefixes
|
||||||
|
|
||||||
|
[ -n "$device" ] && link="$device"
|
||||||
|
|
||||||
[ -z "$peeraddr" ] && {
|
[ -z "$peeraddr" ] && {
|
||||||
proto_notify_error "$cfg" "MISSING_ADDRESS"
|
proto_notify_error "$cfg" "MISSING_ADDRESS"
|
||||||
proto_block_restart "$cfg"
|
proto_block_restart "$cfg"
|
||||||
@ -156,6 +158,7 @@ proto_6in4_init_config() {
|
|||||||
proto_config_add_int "mtu"
|
proto_config_add_int "mtu"
|
||||||
proto_config_add_int "ttl"
|
proto_config_add_int "ttl"
|
||||||
proto_config_add_string "tos"
|
proto_config_add_string "tos"
|
||||||
|
proto_config_add_string "device"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n "$INCLUDE_ONLY" ] || {
|
[ -n "$INCLUDE_ONLY" ] || {
|
||||||
|
Loading…
Reference in New Issue
Block a user