Listener: default 'ipv6' parameter to true if bind address contains ':'.

git-svn-id: http://yate.null.ro/svn/yate/trunk@6119 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2016-05-24 14:01:04 +00:00
parent d8b25337a9
commit a16b32b009
2 changed files with 6 additions and 5 deletions

View File

@ -47,7 +47,7 @@
; ipv6: boolean: Listen on IPv6 address(es)
; Listen will fail if IPv6 support is not enabled or not supported
; Defaults to no
; Defaults to 'yes' if IP address is an IPv6 one or 'no' otherwise
;ipv6=no
; udp_force_bind: boolean: Try to use a random port if failed to bind on configured one (UDP only)
@ -509,7 +509,7 @@
; ipv6: boolean: Listen on IPv6 address(es)
; Listen will fail if IPv6 support is not enabled or not supported
; Defaults to no
; Defaults to 'yes' if IP address is an IPv6 one or 'no' otherwise
;ipv6=no
; rtp_localip: ipaddress: IP address to bind local RTP to

View File

@ -3062,8 +3062,9 @@ bool YateSIPUDPTransport::init(const NamedList& params, const NamedList& defs, b
m_forceBind = params.getBoolValue("udp_force_bind",true);
m_bufferReq = params.getIntValue("buffer",defs.getIntValue("buffer"));
if (first) {
setAddr(params.getValue("addr"),params.getIntValue("port",5060),
params.getBoolValue("ipv6"));
const String& addr = params["addr"];
setAddr(addr,params.getIntValue("port",5060),
params.getBoolValue("ipv6",(addr.find(':') >= 0)));
m_ipv6Support = s_ipv6;
}
bool ok = YateSIPTransport::init(params,defs,first,prio);
@ -3949,7 +3950,7 @@ void YateSIPTCPListener::init(const NamedList& params, bool first)
m_sslContextCheck = true;
}
m_backlog = params.getIntValue("backlog",5,0);
setAddr(addr,port,params.getBoolValue("ipv6"));
setAddr(addr,port,params.getBoolValue("ipv6",(addr.find(':') >= 0)));
if (first)
m_bind = true;
updateIPv6Support();