[sr-dev] git:3.2: core/sdp: restore setting of IP address type

Daniel-Constantin Mierla miconda at gmail.com
Wed Oct 26 19:07:35 CEST 2011


Module: sip-router
Branch: 3.2
Commit: a356ec5e2ce2daa16b1e2339880cb29a39ebc975
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a356ec5e2ce2daa16b1e2339880cb29a39ebc975

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Oct 25 17:35:25 2011 +0200

core/sdp: restore setting of IP address type

- refactoring of extract_mediaip() skipped setting IPv4/IPv6 type in sdp
  structure
- reported by Jason Penton
(cherry picked from commit 6e1af068c99e84d0bfd5f713ced1e5f484ff9c5c)

---

 parser/sdp/sdp_helpr_funcs.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/parser/sdp/sdp_helpr_funcs.c b/parser/sdp/sdp_helpr_funcs.c
index 09a9287..13d1ca9 100644
--- a/parser/sdp/sdp_helpr_funcs.c
+++ b/parser/sdp/sdp_helpr_funcs.c
@@ -451,9 +451,16 @@ int extract_mediaip(str *body, str *mediaip, int *pf, char *line)
 		LM_ERR("invalid content for `%s' line\n",line);
 		return -1;
 	}
-	if(cp[3]!='4' && cp[3]!='6') {
-		LM_ERR("invalid addrtype IPx for `%s' line\n",line);
-		return -1;
+	switch(cp[3]) {
+		case '4':
+			*pf = AF_INET;
+		break;
+		case '6':
+			*pf = AF_INET6;
+		break;
+		default:
+			LM_ERR("invalid addrtype IPx for `%s' line\n",line);
+			return -1;
 	}
 	cp += 5;
 




More information about the sr-dev mailing list