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

Collapse All | Expand All

(-)a/dnscache.c (-1 / +11 lines)
Lines 58-63 Link Here
58
static char buf[1024];
58
static char buf[1024];
59
uint64 numqueries = 0;
59
uint64 numqueries = 0;
60
60
61
static unsigned int truncate_len = 512;
61
62
62
static int udp53;
63
static int udp53;
63
64
Lines 84-90 Link Here
84
{
85
{
85
  if (!u[j].active) return;
86
  if (!u[j].active) return;
86
  response_id(u[j].id);
87
  response_id(u[j].id);
87
  if (response_len > 512) response_tc();
88
  if (response_len > truncate_len) response_tc();
88
  socket_send6(udp53,response,response_len,u[j].ip,u[j].port,u[j].scope_id);
89
  socket_send6(udp53,response,response_len,u[j].ip,u[j].port,u[j].scope_id);
89
  log_querydone(&u[j].active,response_len);
90
  log_querydone(&u[j].active,response_len);
90
  u[j].active = 0; --uactive;
91
  u[j].active = 0; --uactive;
Lines 449-454 Link Here
449
  if (!cache_init(cachesize))
450
  if (!cache_init(cachesize))
450
    strerr_die3x(111,FATAL,"not enough memory for cache of size ",x);
451
    strerr_die3x(111,FATAL,"not enough memory for cache of size ",x);
451
452
453
  x = env_get("TRUNCATELEN");
454
  if (x) {
455
    scan_ulong(x,&truncate_len);
456
    if (truncate_len < 512)
457
      truncate_len = 512;
458
    if (truncate_len > 16384)
459
      truncate_len = 16384;
460
  }
461
452
  if (openreadclose("ignoreip",&sa,64) < 0) 
462
  if (openreadclose("ignoreip",&sa,64) < 0) 
453
    strerr_die2x(111,FATAL,"trouble reading ignoreip");
463
    strerr_die2x(111,FATAL,"trouble reading ignoreip");
454
  for(j = k = i = 0; i < sa.len; i++)
464
  for(j = k = i = 0; i < sa.len; i++)
(-)djbdns-1.05.o/server.c (-1 / +10 lines)
Lines 94-99 Link Here
94
  int *udp53;
94
  int *udp53;
95
  unsigned int off;
95
  unsigned int off;
96
  unsigned int cnt;
96
  unsigned int cnt;
97
  unsigned int truncate_len = 512;
97
  iopause_fd *iop;
98
  iopause_fd *iop;
98
99
99
  x = env_get("IP");
100
  x = env_get("IP");
Lines 154-159 Link Here
154
155
155
  buffer_putsflush(buffer_2,starting);
156
  buffer_putsflush(buffer_2,starting);
156
157
158
  x = env_get("TRUNCATELEN");
159
  if (x) {
160
    scan_ulong(x,&truncate_len);
161
    if (truncate_len < 512)
162
      truncate_len = 512;
163
    if (truncate_len > 16384)
164
      truncate_len = 16384;
165
  }
157
  for (;;) {
166
  for (;;) {
158
    struct taia stamp;
167
    struct taia stamp;
159
    struct taia deadline;
168
    struct taia deadline;
Lines 168-174 Link Here
168
	len = socket_recv6(udp53[i],buf,sizeof buf,ip,&port,&ifid);
177
	len = socket_recv6(udp53[i],buf,sizeof buf,ip,&port,&ifid);
169
	if (len < 0) continue;
178
	if (len < 0) continue;
170
	if (!doit()) continue;
179
	if (!doit()) continue;
171
	if (response_len > 512) response_tc();
180
	if (response_len > truncate_len) response_tc();
172
	socket_send6(udp53[i],response,response_len,ip,port,ifid);
181
	socket_send6(udp53[i],response,response_len,ip,port,ifid);
173
	/* may block for buffer space; if it fails, too bad */
182
	/* may block for buffer space; if it fails, too bad */
174
      }
183
      }

Return to bug 916209