owsd: new version fixes ipv6...

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
This commit is contained in:
Denis Osvald 2016-06-02 20:36:08 +02:00 committed by Sukru Senli
parent 543baa4e04
commit bbd6575748
2 changed files with 23 additions and 5 deletions

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=owsd
PKG_VERSION:=0.97
PKG_VERSION:=0.98
PKG_RELEASE:=1
PKG_SOURCE_PROTO=git
PKG_SOURCE_URL:=git@public.inteno.se:owsd.git
PKG_SOURCE_VERSION:=40487a5d2d6541451095b9afcb23fd0d8395fde2
PKG_SOURCE_VERSION:=07da8de7d41775fd07eacbad77b2c21963f34f7a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
PKG_MAINTAINER:=Sartura Support for Inteno <support-inteno@sartura.hr>

View file

@ -22,12 +22,16 @@ validate_owsd_iface() {
'port:port' \
'interface:string' \
'origin:list(string)' \
'cert:string' \
'key:string'
'whitelist_interface_as_origin:bool' \
'ipv6:bool' \
'cert:file' \
'key:file'
}
. /lib/functions/network.sh
parse_owsd_iface() {
local port interface cert key
local port interface whitelist_interface_as_origin ipv6 cert key
validate_owsd_iface "$1" || {
echo "Validation failed"
@ -36,9 +40,23 @@ parse_owsd_iface() {
[ -n "${port}" ] && procd_append_param command -p "${port}"
[ -n "${interface}" ] && procd_append_param command -i "${interface}"
[ -n "${ipv6}" ] && procd_append_param command -6
[ -n "${cert}" ] && procd_append_param command -c "${cert}"
[ -n "${key}" ] && procd_append_param command -k "${key}"
if [ -n "${interface}" ] && [ -n "$whitelist_interface_as_origin" ]; then
local ip4addrs ip6addrs
if network_get_ipaddrs ip4addrs "${interface}"; then for addr in $ip4addrs; do
append_origin "http${cert:+s}://${addr}:${port}"
# TODO allow omitting default ports
done; fi
if [ -n "$ipv6}" ] && network_get_ip6addrs ip6addrs "${interface}"; then for addr in $ip6addrs; do
append_origin "http${cert:+s}://[[${addr}]]:${port}"
# TODO allow omitting default ports
done; fi
fi
config_list_foreach "$1" "origin" append_origin
}