Module: sip-router
Branch: ser_core_cvs
Commit: 887ca9955a33b892e89f6bf0f97be5971da814e0
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=887ca99…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Nov 25 19:15:05 2008 +0000
dns: fixed missing sctp SRV queries
- support for sctp SRV queries was missing
---
config.h | 3 +++
resolve.c | 5 +++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/config.h b/config.h
index 4fec2d9..393d1f3 100644
--- a/config.h
+++ b/config.h
@@ -126,6 +126,9 @@
#define SRV_TLS_PREFIX "_sips._tcp."
#define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
+#define SRV_SCTP_PREFIX "_sip._sctp."
+#define SRV_SCTP_PREFIX_LEN (sizeof(SRV_SCTP_PREFIX) - 1)
+
#define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
/*used only if PKG_MALLOC is defined*/
diff --git a/resolve.c b/resolve.c
index e492244..94e0558 100644
--- a/resolve.c
+++ b/resolve.c
@@ -1019,6 +1019,11 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned
short* port,
memcpy(tmp+SRV_TLS_PREFIX_LEN, name->s, name->len);
tmp[SRV_TLS_PREFIX_LEN + name->len] = '\0';
break;
+ case PROTO_SCTP:
+ memcpy(tmp, SRV_SCTP_PREFIX, SRV_SCTP_PREFIX_LEN);
+ memcpy(tmp+SRV_SCTP_PREFIX_LEN, name->s, name->len);
+ tmp[SRV_SCTP_PREFIX_LEN + name->len] = '\0';
+ break;
default:
LOG(L_CRIT, "BUG: sip_resolvehost: unknown proto %d\n",
srv_proto);