Pārlūkot izejas kodu

rtpengine: fixing wrong parsing the pair of IPv6 addr:port (#2592)

- fixing wrong parsing the pair of IPv6 addr:port in rtpengine module, when loading node information from database.
Dennis 4 gadi atpakaļ
vecāks
revīzija
13d786e33d
1 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 8 1
      src/modules/rtpengine/rtpengine.c

+ 8 - 1
src/modules/rtpengine/rtpengine.c

@@ -1022,7 +1022,14 @@ int add_rtpengine_socks(struct rtpp_set *rtpp_list, char *rtpengine,
 
 		/* Check the rn_address is 'hostname:port' */
 		/* Check the rn_address port is valid */
-		p1 = strchr(pnode->rn_address, ':');
+		if(pnode->rn_umode == 6) {
+                        p1 = strstr(pnode->rn_address, "]:");
+                        if(p1 != NULL) {
+                                p1++;
+                        }
+                } else {
+                        p1 = strchr(pnode->rn_address, ':');
+                }
 		if (p1 != NULL) {
 			p1++;
 		}