comparison svr-runopts.c @ 671:675bbd630f5d

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
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Apr 2012 22:04:16 +0800
parents e27d7fb23376
children c58a15983808
comparison
equal deleted inserted replaced
670:349fb2dda2dd 671:675bbd630f5d
323 323
324 /* We don't free it, it becomes part of the runopt state */ 324 /* We don't free it, it becomes part of the runopt state */
325 myspec = m_strdup(spec); 325 myspec = m_strdup(spec);
326 326
327 /* search for ':', that separates address and port */ 327 /* search for ':', that separates address and port */
328 svr_opts.ports[svr_opts.portcount] = strchr(myspec, ':'); 328 svr_opts.ports[svr_opts.portcount] = strrchr(myspec, ':');
329 329
330 if (svr_opts.ports[svr_opts.portcount] == NULL) { 330 if (svr_opts.ports[svr_opts.portcount] == NULL) {
331 /* no ':' -> the whole string specifies just a port */ 331 /* no ':' -> the whole string specifies just a port */
332 svr_opts.ports[svr_opts.portcount] = myspec; 332 svr_opts.ports[svr_opts.portcount] = myspec;
333 } else { 333 } else {