mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
More cleanups and OSX fixes for 10.3
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
19
srv.c
19
srv.c
@@ -14,6 +14,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#if __APPLE_CC__ >= 1495
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#include <resolv.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -36,22 +39,6 @@ struct srv {
|
||||
unsigned short portnum;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
static int parse_ie(unsigned char *data, int maxdatalen, unsigned char *src, int srclen)
|
||||
{
|
||||
int len, olen;
|
||||
len = olen = (int)src[0];
|
||||
src++;
|
||||
srclen--;
|
||||
if (len > srclen) {
|
||||
ast_log(LOG_WARNING, "Want %d, got %d\n", len, srclen);
|
||||
return -1;
|
||||
}
|
||||
if (len > maxdatalen)
|
||||
len = maxdatalen;
|
||||
memcpy(data, src, len);
|
||||
return olen + 1;
|
||||
}
|
||||
|
||||
static int parse_srv(unsigned char *host, int hostlen, int *portno, unsigned char *answer, int len, unsigned char *msg)
|
||||
{
|
||||
int res = 0;
|
||||
|
Reference in New Issue
Block a user