Browse code

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 authored on 04/01/2021 15:35:44 • GitHub committed on 04/01/2021 15:35:44
Showing 1 changed files
... ...
@@ -1022,7 +1022,14 @@ int add_rtpengine_socks(struct rtpp_set *rtpp_list, char *rtpengine,
1022 1022
 
1023 1023
 		/* Check the rn_address is 'hostname:port' */
1024 1024
 		/* Check the rn_address port is valid */
1025
-		p1 = strchr(pnode->rn_address, ':');
1025
+		if(pnode->rn_umode == 6) {
1026
+                        p1 = strstr(pnode->rn_address, "]:");
1027
+                        if(p1 != NULL) {
1028
+                                p1++;
1029
+                        }
1030
+                } else {
1031
+                        p1 = strchr(pnode->rn_address, ':');
1032
+                }
1026 1033
 		if (p1 != NULL) {
1027 1034
 			p1++;
1028 1035
 		}