Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 230091 | Differences between
and this patch

Collapse All | Expand All

(-)common/resolver.c.orig (-15 lines)
Lines 26-34 Link Here
26
26
27
int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
27
int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
28
{
28
{
29
#ifdef _LINUX
30
	struct __res_state	res;
31
#endif
32
	unsigned char		answer[8192];
29
	unsigned char		answer[8192];
33
	HEADER			*header = (HEADER *)answer;
30
	HEADER			*header = (HEADER *)answer;
34
	char			buf[2048];
31
	char			buf[2048];
Lines 38-57 Link Here
38
	uint16_t		type = 0, class = 0;
35
	uint16_t		type = 0, class = 0;
39
	uint32_t		ttl = 0;
36
	uint32_t		ttl = 0;
40
37
41
#ifdef _LINUX
42
	memset(&res, 0, sizeof(res));
43
	res.options = RES_DEBUG;
44
	res_ninit(&res);
45
#else
46
	res_init();
47
#endif
48
49
	memset(answer, 0, sizeof(answer));
38
	memset(answer, 0, sizeof(answer));
50
#ifdef _LINUX
51
	ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
52
#else
53
	ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
39
	ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
54
#endif
55
	if (ret < 0) return -1;
40
	if (ret < 0) return -1;
56
41
57
	/* Our start and end */
42
	/* Our start and end */
(-)unix-console/Makefile.orig (-2 / +2 lines)
Lines 39-46 Link Here
39
39
40
# GnuTLS Support ?
40
# GnuTLS Support ?
41
# Used by TIC to secure that communication
41
# Used by TIC to secure that communication
42
# Currently defaultly builds only on Linux, but other platforms might easily also support it
42
# Currently defaultly builds only on Linux, but other platforms might easily also support ii
43
ifeq ($(shell uname | grep -c "Linux"),1)
43
ifneq ($(HAVE_GNUTLS),)
44
CFLAGS	+= -D AICCU_GNUTLS
44
CFLAGS	+= -D AICCU_GNUTLS
45
LDFLAGS += -lgnutls
45
LDFLAGS += -lgnutls
46
endif
46
endif
(-)unix-console/Makefile.orig (-2 / +2 lines)
Lines 10-18 Link Here
10
#  $Date: 2007-01-15 11:04:27 $
10
#  $Date: 2007-01-15 11:04:27 $
11
# **********************************************************/
11
# **********************************************************/
12
12
13
SRCS	= main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
13
SRCS	= main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ../common/dn_skipname.c
14
INCS	= ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h
14
INCS	= ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h
15
OBJS	= main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
15
OBJS	= main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ../common/dn_skipname.o
16
16
17
# New features not fully implemented and thus disabled for now
17
# New features not fully implemented and thus disabled for now
18
#CFLAGS	+= -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE
18
#CFLAGS	+= -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE
(-) (+42 lines)
Added Link Here
1
#include <errno.h>
2
#include <resolv.h>
3
4
int ns_name_skip(const u_char **ptrptr, const u_char *eom)
5
{
6
       const u_char *cp;
7
       u_int n;
8
9
       cp = *ptrptr;
10
       while (cp < eom && (n = *cp++) != 0)
11
       {
12
               /* Check for indirection. */
13
               switch (n & NS_CMPRSFLGS) {
14
               case 0:                 /* normal case, n == len */
15
                       cp += n;
16
                       continue;
17
               case NS_CMPRSFLGS:      /* indirection */
18
                       cp++;
19
                       break;
20
               default:                /* illegal type */
21
                       errno = EMSGSIZE;
22
                       return (-1);
23
               }
24
               break;
25
       }
26
       if (cp > eom)
27
       {
28
               errno = EMSGSIZE;
29
               return (-1);
30
       }
31
       *ptrptr = cp;
32
       return (0);
33
}
34
35
int dn_skipname(const u_char *ptr, const u_char *eom)
36
{
37
       const u_char *saveptr = ptr;
38
39
       if(ns_name_skip(&ptr, eom) == -1)
40
               return (-1);
41
       return (ptr - saveptr);
42
}

Return to bug 230091