[vlc-commits] smb2: support browsing IPv6 nodes

Pierre Lamot git at videolan.org
Wed Jun 3 12:06:56 CEST 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri May 29 09:15:13 2020 +0200| [e02146e9235d624f2822ef461890a9c1634d27ae] | committer: Pierre Lamot

smb2: support browsing IPv6 nodes

  Url of items discovered when listing smb2 folders where ill-formed on IPv6
  hosts.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e02146e9235d624f2822ef461890a9c1634d27ae
---

 modules/access/smb2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/access/smb2.c b/modules/access/smb2.c
index 17063c8406..c98c66a857 100644
--- a/modules/access/smb2.c
+++ b/modules/access/smb2.c
@@ -326,7 +326,10 @@ vlc_smb2_get_url(vlc_url_t *url, const char *file)
     /* smb2://<psz_host><psz_path><file>?<psz_option> */
     struct vlc_memstream buf;
     vlc_memstream_open(&buf);
-    vlc_memstream_printf(&buf, "smb://%s", url->psz_host);
+    if (strchr(url->psz_host, ':') != NULL)
+        vlc_memstream_printf(&buf, "smb://[%s]", url->psz_host);
+    else
+        vlc_memstream_printf(&buf, "smb://%s", url->psz_host);
 
     if (url->psz_path != NULL)
     {



More information about the vlc-commits mailing list