summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ndb/dns.c
AgeCommit message (Collapse)Author
2023-01-04ndb/dns: allow specifying local ip addresses for serving dnscinap_lenrek
Allow specifying the local IP addresses that the UDP dns server will listen on when the -s flag is given.
2022-12-12ndb/dns, ndb/cs: post to /srv instead of #scinap_lenrek
2020-08-01pre-lib9p servers: fix incorrect Tversion handlingkvik
version(5) says: If the server does not understand the client's version string, it should respond with an Rversion message (not Rerror) with the version string the 7 characters ``unknown''. Pre-lib9p file servers -- all except cwfs(4) -- do return Rerror. lib9p(2) follows the above spec, although ignoring the next part concerning comparison after period-stripping. It assumes an Fcall.version starting with "9P" is correctly formed and returns the only supported version of the protocol, which seems alright. This patch brings pre-lib9p servers in accordance with the spec.
2020-05-02make bind(2) error handling consistentcinap_lenrek
The mount() and bind() syscalls return -1 on error, and the mountid sequence number on success. The manpage states that the mountid sequence number is a positive integer, but the kernels implementation currently uses a unsigned 32-bit integer and does not guarantee that the mountid will not become negative. Most code just cares about the error, so test for the -1 error value only.
2018-10-11ndb/dns: use nil for pointers in dnresolve() argscinap_lenrek
2018-05-11ndb/dns: lookup *all* entries in dblookup(), v4 and v6 queries in parallel, ↵cinap_lenrek
remove weigthed timeouts dblookup() used to only return the first matching entry. in case of ipv6, we want all entries returned to get both v4 and v6 addresses... and these might not neccesarily be in the same entry (see /lib/ndb/common). note also this makes it behave the same as in cachedb mode which reads in the whole database. we do not know if v4 or v6 routing works, so the simplest is just to query v4 and v6 nameservers in parallel. this is done by changing serveraddrs() to return one address type, and we make sure to get at least one v4 and one v6 address each round. get rid of the weigthed timeout code... there where too many assumptions. instead, we give a round 500ms timeout (or 1 second in patient mode) and honor the maximum query time.
2016-07-24ndb/dns: remove procname statistics and restart feature, cleanup 9p service loopcinap_lenrek
given that the memory leaks have been fixed, theres no need for the obscure restart feature which is not reliable anyway. remove the code updating procname on each 9p request. handle convM2S error by exiting the service loop, dont read 9p channel after eof.
2016-06-27ndb/dns: purge db records on refresh for resolvers, remove old debug and ↵cinap_lenrek
testing code when ndb/dns runs as a resolver only (cfg.cachedb == 0), we still want to purge the "local#" db records to reread dns server configuration or react to changed ip addresses. removing old poolcheck and dncheck code, these bugs have been fixed a long time ago.
2016-02-22ndb/dns: initialize unknown fids to point to the root qidcinap_lenrek
the dns file service can be restarted, which causes it to forget all fid state. given the simple file system structure of the dns service (just a single dns file), we can assume that rpcs on a unknown fid refers to the root, so the mountpoint will stay valid and /net/dns can be reopend avoiding the need for a remount of the dns service after restart.
2013-11-13ndb/dns: case sensitive ndb attributes, Domlen consistency, dblookup() ↵cinap_lenrek
inplace lower case conversion, cleanups ndb keys are strictly case sensitive, so consitently use strcmp() when comparing attribute keys. dblookup() used to lower case convert its name argument inplace to match domain/sys name in ndb. better to do the convesion in its own buffer and only read from the name argument. always use cistrcmp() when comparing DN.name. the Domlen constant denotes the size of the buffer including the null terminator. consistently use it as such. have to hold dnlock in freearea() before reading list head pointer.
2013-06-16make filesystem handling of read9pmsg() consistentcinap_lenrek
2013-06-14ndb/cs, ndb/dns: ignore special commands from users different from the one ↵cinap_lenrek
we run the service owner this prevents users like "none" from toggling special options in ndb/dns and ndb/cs.
2012-08-29ndb/dns: bug fixes and massive cleanupcinap_lenrek
removing the querylck from the DN as it was never used or being effective which saves like a ton on space per domain name. remove the Query.tcplock and put query on the stack. it is unneccesary to lock the query as its only used by one process at a time. put Query's on the stack. change outsidens() to outsidensip() which now takes the ip buffer that it fills instead of returning static buffer (which would race with multiple processes involved). eleminate mostly all of the lock(&dnlock)/unlock(&dnlock) calls. we'r not working on shared cache RR's in the resolver procs. we work on *copies* done by rrlookup() made under the dnlock. the cache garbage collection only runs when all processes are locked out and is also taking the dnlock while doing so. cleanup xmitquery(). for the tcp case, we dont need to get more nameserver addresses, just take the ip from the udp header that tcpquery() placed there for us. fixed baddelegation() to actually check for delegation loop even if theres no dom info for our host. remove lots of debug code. remove the dnforceage() as it doenst make sure other processes are locked out. this could destroy dn's currenctly refered by running queries. remove dnageallnever() as its not used. dont attach rr's to keepers to prevent outside spoofing. make myaddr() retrive the ip address if not set.
2012-08-26dns: fix rr->srv memory leak in rrcopy, mark rr->sig->signer, dn aging, cleanupcinap_lenrek
2012-08-08ndb/dns: cleanupcinap_lenrek
2012-03-23ndb/cs: fix use after free caused by flush/clunk happening before dns lookup ↵cinap_lenrek
finishes
2012-03-02dns: discover my ip address at runtimecinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen