Split listening port argument at the rightmost colon, allows binding to

specific IPv6 addresses.

From OpenWRT,
https://dev.openwrt.org/browser/trunk/package/dropbear/patches/300-ipv6_addr_port_split.patch
This commit is contained in:
Matt Johnston 2012-04-12 22:04:16 +08:00
parent 3e2b6a1821
commit 6467b8d903

View File

@ -325,7 +325,7 @@ static void addportandaddress(char* spec) {
myspec = m_strdup(spec); myspec = m_strdup(spec);
/* search for ':', that separates address and port */ /* search for ':', that separates address and port */
svr_opts.ports[svr_opts.portcount] = strchr(myspec, ':'); svr_opts.ports[svr_opts.portcount] = strrchr(myspec, ':');
if (svr_opts.ports[svr_opts.portcount] == NULL) { if (svr_opts.ports[svr_opts.portcount] == NULL) {
/* no ':' -> the whole string specifies just a port */ /* no ':' -> the whole string specifies just a port */