diff options
| -rw-r--r-- | appl/cmd/ndb/dns.b | 14 | ||||
| -rw-r--r-- | 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<fontpath>\n" "\t-r<rootpath>\n" "\t-7\n" + "\t-B\n" "\t-C<channel string>\n" "\t-S\n"); |
