summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ndb
AgeCommit message (Collapse)Author
2018-01-28ndb/dns: cleanupcinap_lenrek
2018-01-28ndb/dns: fix leak in myaddr(), normalize ip stringscinap_lenrek
remove myaddr() function and replace with myip() function that receives binary ip address. and don't use string comparsion for ip addresses... parse and then ipcmp(). for sanity reasons, normalize ip address strings and reject unparsable ones. done by calling ipalookup() with a binary ip address.
2018-01-28ndb/cs: handle v4 only case for rudpcinap_lenrek
2017-10-04ndb/cs: icmp only supports version 4 addresses, icmpv6 only version 6 addressescinap_lenrek
2017-04-01ndb/dns: double Maxretries for long cname redirection chainscinap_lenrek
2016-11-17cmd: remove a bit of unused stuffftrvxmtrx
2016-08-14ndb/cs: don't lookup AAAA records for IL, make sure translated address is ↵cinap_lenrek
IPv4 for IL, consistent use of nil vs. 0 for pointers
2016-07-24make error handling in 9p service loops consistentcinap_lenrek
when we get eof, stop the loop immidiately and do not rely on the read to eventually return an error. when convM2S() fails to decode the message, error out and stop the loop. there is no point in continuing.
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-05-16ndb/cs: fix memory leak (charles forsyth)cinap_lenrek
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.
2016-02-16ndb/dns: removing the buggy /net.alt remount hackcinap_lenrek
2016-01-12ndb/dnstcp: -x specifies the mountmointcinap_lenrek
2016-01-07format pointer subtraction results with %zd instead of %ld (for long -> ↵cinap_lenrek
intptr on amd64)
2015-06-14ndb/dns: cleanup forwarding code (redistrib())cinap_lenrek
instead of copying the whole packet, just save the udp header and restore it aftwards. dont call redistrib() when there are no forwards (this should be almost always the case).
2015-06-13ndb/dns: use same buffer size of udp packet in redistrib() as dnudpserver() ↵cinap_lenrek
(fixes assert)
2015-03-11ndb/dns: reduce sencodefmt() to not link in enc32()/enc64() encoderscinap_lenrek
the special sencodefmt() in ndb/dn.c is only used with %H format for hexadecimal printing for binary strings. removing the unused calls to enc32() and enc64() reduces the code size by arround 4K. (this is usefull for ndb/getip which gets linked into the kernel).
2014-12-13ndb/cs: fix spelling (thanks mischief)cinap_lenrek
2014-12-10dnsgetip: filter negative answers, remove -f flag, use dnsgetip logfilecinap_lenrek
2014-12-09ndb: add dnsgetip program to resolve A and AAAA records during bootstrappingmischief
2014-12-08ndb/dns: ignore terminating authoritative flag for no-answer when more ↵cinap_lenrek
nameservers are provided continue recursing when we get empty but non-negative answer from a (claimed) authoritative nameserer that provides more nameservers. this fixes wordpress dns: 63766.3: sending to 192.0.80.93/ns1.wordpress.com bossypally.files.wordpress.com ip 63766: rcvd OK from 192.0.80.93 (authoritative) Q: bossypally.files.wordpress.com ip Auth: files.wordpress.com 5 min ns mdns1.wordpress.com files.wordpress.com 5 min ns mdns2.wordpress.com files.wordpress.com 5 min ns mdns3.wordpress.com files.wordpress.com 5 min ns mdns4.wordpress.com files.wordpress.com 5 min ns mdns5.wordpress.com Hint: mdns1.wordpress.com 4 hr ip 192.0.75.7 mdns2.wordpress.com 4 hr ip 198.181.117.7 mdns3.wordpress.com 4 hr ip 198.181.116.7 mdns4.wordpress.com 4 hr ip 198.181.118.7 mdns5.wordpress.com 4 hr ip 192.0.74.7 63766.4: sending to 192.0.75.7/mdns1.wordpress.com bossypally.files.wordpress.com ip 63766: rcvd OK from 192.0.75.7 (authoritative) Q: bossypally.files.wordpress.com ip Ans: bossypally.files.wordpress.com 5 min ip 192.0.72.2 bossypally.files.wordpress.com 5 min ip 192.0.72.3 ---------------------------- answer bossypally.files.wordpress.com 5 min ip 192.0.72.2 answer bossypally.files.wordpress.com 5 min ip 192.0.72.3 ---------------------------- note the authoritative flag in the first response from ns1.wordpress.com that would otherwise terminate the search.
2014-10-29cs: fix linefeeds in syslog(), cleanupcinap_lenrek
2014-10-29cs: use /net/ether* instead /net/ether[0123], dont remove srv file with -n, ↵cinap_lenrek
dont write dns logfile
2014-09-28ndb/dns: request recursion only for local dns serverscinap_lenrek
we used to set RD flag in requests unconditionally, which is fine by the standard but some dns server administrators seem to use it as a denial of service indicator (for ther non recursive authoritative nameservers) and ignore the request. so only set the RD flag when talking to local dns servers.
2014-08-08ndb/dns: fix nil dereference crash with convM2DNS() returning reqmsg.qd == nilcinap_lenrek
2013-11-28ndb/dns: check bad name length in convM2DNS.c:^gname()cinap_lenrek
2013-11-26ndb/dns: do dnresolve() loopcheck only on hosts that we havnt already triedcinap_lenrek
we might get a unreachable nameserver ip from a parent nameserver. if the remaining set of nameservers does not loop, we should try to resolve them. so skip the loopcheck for nameservers already tried.
2013-11-24ndb/dns: add support for internationalized domain namescinap_lenrek
2013-11-23ndb/dns: ignore refused (5) error repliescinap_lenrek
2013-11-20ndb/dns: filter dns answers avoiding cache poisoningcinap_lenrek
only cache what we asked for or need to resolve the query. filter out everything else.
2013-11-17ndb/dns: another attempt...cinap_lenrek
we have to fail the whole query that got no cached nameservers and nameservers are looping, not just omit the looping nameserver. issuequery() will refresh nameserver info for the domain when recursing up.
2013-11-16ndb/dns: detect query loopscinap_lenrek
never try to resolve a nameserver address when that nameserver is in the set of nameservers already being queried. this situation can happen when the Ta and Taaaa RR's expire, but the Tns records are still in the cache so there is no usable nameserver but they still refer to each another.
2013-11-15ndb/dns: various changescinap_lenrek
stop absolute/relative dual use of RR.ttl. now RR.ttl is *always* the *relative* ttl value. we derive absolute timeout in RR.expire. remove unused lookuptime field in DN. replace refs and keep with mark field in DN. we do not care about the number of references. only *iff* it is referenced, so use a single bit for that (bit 0). for keep, we use bit 1. remove dolock parameter in dnagenever(), it is not needed. we always need to lock. mark local dns servers and domains as never to be aged. the keeper bit is *just* a cache optimization, preventing the domain and the domains it points to from being flushed. it should not be used as a write protect bit in rrattach() for preventing spoofing as it will prevent updates of say, cname domains. remove "removing spam ..." message. these are usualy just hints, so normal. still, remove the hint as we currently do no check if the nameserver has authority over the cname domain. remove "mydnsquery: trying to send to myself (%s); bzzzt" message. this can happen when myaddr() fails for other reasons. myaddr() will print error for us anyway.
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-08-04dns: ignore spam addresses from cname answerscinap_lenrek
2013-06-21ndb/dns: avoid duplicate entries for db recordscinap_lenrek
dnauthdb() would relabel expired rr's as rr->db == 0 to make them get garbage collected by dnage(). but this doesnt work due to dn->keep and also causes the deduplication to fail on rrattach() as rrattach1() handles rr->dn/rr->auth as separate name spaces. this causes duplicate entries in the rr's when ndb gets gets changed. to fix, we just delete the expired (removed from ndb) rr's immidiately in dnauthdb() instead of trying trick dnage() to garbage collect it.
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.
2013-04-11ndb/dns: dont override req->aborttime in udpquery()cinap_lenrek
overriding aborttime in udpquery() makes no sense. it causes recursive queries to extend the timeout infinitely. nobody but the issuer of the request should modify aborttime.
2013-01-05ndb/dnsdebug: make sure request is initialized (import from sources)cinap_lenrek
2012-08-29ndb/dns: fix mistakecinap_lenrek
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-26ndb/dns: fix netmkaddr() race, dnlock consistency, strcpy, cleanupscinap_lenrek
2012-08-22ndb/dns: fix memory corruption and bad serveraddrs() range checkscinap_lenrek
2012-08-08ndb/dns: cleanupcinap_lenrek
2012-07-29ndb/cs: limit number of slave procscinap_lenrek
2012-07-28ndb/cs/dns: make sure never to block the 9p loop when we run out of ↵cinap_lenrek
processes, fail the request instead
2012-05-03bring back il protocol supportcinap_lenrek