Browse code

nathelper: don't fail if 'a=rtcp' has no IP

Examples from RFC3605:
> m=audio 49170 RTP/AVP 0
> a=rtcp:53020
>
> m=audio 49170 RTP/AVP 0
> a=rtcp:53020 IN IP4 126.16.64.4
>
> m=audio 49170 RTP/AVP 0
> a=rtcp:53020 IN IP6 2001:2345:6789:ABCD:EF01:2345:6789:ABCD

fix #2768

(cherry picked from commit 71441c08970c307e2ce17b2dd292630ea615079c)

Victor Seva authored on 08/06/2021 13:03:21 • Daniel-Constantin Mierla committed on 15/06/2021 08:00:00
Showing 1 changed files
... ...
@@ -1655,7 +1655,7 @@ static inline int replace_sdp_ip(
1655 1655
 		hasreplaced = 1;
1656 1656
 		body1 = body2;
1657 1657
 	}
1658
-	if(!hasreplaced) {
1658
+	if(!hasreplaced && memcmp("a=rtcp", line, 6) != 0) {
1659 1659
 		LM_ERR("can't extract '%s' IP from the SDP\n", line);
1660 1660
 		return -1;
1661 1661
 	}