projects
/
openwrt
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ipip: Support fqdn as remote tunnel endpoint
[openwrt/.git]
/
package
/
network
/
config
/
ipip
/
files
/
ipip.sh
diff --git
a/package/network/config/ipip/files/ipip.sh
b/package/network/config/ipip/files/ipip.sh
index 51c503f8950eedb9521c26a63866bd5d49acd2d4..f1c94d6eeddbeb47c566764998f4ce6504742b0d 100755
(executable)
--- a/
package/network/config/ipip/files/ipip.sh
+++ b/
package/network/config/ipip/files/ipip.sh
@@
-9,16
+9,29
@@
proto_ipip_setup() {
local cfg="$1"
proto_ipip_setup() {
local cfg="$1"
+ local remoteip
local df ipaddr peeraddr tunlink ttl tos zone mtu
json_get_vars df ipaddr peeraddr tunlink ttl tos zone mtu
[ -z "$peeraddr" ] && {
local df ipaddr peeraddr tunlink ttl tos zone mtu
json_get_vars df ipaddr peeraddr tunlink ttl tos zone mtu
[ -z "$peeraddr" ] && {
- proto_notify_error "$cfg" "MISSING_ADDRESS"
+ proto_notify_error "$cfg" "MISSING_
PEER_
ADDRESS"
proto_block_restart "$cfg"
return
}
proto_block_restart "$cfg"
return
}
+ remoteip=$(resolveip -t 10 -4 "$peeraddr")
+
+ if [ -z "$remoteip" ]; then
+ proto_notify_error "$cfg" "PEER_RESOLVE_FAIL"
+ return
+ fi
+
+ for ip in $remoteip; do
+ peeraddr=$ip
+ break
+ done
+
( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
[ -z "$ipaddr" ] && {
( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
[ -z "$ipaddr" ] && {