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

Daniel-Constantin Mierla miconda at gmail.com
Tue Oct 25 17:37:41 CEST 2011


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

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

---

 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