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

Collapse All | Expand All

(-)djbdns-1.05/axfr-get.c (+28 lines)
Lines 209-214 Link Here
209
    if (!stralloc_cats(&line,".:")) return 0;
209
    if (!stralloc_cats(&line,".:")) return 0;
210
    if (!stralloc_catulong0(&line,dist,0)) return 0;
210
    if (!stralloc_catulong0(&line,dist,0)) return 0;
211
  }
211
  }
212
  else if (byte_equal(data,2,DNS_T_SRV)) {
213
    uint16 dist, weight, port;
214
    if (!stralloc_copys(&line,"S")) return 0;
215
    if (!dns_domain_todot_cat(&line,d1)) return 0;
216
    if (!stralloc_cats(&line,"::")) return 0;
217
    pos = x_copy(buf,len,pos,data,2);
218
    uint16_unpack_big(data,&dist);
219
    pos = x_copy(buf,len,pos,data,2);
220
    uint16_unpack_big(data,&weight);
221
    pos = x_copy(buf,len,pos,data,2);
222
    uint16_unpack_big(data,&port);
223
    x_getname(buf,len,pos,&d1);
224
    if (!dns_domain_todot_cat(&line,d1)) return 0;
225
    if (!stralloc_cats(&line,".:")) return 0;
226
    if (!stralloc_catulong0(&line,dist,0)) return 0;
227
    if (!stralloc_cats(&line,":")) return 0;
228
    if (!stralloc_catulong0(&line,weight,0)) return 0;
229
    if (!stralloc_cats(&line,":")) return 0;
230
    if (!stralloc_catulong0(&line,port,0)) return 0;
231
  }
212
  else if (byte_equal(data,2,DNS_T_A) && (dlen == 4)) {
232
  else if (byte_equal(data,2,DNS_T_A) && (dlen == 4)) {
213
    char ipstr[IP4_FMT];
233
    char ipstr[IP4_FMT];
214
    if (!stralloc_copys(&line,"+")) return 0;
234
    if (!stralloc_copys(&line,"+")) return 0;
Lines 216-221 Link Here
216
    if (!stralloc_cats(&line,":")) return 0;
236
    if (!stralloc_cats(&line,":")) return 0;
217
    x_copy(buf,len,pos,data,4);
237
    x_copy(buf,len,pos,data,4);
218
    if (!stralloc_catb(&line,ipstr,ip4_fmt(ipstr,data))) return 0;
238
    if (!stralloc_catb(&line,ipstr,ip4_fmt(ipstr,data))) return 0;
239
  }
240
  else if (byte_equal(data,2,DNS_T_PTR)) {
241
    if (!stralloc_copys(&line,"^")) return 0;
242
    if (!dns_domain_todot_cat(&line,d1)) return 0;
243
    if (!stralloc_cats(&line,":")) return 0;
244
    x_getname(buf,len,pos,&d1);
245
    if (!dns_domain_todot_cat(&line,d1)) return 0;
246
    if (!stralloc_cats(&line,".")) return 0;
219
  }
247
  }
220
  else {
248
  else {
221
    unsigned char ch;
249
    unsigned char ch;
(-)djbdns-1.05/dns.h (+1 lines)
Lines 20-25 Link Here
20
#define DNS_T_SIG "\0\30"
20
#define DNS_T_SIG "\0\30"
21
#define DNS_T_KEY "\0\31"
21
#define DNS_T_KEY "\0\31"
22
#define DNS_T_AAAA "\0\34"
22
#define DNS_T_AAAA "\0\34"
23
#define DNS_T_SRV "\0\41"
23
#define DNS_T_AXFR "\0\374"
24
#define DNS_T_AXFR "\0\374"
24
#define DNS_T_ANY "\0\377"
25
#define DNS_T_ANY "\0\377"
25
26
(-)djbdns-1.05/tinydns-data.c (+38 lines)
Lines 196-201 Link Here
196
  char type[2];
196
  char type[2];
197
  char soa[20];
197
  char soa[20];
198
  char buf[4];
198
  char buf[4];
199
  char srv[6];
199
200
200
  umask(022);
201
  umask(022);
201
202
Lines 360-365 Link Here
360
	rr_start(DNS_T_MX,ttl,ttd,loc);
361
	rr_start(DNS_T_MX,ttl,ttd,loc);
361
	uint16_pack_big(buf,u);
362
	uint16_pack_big(buf,u);
362
	rr_add(buf,2);
363
	rr_add(buf,2);
364
	rr_addname(d2);
365
	rr_finish(d1);
366
367
	if (ip4_scan(f[1].s,ip)) {
368
	  rr_start(DNS_T_A,ttl,ttd,loc);
369
	  rr_add(ip,4);
370
	  rr_finish(d2);
371
	}
372
	break;
373
	
374
      case 'S':
375
	if (!dns_domain_fromdot(&d1,f[0].s,f[0].len)) nomem();
376
	if (!stralloc_0(&f[6])) nomem();
377
	if (!scan_ulong(f[6].s,&ttl)) ttl = TTL_POSITIVE;
378
	ttdparse(&f[7],ttd);
379
	locparse(&f[8],loc);
380
381
	if (!stralloc_0(&f[1])) nomem();
382
383
	if (byte_chr(f[2].s,f[2].len,'.') >= f[2].len) {
384
	  if (!stralloc_cats(&f[2],".srv.")) nomem();
385
	  if (!stralloc_catb(&f[2],f[0].s,f[0].len)) nomem();
386
	}
387
	if (!dns_domain_fromdot(&d2,f[2].s,f[2].len)) nomem();
388
389
	if (!stralloc_0(&f[4])) nomem();
390
	if (!scan_ulong(f[4].s,&u)) u = 0;
391
	uint16_pack_big(srv,u);
392
	if (!stralloc_0(&f[5])) nomem();
393
	if (!scan_ulong(f[5].s,&u)) u = 0;
394
	uint16_pack_big(srv + 2,u);
395
	if (!stralloc_0(&f[3])) nomem();
396
	if (!scan_ulong(f[3].s,&u)) nomem();
397
	uint16_pack_big(srv + 4,u);
398
399
	rr_start(DNS_T_SRV,ttl,ttd,loc);
400
	rr_add(srv,6);
363
	rr_addname(d2);
401
	rr_addname(d2);
364
	rr_finish(d1);
402
	rr_finish(d1);
365
403

Return to bug 523756