Skip to content

Commit 636d97c

Browse files
committed
Merge pull request #109 from rampageX/master
fix "unknown type name" error when compile in musl
2 parents 8b97964 + e22d23d commit 636d97c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/local_ns_parser.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ static int local_ns_skiprr(const unsigned char *ptr, const unsigned char *eom, n
77
static int local_ns_dn_skipname(const unsigned char *ptr, const unsigned char *eom);
88
static int local_ns_name_skip(const unsigned char **ptrptr, const unsigned char *eom);
99
static int local_ns_labellen(const unsigned char *lp);
10-
#define LOCAL_NS_TYPE_ELT 0x40 /*%< EDNS0 extended label type */
11-
#define LOCAL_DNS_LABELTYPE_BITSTRING 0x41
10+
#define LOCAL_NS_TYPE_ELT 0x40 /*%< EDNS0 extended label type */
11+
#define LOCAL_DNS_LABELTYPE_BITSTRING 0x41
1212
#ifdef __UCLIBC__
1313
#define LOCAL_NS_MSG_PTR _ptr
1414
#else
@@ -17,7 +17,7 @@ static int local_ns_labellen(const unsigned char *lp);
1717

1818
int local_ns_initparse(const unsigned char *msg, int msglen, ns_msg *handle)
1919
{
20-
const u_char *eom = msg + msglen;
20+
const unsigned char *eom = msg + msglen;
2121
int i;
2222

2323
handle->_msg = msg;
@@ -62,7 +62,7 @@ int local_ns_initparse(const unsigned char *msg, int msglen, ns_msg *handle)
6262

6363
local_ns_setsection(handle, ns_s_max);
6464
return 0;
65-
}
65+
}
6666
int local_ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr)
6767
{
6868
int b;
@@ -142,10 +142,10 @@ static void local_ns_setsection(ns_msg *msg, ns_sect sect)
142142
msg->_rrnum = 0;
143143
msg->LOCAL_NS_MSG_PTR = msg->_sections[(int)sect];
144144
}
145-
}
145+
}
146146
static int local_ns_skiprr(const unsigned char *ptr, const unsigned char *eom, ns_sect section, int count)
147147
{
148-
const u_char *optr = ptr;
148+
const unsigned char *optr = ptr;
149149

150150
for (; count > 0; count--) {
151151
int b, rdlength;
@@ -154,7 +154,7 @@ static int local_ns_skiprr(const unsigned char *ptr, const unsigned char *eom, n
154154
if (b < 0) {
155155
errno = EMSGSIZE;
156156
return -1;
157-
}
157+
}
158158
ptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/;
159159
if (section != ns_s_qd) {
160160
if (ptr + NS_INT32SZ + NS_INT16SZ > eom) {
@@ -174,7 +174,7 @@ static int local_ns_skiprr(const unsigned char *ptr, const unsigned char *eom, n
174174
}
175175

176176
return ptr - optr;
177-
}
177+
}
178178
static int local_ns_dn_skipname(const unsigned char *ptr, const unsigned char *eom)
179179
{
180180
const unsigned char *saveptr = ptr;
@@ -183,11 +183,11 @@ static int local_ns_dn_skipname(const unsigned char *ptr, const unsigned char *e
183183
return -1;
184184

185185
return ptr - saveptr;
186-
}
186+
}
187187
static int local_ns_name_skip(const unsigned char **ptrptr, const unsigned char *eom)
188188
{
189189
const unsigned char *cp;
190-
u_int n;
190+
unsigned int n;
191191
int l;
192192

193193
cp = *ptrptr;
@@ -223,7 +223,7 @@ static int local_ns_name_skip(const unsigned char **ptrptr, const unsigned char
223223
*ptrptr = cp;
224224

225225
return 0;
226-
}
226+
}
227227
static int local_ns_labellen(const unsigned char *lp)
228228
{
229229
int bitlen;
@@ -245,4 +245,4 @@ static int local_ns_labellen(const unsigned char *lp)
245245
}
246246

247247
return l;
248-
}
248+
}

0 commit comments

Comments
 (0)