Browse code

dns: fixed missing sctp SRV queries

- support for sctp SRV queries was missing

Andrei Pelinescu-Onciul authored on 25/11/2008 19:15:05
Showing 2 changed files
... ...
@@ -126,6 +126,9 @@
126 126
 #define SRV_TLS_PREFIX "_sips._tcp."
127 127
 #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
128 128
 
129
+#define SRV_SCTP_PREFIX "_sip._sctp."
130
+#define SRV_SCTP_PREFIX_LEN (sizeof(SRV_SCTP_PREFIX) - 1)
131
+
129 132
 #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
130 133
 
131 134
 /*used only if PKG_MALLOC is defined*/
... ...
@@ -1019,6 +1019,11 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
1019 1019
 					memcpy(tmp+SRV_TLS_PREFIX_LEN, name->s, name->len);
1020 1020
 					tmp[SRV_TLS_PREFIX_LEN + name->len] = '\0';
1021 1021
 					break;
1022
+				case PROTO_SCTP:
1023
+					memcpy(tmp, SRV_SCTP_PREFIX, SRV_SCTP_PREFIX_LEN);
1024
+					memcpy(tmp+SRV_SCTP_PREFIX_LEN, name->s, name->len);
1025
+					tmp[SRV_SCTP_PREFIX_LEN + name->len] = '\0';
1026
+					break;
1022 1027
 				default:
1023 1028
 					LOG(L_CRIT, "BUG: sip_resolvehost: unknown proto %d\n",
1024 1029
 							srv_proto);