File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2392,13 +2392,28 @@ int wolfSSL_BIO_flush(WOLFSSL_BIO* bio)
23922392 WOLFSSL_ENTER ("wolfSSL_BIO_new_connect" );
23932393 bio = wolfSSL_BIO_new (wolfSSL_BIO_s_socket ());
23942394 if (bio ) {
2395- const char * port = XSTRSTR (str , ":" );
2395+ const char * port ;
2396+ #ifdef WOLFSSL_IPV6
2397+ const char * ipv6Start = XSTRSTR (str , "[" );
2398+ const char * ipv6End = XSTRSTR (str , "]" );
2399+
2400+ if (ipv6End )
2401+ port = XSTRSTR (ipv6End , ":" );
2402+ else
2403+ #endif
2404+ port = XSTRSTR (str , ":" );
23962405
23972406 if (port != NULL )
23982407 bio -> port = (word16 )XATOI (port + 1 );
23992408 else
24002409 port = str + XSTRLEN (str ); /* point to null terminator */
24012410
2411+ #ifdef WOLFSSL_IPV6
2412+ if (ipv6Start && ipv6End ) {
2413+ str = ipv6Start + 1 ;
2414+ port = ipv6End ;
2415+ }
2416+ #endif
24022417 bio -> ip = (char * )XMALLOC (
24032418 (size_t )(port - str ) + 1 , /* +1 for null char */
24042419 bio -> heap , DYNAMIC_TYPE_OPENSSL );
You can’t perform that action at this time.
0 commit comments