From f1a39e3002c0a444de8b45182f3684f218bfb695 Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Wed, 9 Jul 2008 08:17:24 +0000 Subject: 20080709-0917 --- appl/cmd/ndb/dns.b | 14 ++++++++++++-- emu/port/main.c | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/appl/cmd/ndb/dns.b b/appl/cmd/ndb/dns.b index 348f5254..7c116c99 100644 --- a/appl/cmd/ndb/dns.b +++ b/appl/cmd/ndb/dns.b @@ -42,6 +42,10 @@ include "ipattr.m"; ipattr: IPattr; dbattr: import ipattr; +include "keyring.m"; +include "security.m"; + random: Random; + DNS: module { init: fn(nil: ref Draw->Context, nil: list of string); @@ -124,6 +128,12 @@ init(nil: ref Draw->Context, args: list of string) ipattr->init(attrdb, ip); sys->pctl(Sys->NEWPGRP | Sys->FORKFD, nil); + + random = load Random Random->PATH; + if(random == nil) + cantload(Random->PATH); + dnsid = random->randomint(Random->ReallyRandom); # avoid clashes + random = nil; myname = sysname(); stderr = sys->fildes(2); readservers(); @@ -1657,7 +1667,7 @@ mkquery(qtype: int, qclass: int, name: string): (int, array of byte, string) { qd := ref QR(name, qtype, qclass); dm := ref DNSmsg; - dm.id = dnsid++; # doesn't matter if two different procs use it + dm.id = dnsid++; # doesn't matter if two different procs use it (different fds) dm.flags = Oquery; if(referdns || !debug) dm.flags |= Frecurse; @@ -1670,7 +1680,7 @@ mkquery(qtype: int, qclass: int, name: string): (int, array of byte, string) a[i] = byte 0; a[Udprport] = byte (DNSport>>8); a[Udprport+1] = byte DNSport; - return (dm.id, a, nil); + return (dm.id&16rFFFF, a, nil); } udpquery(fd: ref Sys->FD, id: int, query: array of byte, sname: string, addr: ref RR): (ref DNSmsg, string) diff --git a/emu/port/main.c b/emu/port/main.c index 4eb315a0..2409916d 100644 --- a/emu/port/main.c +++ b/emu/port/main.c @@ -33,7 +33,6 @@ usage(void) fprint(2, "Usage: emu [options...] [file.dis [args...]]\n" "\t-gXxY\n" "\t-c[0-9]\n" - "\t-b\n" "\t-d file.dis\n" "\t-s\n" "\t-v\n" @@ -41,6 +40,7 @@ usage(void) "\t-f\n" "\t-r\n" "\t-7\n" + "\t-B\n" "\t-C\n" "\t-S\n"); -- cgit v1.2.3