Compare commits

...
1651 Commits
Author SHA1 Message Date
Wouter Wijngaards 039f276b0c fixup spinning
git-svn-id: file:///svn/unbound/trunk@1919 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-23 12:12:59 +00:00
Wouter Wijngaards 44a28f4343 Patch applied from David Hubbard.
git-svn-id: file:///svn/unbound/trunk@1918 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-23 11:01:10 +00:00
Wouter Wijngaards cffd76e6e4 revert nonworking fixup
git-svn-id: file:///svn/unbound/trunk@1917 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-20 15:43:13 +00:00
Wouter Wijngaards 54046475e7 workaround
git-svn-id: file:///svn/unbound/trunk@1916 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-20 15:28:10 +00:00
Wouter Wijngaards caeebbf4fa review comments
git-svn-id: file:///svn/unbound/trunk@1915 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-20 12:06:00 +00:00
Wouter Wijngaards 521bd29041 Utility script to convert anchors.mf from the ITAR into individual files that are amenable to RFC5011 tracking.
git-svn-id: file:///svn/unbound/trunk@1914 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-20 10:37:06 +00:00
Wouter Wijngaards 9abe770f9e iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1913 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-19 10:22:48 +00:00
Wouter Wijngaards 41a5b9efca better argument help for unbound-control
git-svn-id: file:///svn/unbound/trunk@1912 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-19 10:01:42 +00:00
Wouter Wijngaards 980f3f10b7 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1911 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-17 16:02:59 +00:00
Wouter Wijngaards 83cf9d20c8 noted multiple autotrust lines needed in example.conf
git-svn-id: file:///svn/unbound/trunk@1910 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-17 09:43:09 +00:00
Wouter Wijngaards a4c7a739d9 svn tag changelog entry
git-svn-id: file:///svn/unbound/trunk@1908 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-16 14:32:04 +00:00
Wouter Wijngaards c0093acd97 CLOSEST trust anchors tested with CNAME and NSEC3 optout.
git-svn-id: file:///svn/unbound/trunk@1907 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-16 14:13:58 +00:00
Wouter Wijngaards 62ab524058 Fix#282 libunbound memleak on error condition by Eric Sesterhenn.
git-svn-id: file:///svn/unbound/trunk@1906 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-16 13:36:54 +00:00
Wouter Wijngaards c56fdce932 Fixup unsigned CNAME to signed CNAME detection of signatures.
git-svn-id: file:///svn/unbound/trunk@1905 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-16 13:34:03 +00:00
Wouter Wijngaards 502a542820 please lint
git-svn-id: file:///svn/unbound/trunk@1904 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-13 15:03:01 +00:00
Wouter Wijngaards 23af66982c - unbound-host does not fail on type ANY.
- Fixed wireparse failure to put RRSIGs together with data in some
	  long ANY mix cases, which fixes validation failures.


git-svn-id: file:///svn/unbound/trunk@1903 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-13 14:51:36 +00:00
Wouter Wijngaards a4a7894f79 Fix validation failure cnamenodata proof failed for hud.gov.
git-svn-id: file:///svn/unbound/trunk@1902 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-13 10:10:05 +00:00
Wouter Wijngaards 5423af1836 review fixes.
git-svn-id: file:///svn/unbound/trunk@1901 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-12 16:27:11 +00:00
Wouter Wijngaards e19f71ffa0 Fixup to clean errinf on restart so no extremely long printouts.
git-svn-id: file:///svn/unbound/trunk@1900 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-12 15:07:38 +00:00
Wouter Wijngaards 009b2d7c0b iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1899 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-12 09:12:06 +00:00
Wouter Wijngaards eb6253aa6c review comments. updated ldns tarball with 1.6.2.
git-svn-id: file:///svn/unbound/trunk@1898 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-11 16:18:38 +00:00
Wouter Wijngaards 5bc9a80e40 review fixes.
git-svn-id: file:///svn/unbound/trunk@1897 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-10 16:02:05 +00:00
Wouter Wijngaards 6e8e4e87b7 Fixed argument optionality in help output.
git-svn-id: file:///svn/unbound/trunk@1896 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-10 13:28:09 +00:00
Wouter Wijngaards ff33e077de Fix crash bug with DLV and dnssec-retry for the domain registered in it.
git-svn-id: file:///svn/unbound/trunk@1895 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-10 10:42:50 +00:00
Wouter Wijngaards 9890caff91 and error
git-svn-id: file:///svn/unbound/trunk@1894 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-10 08:15:08 +00:00
Wouter Wijngaards 45c07da4a0 debug code
git-svn-id: file:///svn/unbound/trunk@1893 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-09 16:26:24 +00:00
Wouter Wijngaards 7617c18be1 more error text
git-svn-id: file:///svn/unbound/trunk@1892 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-05 19:32:02 +00:00
Wouter Wijngaards 463d7e09c5 better error text.
git-svn-id: file:///svn/unbound/trunk@1891 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-05 19:22:50 +00:00
Wouter Wijngaards b3caa5ab37 pylib for python in different location test updated.
git-svn-id: file:///svn/unbound/trunk@1890 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-05 12:03:54 +00:00
Wouter Wijngaards 479bebfff4 please lint on FreeBSD6
git-svn-id: file:///svn/unbound/trunk@1889 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-05 11:12:06 +00:00
Wouter Wijngaards 586893d761 lint fixes on FreeBSD 7.
git-svn-id: file:///svn/unbound/trunk@1888 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-05 10:39:12 +00:00
Wouter Wijngaards 07f5b21b7b parameter documented
git-svn-id: file:///svn/unbound/trunk@1887 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-02 15:23:41 +00:00
Wouter Wijngaards 4f1a72bb75 GOST draft version -00 to -01 changes incorporated.
git-svn-id: file:///svn/unbound/trunk@1886 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-02 15:05:06 +00:00
Wouter Wijngaards aa8a6eeadf Unit test for fixed autotrust init with DS.
git-svn-id: file:///svn/unbound/trunk@1885 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-02 14:30:46 +00:00
Wouter Wijngaards bf8bc06860 Fix autotrust initialised with DS.
git-svn-id: file:///svn/unbound/trunk@1884 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-11-02 13:56:14 +00:00
Wouter Wijngaards 1727bfc34e please doxygen.
git-svn-id: file:///svn/unbound/trunk@1883 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-29 12:55:26 +00:00
Wouter Wijngaards 1d8013c67a do-udp: no fixed.
git-svn-id: file:///svn/unbound/trunk@1882 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-29 12:11:38 +00:00
Wouter Wijngaards 5b66f07e38 edns-buffer-size option.
git-svn-id: file:///svn/unbound/trunk@1881 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-29 10:37:44 +00:00
Wouter Wijngaards 81cfcd8053 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1880 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-29 07:48:36 +00:00
Wouter Wijngaards 8171793d2a ldns tarball updated.
git-svn-id: file:///svn/unbound/trunk@1879 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-28 21:59:45 +00:00
Wouter Wijngaards 9a08ad419e sha256 support enabled by default.
git-svn-id: file:///svn/unbound/trunk@1878 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-28 21:56:54 +00:00
Wouter Wijngaards 3b78d84a7e iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1877 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-28 08:24:41 +00:00
Wouter Wijngaards d3bc6d6b5a Removed hard malloc failure reported by Greg Woods.
git-svn-id: file:///svn/unbound/trunk@1876 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-28 08:04:38 +00:00
Wouter Wijngaards 9bb3fdd547 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1875 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-27 07:27:01 +00:00
Wouter Wijngaards f42d27e1a2 - Made new validator error string available from libunbound for
applications.  It is in result->why_bogus, a zero-terminated string.
	  unbound-host prints it by default if a result is bogus.
	  Also the errinf is public in module_qstate (for other modules).
	Binary API different. bumped library ABI version.


git-svn-id: file:///svn/unbound/trunk@1874 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-08 17:05:53 +00:00
Wouter Wijngaards d7868e4077 Fix double time subtraction in negative cache.
git-svn-id: file:///svn/unbound/trunk@1873 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-08 09:18:40 +00:00
Wouter Wijngaards 2c33330994 neater errors for algo and key failure.
git-svn-id: file:///svn/unbound/trunk@1872 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-08 08:02:00 +00:00
Wouter Wijngaards 7782cf2b97 More detailed errors.
git-svn-id: file:///svn/unbound/trunk@1871 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-08 07:23:49 +00:00
Wouter Wijngaards a909fa9a3a neater explanation for unsigned or signatureless negative DS replies.
git-svn-id: file:///svn/unbound/trunk@1870 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-08 06:57:23 +00:00
Wouter Wijngaards e0b639accd More vallog reason. Doxygen.
git-svn-id: file:///svn/unbound/trunk@1869 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-08 06:35:14 +00:00
Wouter Wijngaards ce45cbda6d - moved version number to 1.4.0 because of 1.3.4 release with only
the NSEC3 patch.
	- val-log-level: 2 shows extended error information for validation
	  failures, but still one (longish) line per failure.  For example:
	  validation failure <example.com. DNSKEY IN>: signature expired from
	  192.0.2.4 for trust anchor example.com. while building chain of trust
	  validation failure <www.example.com. A IN>: no signatures from
	  192.0.2.6 for key example.com. while building chain of trust



git-svn-id: file:///svn/unbound/trunk@1868 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 16:45:47 +00:00
Wouter Wijngaards 6f37df3b92 Fix trunk.
git-svn-id: file:///svn/unbound/trunk@1866 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 14:00:56 +00:00
Wouter Wijngaards b07370a4c2 Fix check for NSEC3 signatures
git-svn-id: file:///svn/unbound/trunk@1865 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 12:57:12 +00:00
Wouter Wijngaards 1a02ab895b Fix check for signatures.
git-svn-id: file:///svn/unbound/trunk@1864 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 12:56:57 +00:00
Wouter Wijngaards 989a6f4f89 typo in changelog
git-svn-id: file:///svn/unbound/trunk@1863 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 09:32:00 +00:00
Wouter Wijngaards 5ff6b1c5fb retry mode: empty non terminal.
git-svn-id: file:///svn/unbound/trunk@1862 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 08:53:09 +00:00
Wouter Wijngaards 4d49d792c3 retry mode: DNSKEY.
git-svn-id: file:///svn/unbound/trunk@1861 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 08:22:27 +00:00
Wouter Wijngaards 5d2e8e8e97 Retry mode, DS and prime.
git-svn-id: file:///svn/unbound/trunk@1860 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-07 07:52:02 +00:00
Wouter Wijngaards 455c3d130d Data retry on validation failure.
git-svn-id: file:///svn/unbound/trunk@1859 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-06 08:31:47 +00:00
Wouter Wijngaards c43987e8e1 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1858 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-02 08:12:54 +00:00
Wouter Wijngaards 0679bf6502 Fix autotrust-5011 file used from libunbound (no probing by itself because
it may not have the processor whenever it likes).


git-svn-id: file:///svn/unbound/trunk@1857 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-02 08:08:44 +00:00
Wouter Wijngaards 35f077bc06 unbound-host -d and -C fix
git-svn-id: file:///svn/unbound/trunk@1856 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-10-02 07:51:36 +00:00
Wouter Wijngaards 71959c05df review fixes.
git-svn-id: file:///svn/unbound/trunk@1855 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-28 14:52:53 +00:00
Wouter Wijngaards 1c75281303 Read iana root multiline and prevent integer underflow.
git-svn-id: file:///svn/unbound/trunk@1854 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-28 13:14:01 +00:00
Wouter Wijngaards 5007a44e52 review fixes
git-svn-id: file:///svn/unbound/trunk@1853 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-25 15:20:29 +00:00
Wouter Wijngaards 2043463b6a review nits
git-svn-id: file:///svn/unbound/trunk@1852 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-25 11:16:43 +00:00
Wouter Wijngaards d59a8baec2 so-rcvbuf option.
git-svn-id: file:///svn/unbound/trunk@1851 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-25 08:54:50 +00:00
Wouter Wijngaards c467aabbf1 review comments
git-svn-id: file:///svn/unbound/trunk@1850 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-23 15:15:41 +00:00
Wouter Wijngaards 430a6bd697 Test of original autotrust formatted data.
git-svn-id: file:///svn/unbound/trunk@1849 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-23 12:50:42 +00:00
Wouter Wijngaards ee1c4c1cce Failure handling for 5011.
git-svn-id: file:///svn/unbound/trunk@1848 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-23 09:05:44 +00:00
Wouter Wijngaards 44e2f9b0d9 Can handle a number of keys for the trust point.
git-svn-id: file:///svn/unbound/trunk@1847 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-22 14:40:14 +00:00
Wouter Wijngaards 1f7304d146 revocation of trust anchors works.
git-svn-id: file:///svn/unbound/trunk@1846 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-22 14:04:43 +00:00
Wouter Wijngaards 9dc9f0a8e8 rfc5011 and algorithm rollover
git-svn-id: file:///svn/unbound/trunk@1845 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-22 12:20:21 +00:00
Wouter Wijngaards 19ab8e1429 remove memory leak from testbed
git-svn-id: file:///svn/unbound/trunk@1844 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-18 12:34:30 +00:00
Wouter Wijngaards aff6654685 Test TTLs and signatures.
git-svn-id: file:///svn/unbound/trunk@1843 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-18 11:23:50 +00:00
Wouter Wijngaards d0cef76cff Pick up revocations even if not normally validly signed.
git-svn-id: file:///svn/unbound/trunk@1842 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-18 10:13:06 +00:00
Wouter Wijngaards 82b8ddc9bb autotrust tests and fixes.
git-svn-id: file:///svn/unbound/trunk@1841 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-18 07:49:29 +00:00
Wouter Wijngaards 2588d76522 manual page fixes from Tony Finch
git-svn-id: file:///svn/unbound/trunk@1840 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-17 14:52:43 +00:00
Wouter Wijngaards 5d4249a6b0 spelling
git-svn-id: file:///svn/unbound/trunk@1839 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-17 14:38:20 +00:00
Wouter Wijngaards 2c134eb981 Changelog.
git-svn-id: file:///svn/unbound/trunk@1838 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-17 14:36:15 +00:00
Wouter Wijngaards c4cfcdab6b Fix problem with delegation where glue has expired.
git-svn-id: file:///svn/unbound/trunk@1837 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-17 14:36:06 +00:00
Wouter Wijngaards 75fbd42ca3 Fix unbound-host compile with --enable-alloc-checks.
git-svn-id: file:///svn/unbound/trunk@1836 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-17 10:50:44 +00:00
Wouter Wijngaards aae91da6d2 sharper match.
git-svn-id: file:///svn/unbound/trunk@1835 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-16 13:13:46 +00:00
Wouter Wijngaards 90b4b1dae9 Fixup memstats for pretty time print in log file.
git-svn-id: file:///svn/unbound/trunk@1834 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-16 13:01:51 +00:00
Wouter Wijngaards 795a25c117 Fixed memstats for log-ascii format.
git-svn-id: file:///svn/unbound/trunk@1833 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-16 12:56:00 +00:00
Wouter Wijngaards 45acda0535 Memory leak fix.
git-svn-id: file:///svn/unbound/trunk@1832 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-16 12:47:56 +00:00
Wouter Wijngaards 9c822ebc9e iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1831 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-15 14:15:24 +00:00
Wouter Wijngaards 165a235f4d debug prints for high verbosity
git-svn-id: file:///svn/unbound/trunk@1830 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-15 14:03:44 +00:00
Wouter Wijngaards 46d341b036 please lint
git-svn-id: file:///svn/unbound/trunk@1829 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 15:07:18 +00:00
Wouter Wijngaards 7923a28c13 line buffering
git-svn-id: file:///svn/unbound/trunk@1828 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 14:33:46 +00:00
Wouter Wijngaards 2e02003687 prettier compiling in optimize mode
git-svn-id: file:///svn/unbound/trunk@1827 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 14:16:19 +00:00
Wouter Wijngaards c611bbba3f ldns with parse fixes
git-svn-id: file:///svn/unbound/trunk@1826 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 13:54:03 +00:00
Wouter Wijngaards b322353d8b remove printf format warning
git-svn-id: file:///svn/unbound/trunk@1825 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 13:41:01 +00:00
Wouter Wijngaards 7ccf79d42d can print .bg key.
git-svn-id: file:///svn/unbound/trunk@1824 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 13:13:55 +00:00
Wouter Wijngaards d7dafa112b load_cache is meant for debugging.
git-svn-id: file:///svn/unbound/trunk@1823 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 10:09:24 +00:00
Wouter Wijngaards dcb11b2ee4 Fixup TTL too large bug for bogus responses.
git-svn-id: file:///svn/unbound/trunk@1822 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-10 10:01:36 +00:00
Wouter Wijngaards 30d0bf14eb lint fix
git-svn-id: file:///svn/unbound/trunk@1821 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-08 08:24:44 +00:00
Wouter Wijngaards 1f45bbbd63 Fixups.
git-svn-id: file:///svn/unbound/trunk@1820 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-08 07:20:47 +00:00
Wouter Wijngaards 3f68f01313 - autotrust testbound scenarios.
- autotrust fix that failure count is written to file.
        - autotrust fix that keys may become valid after add holddown time
          alone, before the probe returns.


git-svn-id: file:///svn/unbound/trunk@1819 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-07 14:34:29 +00:00
Wouter Wijngaards 18e9cbb39f fix python memory leak.
git-svn-id: file:///svn/unbound/trunk@1818 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-04 14:14:54 +00:00
Wouter Wijngaards ca9c1fa2a8 libevent-2.0 compatibility.
git-svn-id: file:///svn/unbound/trunk@1817 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-04 13:29:11 +00:00
Wouter Wijngaards 310cbbc372 Set path earlier.
git-svn-id: file:///svn/unbound/trunk@1816 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-04 12:22:46 +00:00
Wouter Wijngaards 3bca178111 Test the new doxygen pick up.
git-svn-id: file:///svn/unbound/trunk@1815 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-04 11:26:49 +00:00
Wouter Wijngaards 4774b8b129 Test new doxygen for automated tests.
git-svn-id: file:///svn/unbound/trunk@1814 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-04 10:35:17 +00:00
Wouter Wijngaards e46441787c source IP from python and doxygen fixes.
git-svn-id: file:///svn/unbound/trunk@1813 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 14:51:38 +00:00
Wouter Wijngaards cd3a1ff351 more enum fixes
git-svn-id: file:///svn/unbound/trunk@1812 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 12:28:17 +00:00
Wouter Wijngaards e80d0936f3 more enum fixes in ldns tarball
git-svn-id: file:///svn/unbound/trunk@1811 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 12:19:29 +00:00
Wouter Wijngaards 41a29b050b makefile fix ordering
git-svn-id: file:///svn/unbound/trunk@1810 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 12:19:18 +00:00
Wouter Wijngaards 37d8551a7a Makefile fix for parallel makes.
git-svn-id: file:///svn/unbound/trunk@1809 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 12:06:06 +00:00
Wouter Wijngaards 17ffb78b10 ldns-updated
git-svn-id: file:///svn/unbound/trunk@1808 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 12:04:39 +00:00
Wouter Wijngaards 51ba9a4856 check better for iphlpapi.h
git-svn-id: file:///svn/unbound/trunk@1807 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 10:19:06 +00:00
Wouter Wijngaards 0fc43d4a62 Luca Bruno's patch.
git-svn-id: file:///svn/unbound/trunk@1806 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 10:07:13 +00:00
Wouter Wijngaards e5cab7b264 document last change
git-svn-id: file:///svn/unbound/trunk@1805 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-03 09:29:54 +00:00
Wouter Wijngaards 8e2ef1caeb - TRAFFIC keyword for testbound. Simplifies test generation.
${range lower val upper} to check probe timeout values.
- test with 5011-prepublish rollover and revocation.
- fix revocation of RR for autotrust, stray exclamation mark.


git-svn-id: file:///svn/unbound/trunk@1804 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-02 13:11:52 +00:00
Wouter Wijngaards c7bea9d33a more keys for autotrust testing.
git-svn-id: file:///svn/unbound/trunk@1803 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-02 10:04:34 +00:00
Wouter Wijngaards 415236c002 active probe
git-svn-id: file:///svn/unbound/trunk@1802 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-01 14:47:57 +00:00
Wouter Wijngaards 0a35d358ee More lint.
git-svn-id: file:///svn/unbound/trunk@1801 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-01 13:15:51 +00:00
Wouter Wijngaards 544b3f8428 lint and doc
git-svn-id: file:///svn/unbound/trunk@1800 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-01 13:09:55 +00:00
Wouter Wijngaards 9f9edf9ce6 docs
git-svn-id: file:///svn/unbound/trunk@1799 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-01 13:07:38 +00:00
Wouter Wijngaards eb3eb4f250 randomise probe time.
git-svn-id: file:///svn/unbound/trunk@1798 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-01 12:45:10 +00:00
Wouter Wijngaards de7808f2e0 do not confuse lint
git-svn-id: file:///svn/unbound/trunk@1797 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-01 09:48:57 +00:00
Wouter Wijngaards 4f2461a124 macro arithmetic.
git-svn-id: file:///svn/unbound/trunk@1796 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-09-01 09:30:28 +00:00
Wouter Wijngaards a24f9ff9ea variable processing.
git-svn-id: file:///svn/unbound/trunk@1795 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-31 15:58:38 +00:00
Wouter Wijngaards dafe1ae21b try again
git-svn-id: file:///svn/unbound/trunk@1794 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-28 10:22:44 +00:00
Wouter Wijngaards b8c4d7088d please lint
git-svn-id: file:///svn/unbound/trunk@1793 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-28 09:49:11 +00:00
Wouter Wijngaards f974f7880b Fixup unbound-control for forwards and stubs.
git-svn-id: file:///svn/unbound/trunk@1792 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-28 09:43:05 +00:00
Wouter Wijngaards bad061a35a Empty callback.
git-svn-id: file:///svn/unbound/trunk@1791 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-27 15:22:48 +00:00
Wouter Wijngaards ba47856946 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1790 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-27 10:24:13 +00:00
Wouter Wijngaards a1a71348bf Test for DLV DS lookup fix.
git-svn-id: file:///svn/unbound/trunk@1789 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-27 10:13:55 +00:00
Wouter Wijngaards e3b8b9bcea Test for DS lookup fix.
git-svn-id: file:///svn/unbound/trunk@1788 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-27 10:07:58 +00:00
Wouter Wijngaards 902323da2f autotrust probing and testbound with fake timer support.
git-svn-id: file:///svn/unbound/trunk@1787 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-26 13:23:49 +00:00
Wouter Wijngaards b422db1c80 clean up on exit because otherwise re-lex may not be possible
git-svn-id: file:///svn/unbound/trunk@1786 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 15:37:02 +00:00
Wouter Wijngaards 568253e4ff Fixup DS query handling.
git-svn-id: file:///svn/unbound/trunk@1785 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 15:15:10 +00:00
Wouter Wijngaards 6b959f8043 remove debug print
git-svn-id: file:///svn/unbound/trunk@1784 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 14:59:48 +00:00
Wouter Wijngaards ea36edbc03 less slash
git-svn-id: file:///svn/unbound/trunk@1783 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 14:08:11 +00:00
Wouter Wijngaards 0e7ff77cd2 prefix
git-svn-id: file:///svn/unbound/trunk@1782 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 14:01:25 +00:00
Wouter Wijngaards 012d05073b mingw32 fix
git-svn-id: file:///svn/unbound/trunk@1781 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 13:54:36 +00:00
Wouter Wijngaards b93f679049 configure detect ssl get_compression_methods and ctime_r fix.
git-svn-id: file:///svn/unbound/trunk@1780 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 13:05:31 +00:00
Wouter Wijngaards 6770898042 yylex_destroy configure.
git-svn-id: file:///svn/unbound/trunk@1779 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 12:10:24 +00:00
Wouter Wijngaards e89cbd00fa ctime_r compat definition
git-svn-id: file:///svn/unbound/trunk@1778 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 10:29:25 +00:00
Wouter Wijngaards b8a2dfb2c9 revoke point handling
git-svn-id: file:///svn/unbound/trunk@1777 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 10:02:17 +00:00
Wouter Wijngaards 7d90b75ce8 autotrust options
git-svn-id: file:///svn/unbound/trunk@1776 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 08:46:33 +00:00
Wouter Wijngaards 0210f4ae41 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1775 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 08:07:47 +00:00
Wouter Wijngaards d8e6209a2e Fixup memleak in unsupported algorithm checks at startup.
git-svn-id: file:///svn/unbound/trunk@1774 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-25 06:51:00 +00:00
Wouter Wijngaards 4e176a0aa6 less memory leaks.
git-svn-id: file:///svn/unbound/trunk@1773 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-24 15:56:45 +00:00
Wouter Wijngaards 78ed2ec08a Cleaner memleak output.
git-svn-id: file:///svn/unbound/trunk@1772 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-24 15:30:05 +00:00
Wouter Wijngaards 6f1f6dafb5 autotrust test routines.
git-svn-id: file:///svn/unbound/trunk@1771 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-24 14:40:25 +00:00
Wouter Wijngaards 28be658942 debug routines and first brazilian prime has been done.
git-svn-id: file:///svn/unbound/trunk@1770 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-21 15:27:23 +00:00
Wouter Wijngaards ca94ca57b4 autotrust work
git-svn-id: file:///svn/unbound/trunk@1769 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-20 11:49:33 +00:00
Wouter Wijngaards 1e2111f593 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1768 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-19 15:53:45 +00:00
Wouter Wijngaards 0deef63323 autotrust state table updates.
git-svn-id: file:///svn/unbound/trunk@1767 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-19 15:30:20 +00:00
Wouter Wijngaards 701b4ccdd6 autotrust event_update routine.
git-svn-id: file:///svn/unbound/trunk@1766 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-18 15:36:46 +00:00
Wouter Wijngaards a8dccbdd40 autotrust
git-svn-id: file:///svn/unbound/trunk@1765 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-17 15:58:27 +00:00
Wouter Wijngaards c42056b9aa Blacklist when 16 queries fail in a row.
git-svn-id: file:///svn/unbound/trunk@1764 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-17 12:43:23 +00:00
Wouter Wijngaards 1cd84ce84e make better use of the cache.
git-svn-id: file:///svn/unbound/trunk@1763 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-14 14:15:08 +00:00
Wouter Wijngaards 948567bea8 Fix bug in DLV. Iana portlist.
git-svn-id: file:///svn/unbound/trunk@1762 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-14 13:58:54 +00:00
Wouter Wijngaards ed67590f74 report RTT
git-svn-id: file:///svn/unbound/trunk@1761 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-14 08:35:46 +00:00
Wouter Wijngaards 21e791248f autotrust work
git-svn-id: file:///svn/unbound/trunk@1760 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-13 15:32:04 +00:00
Wouter Wijngaards a85b563d37 fixup
git-svn-id: file:///svn/unbound/trunk@1759 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-13 14:00:06 +00:00
Wouter Wijngaards 3251765048 autotrust work
git-svn-id: file:///svn/unbound/trunk@1758 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-12 15:26:47 +00:00
Wouter Wijngaards 5ecf670277 lint
git-svn-id: file:///svn/unbound/trunk@1757 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-11 14:25:34 +00:00
Wouter Wijngaards df59a81a56 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1756 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-11 12:25:56 +00:00
Wouter Wijngaards f3579ce5f2 Nicer names for test files.
git-svn-id: file:///svn/unbound/trunk@1755 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-11 10:33:56 +00:00
Wouter Wijngaards f015b01072 updated unit tests.
git-svn-id: file:///svn/unbound/trunk@1754 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-11 10:24:45 +00:00
Wouter Wijngaards 01cd1823a4 GOST checked for. ldns-1.6.1 release candidate tarball.
git-svn-id: file:///svn/unbound/trunk@1753 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-11 10:02:53 +00:00
Wouter Wijngaards 0205e3ae29 Label as experimental, include ldns that does so.
git-svn-id: file:///svn/unbound/trunk@1752 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-10 09:09:29 +00:00
Wouter Wijngaards 48d786dcc8 nicer warning during GOST testing.
git-svn-id: file:///svn/unbound/trunk@1751 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-07 15:29:25 +00:00
Wouter Wijngaards 538ca28828 OpenSSL config() and small memory leak. No more ENGINE_load_gost().
git-svn-id: file:///svn/unbound/trunk@1750 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-07 15:23:35 +00:00
Wouter Wijngaards b6076e3b6d Tests for DS GOST.
git-svn-id: file:///svn/unbound/trunk@1749 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-06 14:45:40 +00:00
Wouter Wijngaards 783178c785 iana and ldns updated.
git-svn-id: file:///svn/unbound/trunk@1748 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-06 13:59:53 +00:00
Wouter Wijngaards 1f4222aa94 GOST support with --enable-gost.
git-svn-id: file:///svn/unbound/trunk@1747 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-06 13:38:55 +00:00
Wouter Wijngaards 74abf6ced0 trunk to 1.3.4
git-svn-id: file:///svn/unbound/trunk@1746 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-05 15:55:58 +00:00
Wouter Wijngaards 870b34a8ec noted.
git-svn-id: file:///svn/unbound/trunk@1745 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-04 14:28:17 +00:00
Wouter Wijngaards 75611ab90d iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1743 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-04 12:55:26 +00:00
Wouter Wijngaards 49d65b8ebf Test example signatures for rsasha256 and rsasha512.
git-svn-id: file:///svn/unbound/trunk@1742 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-04 12:45:51 +00:00
Wouter Wijngaards 6f4522a55c iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1741 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-03 09:04:06 +00:00
Wouter Wijngaards b97dbd3c8f Fix for Roland, tell why the error happens.
git-svn-id: file:///svn/unbound/trunk@1740 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-08-03 08:46:26 +00:00
Wouter Wijngaards 112df5ab6c iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1739 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-27 12:44:50 +00:00
Wouter Wijngaards a134925d91 Updated cacti files for request queue statistics counters.
git-svn-id: file:///svn/unbound/trunk@1738 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-27 12:35:48 +00:00
Wouter Wijngaards 38bc0800ee 1.3.3rc1 tag.
git-svn-id: file:///svn/unbound/trunk@1737 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-23 13:40:26 +00:00
Wouter Wijngaards dcea0777bf Fixup for root prime requests sent when not needed.
git-svn-id: file:///svn/unbound/trunk@1736 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-23 13:21:42 +00:00
Wouter Wijngaards 894ba681f0 Fixup lameness handling in server selection.
git-svn-id: file:///svn/unbound/trunk@1735 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-21 13:52:39 +00:00
Wouter Wijngaards 72aa0bad92 Log option for bogus only.
git-svn-id: file:///svn/unbound/trunk@1734 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-20 14:22:29 +00:00
Wouter Wijngaards f73ce55c6e nicer error message
git-svn-id: file:///svn/unbound/trunk@1733 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-20 13:31:45 +00:00
Wouter Wijngaards 658e84f7a0 root hints update-anchor.sh
git-svn-id: file:///svn/unbound/trunk@1732 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-20 09:43:40 +00:00
Wouter Wijngaards f1bd145b60 ignore transient sendto conditions.
git-svn-id: file:///svn/unbound/trunk@1731 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-20 08:35:13 +00:00
Wouter Wijngaards b5f7bf86ac makedist can setup.exe crosscompile
git-svn-id: file:///svn/unbound/trunk@1730 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-16 10:56:00 +00:00
Wouter Wijngaards 56d8c3d59d remove debug print
git-svn-id: file:///svn/unbound/trunk@1729 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-16 10:19:48 +00:00
Wouter Wijngaards 2b9e9b4111 fix replacement malloc
git-svn-id: file:///svn/unbound/trunk@1728 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-16 10:17:52 +00:00
Wouter Wijngaards d9a6ccfb52 Setup.exe making on crosscompile.
git-svn-id: file:///svn/unbound/trunk@1727 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-15 15:10:17 +00:00
Wouter Wijngaards cd5ac9634c with autoconf
git-svn-id: file:///svn/unbound/trunk@1726 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-15 14:24:45 +00:00
Wouter Wijngaards b5f2b7d36b fixup compile on XP.
git-svn-id: file:///svn/unbound/trunk@1725 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-15 13:47:58 +00:00
Wouter Wijngaards 91e49260a7 documented. Makefile slightly better at dependencies.
git-svn-id: file:///svn/unbound/trunk@1724 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-15 13:08:52 +00:00
Wouter Wijngaards a0d67a87f0 setup.exe can be created from crosscompile.
git-svn-id: file:///svn/unbound/trunk@1723 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-15 11:50:13 +00:00
Wouter Wijngaards 43d9c09372 crosscompile with mingw32 works.
git-svn-id: file:///svn/unbound/trunk@1722 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-14 14:44:53 +00:00
Wouter Wijngaards e33276b5c3 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1721 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-14 08:24:23 +00:00
Wouter Wijngaards 630e83f58b ldns update and RAND_MAX clean up
git-svn-id: file:///svn/unbound/trunk@1720 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-14 07:54:05 +00:00
Wouter Wijngaards ff77c81fd1 fixup unit test for portability
git-svn-id: file:///svn/unbound/trunk@1719 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-13 17:06:11 +00:00
Wouter Wijngaards 560e1c86b3 reported by Mees de Roo
git-svn-id: file:///svn/unbound/trunk@1718 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-13 16:00:20 +00:00
Wouter Wijngaards 73da11fe07 Fix mingw ID randomness from 8 to 16 bits.
git-svn-id: file:///svn/unbound/trunk@1717 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-13 15:47:42 +00:00
Wouter Wijngaards 7b03403efd examine dnskey on child side retry.
git-svn-id: file:///svn/unbound/trunk@1716 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-13 14:14:11 +00:00
Wouter Wijngaards 902cad61c6 trunk moves to 1.3.3.
git-svn-id: file:///svn/unbound/trunk@1715 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-13 13:28:12 +00:00
Wouter Wijngaards 82f83d8d06 Fix for windows crash at start (after install for example)
git-svn-id: file:///svn/unbound/trunk@1713 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-13 07:45:19 +00:00
Wouter Wijngaards fa842c30de Final version
git-svn-id: file:///svn/unbound/trunk@1712 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-10 12:27:16 +00:00
Wouter Wijngaards 506af05011 child retry
git-svn-id: file:///svn/unbound/trunk@1711 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-10 10:01:58 +00:00
Wouter Wijngaards f644c06516 updated plans
git-svn-id: file:///svn/unbound/trunk@1710 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-09 14:48:31 +00:00
Wouter Wijngaards 9755c94372 version 1.3.2 in trunk
git-svn-id: file:///svn/unbound/trunk@1709 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-09 09:08:08 +00:00
Wouter Wijngaards f0138c1cca Tag 1.3.1
git-svn-id: file:///svn/unbound/trunk@1708 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-09 09:00:24 +00:00
Wouter Wijngaards 374a7f45c2 it could be worse
git-svn-id: file:///svn/unbound/trunk@1707 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-08 12:07:03 +00:00
Wouter Wijngaards f3b66c177b Second precision.
git-svn-id: file:///svn/unbound/trunk@1706 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-08 11:37:50 +00:00
Wouter Wijngaards d535e6919e more thinking
git-svn-id: file:///svn/unbound/trunk@1705 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-07 15:00:18 +00:00
Wouter Wijngaards 0c7b289051 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1704 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-07 10:37:56 +00:00
Wouter Wijngaards 5decb468c2 rrset id for cache flush
git-svn-id: file:///svn/unbound/trunk@1703 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-07 10:16:34 +00:00
Wouter Wijngaards 5e90d568eb updated fedora spec file.
git-svn-id: file:///svn/unbound/trunk@1702 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-06 17:02:41 +00:00
Wouter Wijngaards 9e8a5100ad updated fedora spec file
git-svn-id: file:///svn/unbound/trunk@1701 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-06 17:02:17 +00:00
Wouter Wijngaards 1dc1ffabb4 Plans.
git-svn-id: file:///svn/unbound/trunk@1700 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-06 14:51:58 +00:00
Wouter Wijngaards c299e49384 uname fixup.
git-svn-id: file:///svn/unbound/trunk@1699 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-06 12:13:15 +00:00
Wouter Wijngaards 8595d94e0f Prettier, comments from Jelte.
git-svn-id: file:///svn/unbound/trunk@1698 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-06 09:34:47 +00:00
Wouter Wijngaards bfceac5b2e reviewcomments
git-svn-id: file:///svn/unbound/trunk@1697 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-06 08:34:54 +00:00
Wouter Wijngaards b794eb84ac changelog
git-svn-id: file:///svn/unbound/trunk@1696 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-03 19:41:31 +00:00
Wouter Wijngaards 1cf8bdae51 Fix for linking when ldns installed.
git-svn-id: file:///svn/unbound/trunk@1695 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-03 19:40:14 +00:00
Wouter Wijngaards 1bc4092127 fixup
git-svn-id: file:///svn/unbound/trunk@1694 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-07-01 11:48:34 +00:00
Wouter Wijngaards 1e97b85e45 Ldns 1.6.0 to be.
git-svn-id: file:///svn/unbound/trunk@1693 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-30 14:08:39 +00:00
Wouter Wijngaards edae0ad954 More lenient.
git-svn-id: file:///svn/unbound/trunk@1692 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-30 13:20:02 +00:00
Wouter Wijngaards d453b4a43b More lenient checks.
git-svn-id: file:///svn/unbound/trunk@1691 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-30 12:50:57 +00:00
Wouter Wijngaards 7bd415ffdd Removed debug prints.
git-svn-id: file:///svn/unbound/trunk@1690 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-30 08:24:19 +00:00
Wouter Wijngaards d232dbd4a5 Linux IPv6 large response support.
git-svn-id: file:///svn/unbound/trunk@1689 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-29 13:47:48 +00:00
Wouter Wijngaards 373758092f ldns tarball update.
git-svn-id: file:///svn/unbound/trunk@1688 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-29 10:36:52 +00:00
Wouter Wijngaards b6406cae1e Better wrongly truncated check. And debug statements.
git-svn-id: file:///svn/unbound/trunk@1687 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-29 10:15:27 +00:00
Wouter Wijngaards 298aff3ad2 ldns tarball update.
git-svn-id: file:///svn/unbound/trunk@1686 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-29 09:59:43 +00:00
Wouter Wijngaards efee0803d0 debugprint for wrongly_truncated
git-svn-id: file:///svn/unbound/trunk@1685 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-29 08:52:58 +00:00
Wouter Wijngaards ec30ae3ca6 Fixup for EDNS probe (neater than patch on mailing list).
git-svn-id: file:///svn/unbound/trunk@1684 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-26 13:15:06 +00:00
Wouter Wijngaards 4ead61eb63 Updated fedora spec file, with python support.
git-svn-id: file:///svn/unbound/trunk@1683 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-22 15:00:21 +00:00
Wouter Wijngaards 206a6bb539 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1682 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-22 08:04:01 +00:00
Wouter Wijngaards fb5fa2bdb1 and changelog separate.
git-svn-id: file:///svn/unbound/trunk@1681 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-22 07:56:27 +00:00
Wouter Wijngaards 8b2f5dcaf0 Fixup strict aliasing safer.
git-svn-id: file:///svn/unbound/trunk@1680 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-22 07:56:19 +00:00
Wouter Wijngaards 4d97a3a400 documentation
git-svn-id: file:///svn/unbound/trunk@1679 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-19 11:40:44 +00:00
Wouter Wijngaards 368dc659ea Handle referral path check cases where NS is in the answer section.
git-svn-id: file:///svn/unbound/trunk@1678 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-19 08:55:12 +00:00
Wouter Wijngaards e49e0539d8 newer bison.
git-svn-id: file:///svn/unbound/trunk@1677 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-19 07:47:46 +00:00
Wouter Wijngaards aec8f4644f strict aliasing warning in config_file code.
git-svn-id: file:///svn/unbound/trunk@1676 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-19 07:45:45 +00:00
Wouter Wijngaards 6f745bc49e iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1675 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-19 07:27:53 +00:00
Wouter Wijngaards ef564b5a29 Fixup strict aliasing warning on Fedora 11.
git-svn-id: file:///svn/unbound/trunk@1674 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-19 07:09:12 +00:00
Wouter Wijngaards c1b2364d1d please lint
git-svn-id: file:///svn/unbound/trunk@1673 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-18 14:39:50 +00:00
Wouter Wijngaards 790fe91662 python warning suppress.
git-svn-id: file:///svn/unbound/trunk@1672 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-18 14:28:28 +00:00
Wouter Wijngaards 819f9d817a autoconf 2.63 for configure
git-svn-id: file:///svn/unbound/trunk@1671 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-18 14:08:56 +00:00
Wouter Wijngaards e0bc4f2c97 extremely lenient for truncated positive replies
git-svn-id: file:///svn/unbound/trunk@1670 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-18 10:59:59 +00:00
Wouter Wijngaards efcb61fb22 Fixup parse problem reported by Hauke Lampe.
git-svn-id: file:///svn/unbound/trunk@1669 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-18 09:31:58 +00:00
Wouter Wijngaards d94c548dab non-TODO.
git-svn-id: file:///svn/unbound/trunk@1668 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-17 15:18:38 +00:00
Wouter Wijngaards a18c4eaebc Do later, notabug but a feature.
git-svn-id: file:///svn/unbound/trunk@1667 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-17 14:58:07 +00:00
Wouter Wijngaards e92fd4ff33 typo
git-svn-id: file:///svn/unbound/trunk@1666 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-17 11:55:48 +00:00
Wouter Wijngaards 7bd75483e1 credits entry for cz.nic
git-svn-id: file:///svn/unbound/trunk@1665 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-17 07:12:16 +00:00
Wouter Wijngaards 573fd6652b Extra test, but no dlv negative cache failures discovered.
git-svn-id: file:///svn/unbound/trunk@1664 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-16 14:57:19 +00:00
Wouter Wijngaards 13d2817b62 python testenv easier to use.
git-svn-id: file:///svn/unbound/trunk@1663 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-16 12:38:46 +00:00
Wouter Wijngaards f39e5fe3a8 check messages taken from cache, also in iterator.
git-svn-id: file:///svn/unbound/trunk@1662 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-16 12:03:41 +00:00
Wouter Wijngaards a569062627 touchup to munin memory report
git-svn-id: file:///svn/unbound/trunk@1661 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-16 09:34:18 +00:00
Wouter Wijngaards a40ec4b935 Fix max depth check.
git-svn-id: file:///svn/unbound/trunk@1660 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-16 09:06:52 +00:00
Wouter Wijngaards 427ddba6d7 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1659 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-16 08:31:07 +00:00
Wouter Wijngaards b757b29910 FAQ entry.
git-svn-id: file:///svn/unbound/trunk@1658 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-16 08:23:32 +00:00
Wouter Wijngaards 3898abde02 Fixup DLV lookups and pickup responses from cache.
git-svn-id: file:///svn/unbound/trunk@1657 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-15 13:27:53 +00:00
Wouter Wijngaards 8466ac7e7f bug #254, whitespace in example.conf
git-svn-id: file:///svn/unbound/trunk@1656 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-13 09:49:53 +00:00
Wouter Wijngaards 80f6ed2ff0 Check right value.
git-svn-id: file:///svn/unbound/trunk@1655 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-12 14:16:13 +00:00
Wouter Wijngaards 19d72a41cb todo
git-svn-id: file:///svn/unbound/trunk@1654 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-12 10:04:29 +00:00
Wouter Wijngaards 07411c16a9 Fixup stub below a forward, the stub is still honored and not trumped by the
forward zone.


git-svn-id: file:///svn/unbound/trunk@1653 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-12 09:01:42 +00:00
Wouter Wijngaards 5ca6d8c50b mesh callbacks review, call error if deleted unfulfilled, check fptr wlist.
git-svn-id: file:///svn/unbound/trunk@1652 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-12 07:53:36 +00:00
Wouter Wijngaards 16e920f416 Fixed potential wrong NSEC, but the bug could not be triggered. Unit test
added anyway.


git-svn-id: file:///svn/unbound/trunk@1651 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-12 07:23:04 +00:00
Wouter Wijngaards 89f0fd7252 forward-zone and DS fixup. Test.
git-svn-id: file:///svn/unbound/trunk@1650 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-11 18:54:07 +00:00
Wouter Wijngaards a40ec010be Got contributed script to turn etc hosts into unbound config.
git-svn-id: file:///svn/unbound/trunk@1649 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-11 18:30:53 +00:00
Wouter Wijngaards 1b8519e619 Fixup stub chain of trust from public to private servers.
git-svn-id: file:///svn/unbound/trunk@1648 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-11 14:02:37 +00:00
Wouter Wijngaards add0079981 And review fixup recommit.
git-svn-id: file:///svn/unbound/trunk@1647 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-11 10:52:28 +00:00
Wouter Wijngaards 2c56564e4e recommit 9 June 2009.
git-svn-id: file:///svn/unbound/trunk@1646 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-11 09:43:23 +00:00
Wouter Wijngaards baaaae857a munin show total memory if sbrk trick does not work (eg. FreeBSD).
git-svn-id: file:///svn/unbound/trunk@1645 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-08 15:43:15 +00:00
Wouter Wijngaards b6099d5f55 fail python if no swig
git-svn-id: file:///svn/unbound/trunk@1644 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-08 14:53:27 +00:00
Wouter Wijngaards 8c36960c29 lint, aliasing.
git-svn-id: file:///svn/unbound/trunk@1643 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-08 14:51:00 +00:00
Wouter Wijngaards 3c5c0b2727 iana post list updated.
git-svn-id: file:///svn/unbound/trunk@1642 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-08 13:55:58 +00:00
Wouter Wijngaards 6dd6542f04 TODO items.
git-svn-id: file:///svn/unbound/trunk@1641 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-08 13:47:06 +00:00
Wouter Wijngaards 6451748967 Remove REVOKE flag support.
git-svn-id: file:///svn/unbound/trunk@1639 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-08 08:29:17 +00:00
Wouter Wijngaards b2ff49e4c4 review comments Matthijs.
git-svn-id: file:///svn/unbound/trunk@1637 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-03 08:06:42 +00:00
Wouter Wijngaards 38ec4f4777 Fixup bad free.
git-svn-id: file:///svn/unbound/trunk@1635 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-03 07:57:19 +00:00
Wouter Wijngaards 413d579e58 1.3.0 tag remove
git-svn-id: file:///svn/unbound/trunk@1633 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-02 13:44:57 +00:00
Wouter Wijngaards 3494191250 ldns updated.
git-svn-id: file:///svn/unbound/trunk@1632 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-02 09:14:29 +00:00
Wouter Wijngaards 4b449309e5 rsasha256 and rsasha512 not enabled by default.
git-svn-id: file:///svn/unbound/trunk@1631 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-06-02 09:04:16 +00:00
Wouter Wijngaards 71b6537666 Fixup docbug reported by Matthew Dempsky.
git-svn-id: file:///svn/unbound/trunk@1630 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-29 08:48:44 +00:00
Jelte Jansen 886721c060 let's version this one
git-svn-id: file:///svn/unbound/trunk@1629 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-28 12:48:45 +00:00
Wouter Wijngaards cdb2726e68 iana and ldns updates.
git-svn-id: file:///svn/unbound/trunk@1628 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-28 08:45:04 +00:00
Wouter Wijngaards caaa90a200 Removed debug statement.
git-svn-id: file:///svn/unbound/trunk@1627 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-27 12:28:23 +00:00
Wouter Wijngaards 5e2189bb35 Fixup crash if root prime has a timeout and parent qstate has been deleted.
git-svn-id: file:///svn/unbound/trunk@1626 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-27 12:10:07 +00:00
Wouter Wijngaards 7758098250 change in debug statements.
git-svn-id: file:///svn/unbound/trunk@1625 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-27 11:27:41 +00:00
Wouter Wijngaards b86b9f7fdc Fix IPv6 detection on XP.
Fix loop to service on quit when there are messages waiting.

git-svn-id: file:///svn/unbound/trunk@1624 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-27 08:24:19 +00:00
Wouter Wijngaards daf63c7e89 Fixup assertion that no longer holds (since the new DoS prevention code jostles out old queries).
git-svn-id: file:///svn/unbound/trunk@1623 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-05-26 14:42:14 +00:00
Wouter Wijngaards 578c1632ce Windows handle leakage fixes: closesocket or else the networkstack leaks handles (for ever, even after closing the application), and use own mutex implementation (whee!).
git-svn-id: file:///svn/unbound/trunk@1622 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-29 15:23:08 +00:00
Wouter Wijngaards 37f403955b keeping ldns and unbound ldns-testpkts the same
git-svn-id: file:///svn/unbound/trunk@1620 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-28 09:06:45 +00:00
Wouter Wijngaards dd42c84b5e 1.3.0 svn tag.
git-svn-id: file:///svn/unbound/trunk@1619 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-28 08:28:45 +00:00
Wouter Wijngaards ffe442608c ifdef windows functions in testbound.
git-svn-id: file:///svn/unbound/trunk@1618 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-27 13:26:15 +00:00
Wouter Wijngaards 21389820a7 Optimisation.
git-svn-id: file:///svn/unbound/trunk@1617 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-27 12:40:22 +00:00
Wouter Wijngaards 1562a13332 libcrypto and python checks.
git-svn-id: file:///svn/unbound/trunk@1616 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-23 15:47:49 +00:00
Wouter Wijngaards ea0148caf8 python lock deadlock on MacOSX.
git-svn-id: file:///svn/unbound/trunk@1615 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-23 14:59:44 +00:00
Wouter Wijngaards 8cc8261947 Pylib for macOSX
git-svn-id: file:///svn/unbound/trunk@1614 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-23 14:34:32 +00:00
Wouter Wijngaards 7c2813eb82 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1613 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-23 13:00:01 +00:00
Wouter Wijngaards 81023e116d solaris thread safety of thread functions.
git-svn-id: file:///svn/unbound/trunk@1612 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-23 12:51:33 +00:00
Wouter Wijngaards 5cacd20a6e autoconf on linux.
git-svn-id: file:///svn/unbound/trunk@1611 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-21 14:33:10 +00:00
Wouter Wijngaards 1aedf47ebe Fix swig detection.
git-svn-id: file:///svn/unbound/trunk@1610 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-21 14:32:44 +00:00
Wouter Wijngaards d75777ec63 build fix.
git-svn-id: file:///svn/unbound/trunk@1609 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-21 08:36:39 +00:00
Wouter Wijngaards d1a27b6d34 python include and configlexer fwrite warning.
git-svn-id: file:///svn/unbound/trunk@1608 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-17 12:14:43 +00:00
Wouter Wijngaards dd7f5cc718 Line endings.
git-svn-id: file:///svn/unbound/trunk@1607 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-17 11:52:42 +00:00
Wouter Wijngaards 718e235a47 rsasha512 fixup and successful test of new winsock handler.
git-svn-id: file:///svn/unbound/trunk@1606 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-17 11:18:19 +00:00
Wouter Wijngaards 9f1ee24abb faster fix for winsock handler.
git-svn-id: file:///svn/unbound/trunk@1605 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-17 09:01:52 +00:00
Wouter Wijngaards 6a152952bf more capacity for winsock handler.
git-svn-id: file:///svn/unbound/trunk@1604 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-17 08:35:15 +00:00
Wouter Wijngaards f3d98d17f4 Fix unix version of windows bug found yesterday.
git-svn-id: file:///svn/unbound/trunk@1603 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-17 07:59:32 +00:00
Wouter Wijngaards 9ea5b16bae Windows winsock handler problem fixup.
git-svn-id: file:///svn/unbound/trunk@1602 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-16 14:54:58 +00:00
Wouter Wijngaards f32d07786a iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1601 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-16 13:31:41 +00:00
Wouter Wijngaards 7138a4cf42 winsock exit faster and more logging possible.
git-svn-id: file:///svn/unbound/trunk@1600 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-16 12:53:35 +00:00
Wouter Wijngaards 53a026eb4e handle NOTCONN.
git-svn-id: file:///svn/unbound/trunk@1599 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-14 13:35:10 +00:00
Wouter Wijngaards 768c4b2643 min-ttl option and tests for min-ttl and max-ttl.
git-svn-id: file:///svn/unbound/trunk@1598 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-14 10:10:11 +00:00
Wouter Wijngaards 3eda6e26ff better help text in makedist.sh
git-svn-id: file:///svn/unbound/trunk@1597 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-14 09:23:21 +00:00
Wouter Wijngaards 54bd0fff06 bug #245 fixed.
git-svn-id: file:///svn/unbound/trunk@1596 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-14 08:27:16 +00:00
Wouter Wijngaards 4ad2eb2549 detect gost.
git-svn-id: file:///svn/unbound/trunk@1595 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-09 15:23:14 +00:00
Wouter Wijngaards bfe96b89f0 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1594 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-09 15:00:08 +00:00
Wouter Wijngaards 3b386055c7 RSASHA256 implicitly means NSEC3 support.
git-svn-id: file:///svn/unbound/trunk@1593 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-09 14:51:17 +00:00
Wouter Wijngaards 5a9dcd323d remove empty line
git-svn-id: file:///svn/unbound/trunk@1592 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-07 15:02:57 +00:00
Wouter Wijngaards 3ee3492095 NXDOMAIN TTL considerations.
git-svn-id: file:///svn/unbound/trunk@1591 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 14:36:42 +00:00
Wouter Wijngaards 1e1ac9900a signature clock skew code.
git-svn-id: file:///svn/unbound/trunk@1590 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 14:09:33 +00:00
Wouter Wijngaards 397985b2c8 python mod invalidate routine fix.
git-svn-id: file:///svn/unbound/trunk@1589 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 12:35:02 +00:00
Wouter Wijngaards 93f6117ab2 install uninstall for python.
git-svn-id: file:///svn/unbound/trunk@1588 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 12:22:11 +00:00
Wouter Wijngaards f46febcc97 pyunbound test
git-svn-id: file:///svn/unbound/trunk@1587 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 11:04:54 +00:00
Wouter Wijngaards d745581dbd FreeBSD jail detect IPv6 not accessible.
git-svn-id: file:///svn/unbound/trunk@1586 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 10:20:08 +00:00
Wouter Wijngaards 62fca9e1fb and configure update
git-svn-id: file:///svn/unbound/trunk@1585 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 09:20:01 +00:00
Wouter Wijngaards ac9c3b84b1 windows compile fix.
git-svn-id: file:///svn/unbound/trunk@1584 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-06 08:10:14 +00:00
Wouter Wijngaards 49913a1c9e doc test fixup.
git-svn-id: file:///svn/unbound/trunk@1583 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-03 14:13:25 +00:00
Wouter Wijngaards 5445bf72ba - Fixed a bug that caused messages to be stored in the cache too
long.  Hard to trigger, but NXDOMAINs for nameservers or CNAME
	  targets have been more vulnerable to the TTL miscalculation bug. 


git-svn-id: file:///svn/unbound/trunk@1582 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-03 13:49:40 +00:00
Wouter Wijngaards 1fa1c9d1b1 unit test for python module.
git-svn-id: file:///svn/unbound/trunk@1581 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 14:44:57 +00:00
Wouter Wijngaards af102d24ce Fix for flush_zone
git-svn-id: file:///svn/unbound/trunk@1580 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 11:56:01 +00:00
Wouter Wijngaards a5c428bb8d please doxygen
git-svn-id: file:///svn/unbound/trunk@1579 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 10:21:37 +00:00
Wouter Wijngaards 445f8a4e22 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1578 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 10:21:20 +00:00
Wouter Wijngaards a5c76d0579 docs
git-svn-id: file:///svn/unbound/trunk@1577 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 10:14:27 +00:00
Wouter Wijngaards db94e389da Moved documentation for pythonmod.
git-svn-id: file:///svn/unbound/trunk@1576 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 09:51:51 +00:00
Wouter Wijngaards c3bf9f1bb3 Moved documentation.
git-svn-id: file:///svn/unbound/trunk@1575 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 09:50:45 +00:00
Wouter Wijngaards 3322c9e141 added
git-svn-id: file:///svn/unbound/trunk@1574 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 09:50:24 +00:00
Wouter Wijngaards 2e20c86309 moved files. Make _unbound python libunbound module.
git-svn-id: file:///svn/unbound/trunk@1573 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-02 09:47:35 +00:00
Wouter Wijngaards 0b4fe963d5 pyunbound work
git-svn-id: file:///svn/unbound/trunk@1572 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-01 14:34:13 +00:00
Wouter Wijngaards 7ad28caa41 new libunbound calls documented.
git-svn-id: file:///svn/unbound/trunk@1571 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-01 12:57:13 +00:00
Wouter Wijngaards c6da8de517 suppress ipv4mapped errors from logs.
git-svn-id: file:///svn/unbound/trunk@1570 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-04-01 10:01:43 +00:00
Wouter Wijngaards c1f4b92026 Fix pthread test.
git-svn-id: file:///svn/unbound/trunk@1569 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-30 14:42:43 +00:00
Wouter Wijngaards f9aeb8904d Python checks fix.
git-svn-id: file:///svn/unbound/trunk@1568 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-30 12:32:54 +00:00
Wouter Wijngaards 64e3db1f04 Read dev/random before chroot.
git-svn-id: file:///svn/unbound/trunk@1567 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-30 12:16:21 +00:00
Wouter Wijngaards a12dcdcdc4 retest
git-svn-id: file:///svn/unbound/trunk@1566 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-30 09:39:34 +00:00
Wouter Wijngaards d369a1ac48 RRSIG validation fixed after Stephane Bortzmeyer reported.
git-svn-id: file:///svn/unbound/trunk@1565 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-30 09:35:48 +00:00
Wouter Wijngaards 3a7f86982e configure fixes.
git-svn-id: file:///svn/unbound/trunk@1564 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-30 08:47:20 +00:00
Wouter Wijngaards 6803b9461f python compile fix for BSD 7.1-current.
git-svn-id: file:///svn/unbound/trunk@1563 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-27 14:59:04 +00:00
Wouter Wijngaards 868df9f584 nicer -h output
git-svn-id: file:///svn/unbound/trunk@1562 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-27 13:09:00 +00:00
Wouter Wijngaards 7dcca025f4 python work
git-svn-id: file:///svn/unbound/trunk@1561 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-26 15:47:45 +00:00
Wouter Wijngaards e0cd16b38c pyunbound works.
git-svn-id: file:///svn/unbound/trunk@1560 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-26 12:47:04 +00:00
Wouter Wijngaards ebd14d9f35 Python work.
git-svn-id: file:///svn/unbound/trunk@1559 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-26 09:31:28 +00:00
Wouter Wijngaards 31ec67fcce and for out of dir builds
git-svn-id: file:///svn/unbound/trunk@1558 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-25 16:22:02 +00:00
Wouter Wijngaards 11f11a5377 python module compiles.
git-svn-id: file:///svn/unbound/trunk@1557 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-25 16:20:34 +00:00
Wouter Wijngaards 0799d77798 python contribution from Zdenek Vasicek and Marek Vavrusa (BSD licensed).
git-svn-id: file:///svn/unbound/trunk@1556 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-25 14:47:47 +00:00
Wouter Wijngaards 910167b38c better libtool host detection
git-svn-id: file:///svn/unbound/trunk@1555 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 16:16:44 +00:00
Wouter Wijngaards 60f4826ff7 No longer underquoted.
git-svn-id: file:///svn/unbound/trunk@1554 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 15:31:11 +00:00
Wouter Wijngaards a87d222547 rpath for ldns if needed
git-svn-id: file:///svn/unbound/trunk@1553 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 14:55:34 +00:00
Wouter Wijngaards 25467d37e3 64bit types not handled well enough builtin.
git-svn-id: file:///svn/unbound/trunk@1552 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 14:08:58 +00:00
Wouter Wijngaards faf17d6e86 Nicer.
git-svn-id: file:///svn/unbound/trunk@1551 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 13:55:12 +00:00
Wouter Wijngaards 0f3e00e3a6 Neater compile command line, no -I/usr/include, no double spaces.
git-svn-id: file:///svn/unbound/trunk@1550 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 13:22:09 +00:00
Wouter Wijngaards eaff1bdeb5 fix postcommit errors.
git-svn-id: file:///svn/unbound/trunk@1549 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 12:58:42 +00:00
Wouter Wijngaards d8b8eabeac flex on linux
git-svn-id: file:///svn/unbound/trunk@1548 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 12:53:25 +00:00
Wouter Wijngaards e5c414355e solaris 11 fix
git-svn-id: file:///svn/unbound/trunk@1547 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 12:47:56 +00:00
Wouter Wijngaards dbf9f42142 iana updated. config.h.in neater.
git-svn-id: file:///svn/unbound/trunk@1546 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 11:53:31 +00:00
Wouter Wijngaards a30d1f9f20 Neater configure and no double config.h includes.
git-svn-id: file:///svn/unbound/trunk@1545 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-24 10:42:57 +00:00
Wouter Wijngaards ee8465d887 More common configure code.
git-svn-id: file:///svn/unbound/trunk@1544 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-23 18:09:19 +00:00
Wouter Wijngaards 00170dfa41 Nicer configure.
git-svn-id: file:///svn/unbound/trunk@1543 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-23 14:59:58 +00:00
Wouter Wijngaards 912db8d277 launchd plist file, and deprecation test for MacOSX use of daemon(3).
git-svn-id: file:///svn/unbound/trunk@1542 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-23 11:22:57 +00:00
Wouter Wijngaards d0c6177f44 build_test_fix
git-svn-id: file:///svn/unbound/trunk@1541 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-20 16:16:34 +00:00
Wouter Wijngaards 5069af975f autoconf 2.61
git-svn-id: file:///svn/unbound/trunk@1540 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-20 12:24:06 +00:00
Wouter Wijngaards b0ef703c1b bug 239
git-svn-id: file:///svn/unbound/trunk@1539 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-20 10:28:20 +00:00
Wouter Wijngaards c154c6b7b4 easier to compile on windows.
git-svn-id: file:///svn/unbound/trunk@1538 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-19 14:24:19 +00:00
Wouter Wijngaards 2978e72596 Use _beginthreadex if available.
git-svn-id: file:///svn/unbound/trunk@1537 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-19 13:04:28 +00:00
Wouter Wijngaards 6e9d768c6c iana_updated.
git-svn-id: file:///svn/unbound/trunk@1536 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-19 11:13:37 +00:00
Wouter Wijngaards d8392b01d3 windows README
git-svn-id: file:///svn/unbound/trunk@1535 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-19 11:04:50 +00:00
Wouter Wijngaards f861f19843 done.
git-svn-id: file:///svn/unbound/trunk@1534 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-18 15:56:57 +00:00
Wouter Wijngaards 97a73402fc inverse trust anchor.
git-svn-id: file:///svn/unbound/trunk@1533 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-18 14:02:46 +00:00
Wouter Wijngaards 41e589b08b Fixup trust anchor algorithm check.
git-svn-id: file:///svn/unbound/trunk@1532 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-18 13:07:48 +00:00
Wouter Wijngaards cfd739e2eb Tests for bug that we do not have.
git-svn-id: file:///svn/unbound/trunk@1531 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-18 08:11:23 +00:00
Wouter Wijngaards bcd6fee1f4 test and nicer error handling on target query failure.
git-svn-id: file:///svn/unbound/trunk@1530 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-17 14:45:31 +00:00
Wouter Wijngaards 6355d45e70 done.
git-svn-id: file:///svn/unbound/trunk@1529 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-16 15:40:25 +00:00
Wouter Wijngaards 76c0cb3913 unbound cacti contrib
git-svn-id: file:///svn/unbound/trunk@1528 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-16 13:31:44 +00:00
Wouter Wijngaards 116e9d9d8d fixup small buglet.
git-svn-id: file:///svn/unbound/trunk@1527 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-16 09:15:29 +00:00
Wouter Wijngaards 61135d1456 Fixups for windows.
git-svn-id: file:///svn/unbound/trunk@1526 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-13 15:29:31 +00:00
Wouter Wijngaards 5f27e00a19 doxygen, lex, yacc.
git-svn-id: file:///svn/unbound/trunk@1525 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-13 09:27:37 +00:00
Wouter Wijngaards 0d575036cb update anchors on win.
git-svn-id: file:///svn/unbound/trunk@1524 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-12 16:31:57 +00:00
Wouter Wijngaards afe9d4bb67 more consistency.
git-svn-id: file:///svn/unbound/trunk@1523 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-12 16:11:11 +00:00
Wouter Wijngaards 159d59a3dc Fix locking error.
git-svn-id: file:///svn/unbound/trunk@1522 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-12 13:14:40 +00:00
Wouter Wijngaards ac4535d4e5 log and tests fixups.
git-svn-id: file:///svn/unbound/trunk@1521 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-12 09:36:28 +00:00
Wouter Wijngaards 8c2d5d42d9 windows work.
git-svn-id: file:///svn/unbound/trunk@1520 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-11 16:32:07 +00:00
Wouter Wijngaards 363a4712b2 Parser allows syslog on windows.
git-svn-id: file:///svn/unbound/trunk@1519 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-11 11:53:47 +00:00
Wouter Wijngaards c02fd13138 iana update
git-svn-id: file:///svn/unbound/trunk@1518 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-11 11:41:47 +00:00
Wouter Wijngaards e4c5af61c6 XP tested. winsock event handler fixed for signal events. Neater code integration.
git-svn-id: file:///svn/unbound/trunk@1517 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-11 11:02:34 +00:00
Wouter Wijngaards 254e6ec34f Windows work.
git-svn-id: file:///svn/unbound/trunk@1516 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-10 16:14:09 +00:00
Wouter Wijngaards 47d7fd59ca makedist no double tags on version.
nicer setup, nicer exec, starts unbound after install.

git-svn-id: file:///svn/unbound/trunk@1515 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-10 12:35:09 +00:00
Wouter Wijngaards 6015524e34 iana portlist update
git-svn-id: file:///svn/unbound/trunk@1514 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-10 09:25:27 +00:00
Wouter Wijngaards 80ef8e2f7e Installer script to make setup.exe.
git-svn-id: file:///svn/unbound/trunk@1513 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-09 16:16:39 +00:00
Wouter Wijngaards 157c7cde0d Memory leak fixup.
git-svn-id: file:///svn/unbound/trunk@1512 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-05 08:19:52 +00:00
Wouter Wijngaards 1947f8cbb1 please doxygen
git-svn-id: file:///svn/unbound/trunk@1511 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-03 19:15:44 +00:00
Wouter Wijngaards 541ca65c9c fixup for unix compile.
git-svn-id: file:///svn/unbound/trunk@1510 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-03 19:02:59 +00:00
Wouter Wijngaards 53b51dbdef windows registry settings.
git-svn-id: file:///svn/unbound/trunk@1509 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-03 15:55:02 +00:00
Wouter Wijngaards 7de3900654 combined icon
git-svn-id: file:///svn/unbound/trunk@1508 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-03 10:34:56 +00:00
Wouter Wijngaards 208e698306 1.3.0 without snapshot extension from makedist -w.
git-svn-id: file:///svn/unbound/trunk@1507 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-03 09:15:52 +00:00
Wouter Wijngaards eafa979e0f mingw work.
git-svn-id: file:///svn/unbound/trunk@1506 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-02 16:43:10 +00:00
Wouter Wijngaards 97a3830515 fix test app.
git-svn-id: file:///svn/unbound/trunk@1505 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-02 10:14:36 +00:00
Wouter Wijngaards 2bf8d9b4b2 FAQ entry
git-svn-id: file:///svn/unbound/trunk@1504 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-02 09:35:56 +00:00
Wouter Wijngaards a9754e0727 iana portlist updated and doxygen comments.
git-svn-id: file:///svn/unbound/trunk@1503 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-02 08:32:27 +00:00
Wouter Wijngaards 1811270c68 Fix export symbols.
git-svn-id: file:///svn/unbound/trunk@1502 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-03-02 08:21:19 +00:00
Wouter Wijngaards f30fc9133c services api integration.
git-svn-id: file:///svn/unbound/trunk@1501 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-27 16:29:40 +00:00
Wouter Wijngaards 7a2c1c8d47 new configure and lexer fix.
git-svn-id: file:///svn/unbound/trunk@1500 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-27 09:38:11 +00:00
Wouter Wijngaards fef17eadb6 windows service configuration.
git-svn-id: file:///svn/unbound/trunk@1499 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-26 16:18:11 +00:00
Wouter Wijngaards 840d7fd34f makedist windows distro feature.
git-svn-id: file:///svn/unbound/trunk@1498 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-26 16:17:46 +00:00
Wouter Wijngaards ae866b00a9 PNG format icon.
git-svn-id: file:///svn/unbound/trunk@1497 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-26 11:01:44 +00:00
Wouter Wijngaards 0acf55404c windres usage for application resources.
git-svn-id: file:///svn/unbound/trunk@1496 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-25 15:54:35 +00:00
Wouter Wijngaards ffe0bd51d8 win makedist -w feature.
git-svn-id: file:///svn/unbound/trunk@1495 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-24 16:33:17 +00:00
Wouter Wijngaards c2261b63f1 fixup warnings on vista/mingw.
git-svn-id: file:///svn/unbound/trunk@1494 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-24 15:38:23 +00:00
Wouter Wijngaards 23ab46e3a5 new dlv key location
git-svn-id: file:///svn/unbound/trunk@1493 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-24 10:07:10 +00:00
Wouter Wijngaards 84edc1428b Fixup itar.sh
git-svn-id: file:///svn/unbound/trunk@1492 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-20 14:03:34 +00:00
Wouter Wijngaards e6fbf88b59 typo
git-svn-id: file:///svn/unbound/trunk@1491 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-19 13:41:04 +00:00
Wouter Wijngaards 4b2d6d20af use ftp.
git-svn-id: file:///svn/unbound/trunk@1490 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-19 13:33:39 +00:00
Wouter Wijngaards f6b2f66311 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1489 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-19 11:17:36 +00:00
Wouter Wijngaards b67ed83149 update-itar.sh update script from itar.iana.org
git-svn-id: file:///svn/unbound/trunk@1488 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-19 10:38:51 +00:00
Wouter Wijngaards ce71720093 warn for bad trust anchors.
git-svn-id: file:///svn/unbound/trunk@1487 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-19 09:01:39 +00:00
Wouter Wijngaards 8b31d0b2e0 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1486 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-18 13:33:53 +00:00
Wouter Wijngaards cf068986ff more cycle checks.
fix for reentrant problem.


git-svn-id: file:///svn/unbound/trunk@1485 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-18 13:23:17 +00:00
Wouter Wijngaards c699ba2c40 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1484 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-13 15:36:45 +00:00
Wouter Wijngaards 340eb440da document unbound-host config file behaviour.
git-svn-id: file:///svn/unbound/trunk@1483 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-13 15:31:03 +00:00
Wouter Wijngaards a2dcd9c019 forward command for unbound-control.
git-svn-id: file:///svn/unbound/trunk@1482 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-13 15:26:37 +00:00
Wouter Wijngaards dfef08c21f show fwders in use.
git-svn-id: file:///svn/unbound/trunk@1481 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 16:11:53 +00:00
Wouter Wijngaards df8005ff3c libunbound API version is upped. A change in symbols reported by Ondrej and
small change in ub_cancel API.


git-svn-id: file:///svn/unbound/trunk@1480 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 13:34:00 +00:00
Wouter Wijngaards 8148211e53 flush_requestlist feature for unbound-control.
git-svn-id: file:///svn/unbound/trunk@1479 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 13:21:19 +00:00
Wouter Wijngaards ca09b7014b stats_noreset feature for unbound-control
git-svn-id: file:///svn/unbound/trunk@1478 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 11:41:51 +00:00
Wouter Wijngaards e5a5749603 flush_stats feature for unbound-control.
git-svn-id: file:///svn/unbound/trunk@1477 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 10:37:00 +00:00
Wouter Wijngaards 95f5b577d4 and include...
git-svn-id: file:///svn/unbound/trunk@1476 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 09:02:12 +00:00
Wouter Wijngaards 205f6d1afc also detect and use header and lib for setusercontext.
git-svn-id: file:///svn/unbound/trunk@1475 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 08:37:30 +00:00
Wouter Wijngaards cf64f7ae9e use setusercontext(3).
git-svn-id: file:///svn/unbound/trunk@1474 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-12 08:06:47 +00:00
Wouter Wijngaards 5f6eb6d58e dump_requestlist feature.
git-svn-id: file:///svn/unbound/trunk@1473 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-10 15:11:54 +00:00
Wouter Wijngaards 5c0e815e73 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1472 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-10 13:13:17 +00:00
Wouter Wijngaards b182b66e0e Do not validate with revoked keys.
git-svn-id: file:///svn/unbound/trunk@1471 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-10 13:01:38 +00:00
Wouter Wijngaards b58159d34b nicer text, TODO
git-svn-id: file:///svn/unbound/trunk@1470 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 15:16:13 +00:00
Wouter Wijngaards 36b3f6e254 bugzilla 231: print option from config file. Useful for scripting.
git-svn-id: file:///svn/unbound/trunk@1469 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 15:15:15 +00:00
Wouter Wijngaards e00e0ddd2f event_base_new() is used if available.
git-svn-id: file:///svn/unbound/trunk@1468 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 13:42:50 +00:00
Wouter Wijngaards e0a3873245 neater code
git-svn-id: file:///svn/unbound/trunk@1467 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 12:56:45 +00:00
Wouter Wijngaards 81d095149c nicer text, TODO removed
git-svn-id: file:///svn/unbound/trunk@1466 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 12:52:56 +00:00
Wouter Wijngaards 63d3cb7ff4 log-time-ascii option
git-svn-id: file:///svn/unbound/trunk@1465 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 12:51:45 +00:00
Wouter Wijngaards 0007337afe better desc.
git-svn-id: file:///svn/unbound/trunk@1464 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 11:23:43 +00:00
Wouter Wijngaards c53328dd07 fix cancel test more.
git-svn-id: file:///svn/unbound/trunk@1463 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 10:49:09 +00:00
Wouter Wijngaards cb925371ef fixup lexer.
git-svn-id: file:///svn/unbound/trunk@1462 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 10:45:40 +00:00
Wouter Wijngaards fb436db87a log querier on verbosity 5 or higher.
git-svn-id: file:///svn/unbound/trunk@1461 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 10:37:20 +00:00
Wouter Wijngaards 2b873f1b57 - config parser changed. Gives some syntax errors closer to where they
occurred. Does not enforce a space after keyword anymore.
  Does not allow literal newlines inside quoted strings anymore.



git-svn-id: file:///svn/unbound/trunk@1460 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 10:19:16 +00:00
Wouter Wijngaards 2705aaaad9 Nicer error for typo in include directive.
git-svn-id: file:///svn/unbound/trunk@1459 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 08:53:00 +00:00
Wouter Wijngaards 00fe7f1b87 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1458 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 06:56:08 +00:00
Wouter Wijngaards a63515ba51 new spec file from Paul.
git-svn-id: file:///svn/unbound/trunk@1457 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-06 06:46:57 +00:00
Wouter Wijngaards 46a9e9cba4 testbound test for older fix added.
git-svn-id: file:///svn/unbound/trunk@1456 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-05 14:31:16 +00:00
Wouter Wijngaards b22145d504 use daemon(3).
git-svn-id: file:///svn/unbound/trunk@1455 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-05 14:23:24 +00:00
Wouter Wijngaards 6e0d34659b option to force builtin ldns version.
git-svn-id: file:///svn/unbound/trunk@1454 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-05 14:01:37 +00:00
Wouter Wijngaards 80fa6c037a call initgroups.
git-svn-id: file:///svn/unbound/trunk@1453 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-05 11:12:01 +00:00
Wouter Wijngaards af9c45effc Cleaner output from configure on macOSX Leopard.
git-svn-id: file:///svn/unbound/trunk@1452 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-05 10:38:34 +00:00
Wouter Wijngaards 78600ddee1 Fixup race condition in ub_cancel. For 1.3.0.
git-svn-id: file:///svn/unbound/trunk@1451 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-05 09:48:02 +00:00
Wouter Wijngaards dfcbd8cb48 ldns 1.5.0 tarball (release candidate).
git-svn-id: file:///svn/unbound/trunk@1450 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-05 09:15:31 +00:00
Wouter Wijngaards b59ec4d4d3 trunk is 1.3.0 in development.
git-svn-id: file:///svn/unbound/trunk@1449 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-04 13:49:23 +00:00
Wouter Wijngaards eb408dcbc8 tag 1.2.1
git-svn-id: file:///svn/unbound/trunk@1448 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-04 13:34:34 +00:00
Wouter Wijngaards 87603429a1 fixup changelog
git-svn-id: file:///svn/unbound/trunk@1447 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-03 15:42:07 +00:00
Wouter Wijngaards cc6375e909 IANA portlist updated.
git-svn-id: file:///svn/unbound/trunk@1446 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-03 10:06:02 +00:00
Wouter Wijngaards d1e812a4af - noted feature requests in doc/TODO.
- printout more detailed errors on ssl certificate loading failures.



git-svn-id: file:///svn/unbound/trunk@1445 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-02-03 09:55:35 +00:00
Wouter Wijngaards 7ac31bc1d5 - unbound-host -4 and -6 options. Stops annoying ipv6 errors when
debugging with unbound -4 -d ... 
        - more cycle detection for NS-check, addr-check, root-prime and
          stub-prime queries in the iterator.  Avoids possible deadlock
          when priming fails.


git-svn-id: file:///svn/unbound/trunk@1444 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-16 10:38:19 +00:00
Wouter Wijngaards 37c3bef544 Squelch ipv6 network unreachable from verbosity default (1).
git-svn-id: file:///svn/unbound/trunk@1443 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-16 09:48:40 +00:00
Wouter Wijngaards 7ca106cc8c updated testset for recent changes
git-svn-id: file:///svn/unbound/trunk@1442 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-15 13:49:42 +00:00
Wouter Wijngaards 45abfa8720 fix libevent-1.3 and older bug
git-svn-id: file:///svn/unbound/trunk@1441 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-15 13:48:03 +00:00
Wouter Wijngaards ce2067ec6b spurious ;
git-svn-id: file:///svn/unbound/trunk@1440 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-15 10:49:19 +00:00
Wouter Wijngaards 0b04be414e sun cc warnings
git-svn-id: file:///svn/unbound/trunk@1439 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-15 10:34:18 +00:00
Wouter Wijngaards c90fd40a5e fixes for suncc warnings
git-svn-id: file:///svn/unbound/trunk@1438 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-15 10:29:17 +00:00
Wouter Wijngaards bea2b17277 solaris suncc compiler configure changes.
git-svn-id: file:///svn/unbound/trunk@1437 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-15 10:18:50 +00:00
Wouter Wijngaards dee84257a1 honor make QUIET=no
git-svn-id: file:///svn/unbound/trunk@1436 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-14 15:49:05 +00:00
Wouter Wijngaards b33f5f66ec remove debug prints
git-svn-id: file:///svn/unbound/trunk@1435 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-14 14:41:41 +00:00
Wouter Wijngaards a46c9197c4 EDNS fallback fixed for error cache.
git-svn-id: file:///svn/unbound/trunk@1434 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-14 09:56:41 +00:00
Wouter Wijngaards bfc64ade3c please lint.
git-svn-id: file:///svn/unbound/trunk@1433 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-14 09:47:00 +00:00
Wouter Wijngaards 900142fb79 - 1.2.1 feature: negative caching for failed queries.
Queries that failed are cached for 5 seconds (NORR_TTL).
	  If the failure is local, like out of memory, it is not cached.
	- the TTL comparison for the cache used different comparisons,
	  causing many cache responses that used the iterator and validator
	  state machines unnecessarily.



git-svn-id: file:///svn/unbound/trunk@1432 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-14 09:38:15 +00:00
Wouter Wijngaards 5aa65f431b 1.2.1 feature: stop AAAA queries that are not needed.
git-svn-id: file:///svn/unbound/trunk@1431 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-13 15:57:42 +00:00
Wouter Wijngaards f8655d2f5b note thanks
git-svn-id: file:///svn/unbound/trunk@1430 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-13 14:03:50 +00:00
Wouter Wijngaards a3ff369cfd Fixup for previous fixup.
git-svn-id: file:///svn/unbound/trunk@1429 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-13 12:53:18 +00:00
Wouter Wijngaards c76429ab57 Fixup for qtype NS.
git-svn-id: file:///svn/unbound/trunk@1428 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-13 12:45:02 +00:00
Wouter Wijngaards 0a9116f856 fix bug
git-svn-id: file:///svn/unbound/trunk@1426 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-13 10:44:04 +00:00
Wouter Wijngaards 9f4a9249c6 lameness debugging.
fix for lameness hashing.


git-svn-id: file:///svn/unbound/trunk@1425 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-12 09:22:39 +00:00
Wouter Wijngaards 8b860e8f12 removed debug print.
git-svn-id: file:///svn/unbound/trunk@1424 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-09 15:17:39 +00:00
Wouter Wijngaards c41e1a09ab iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1423 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-09 14:01:35 +00:00
Wouter Wijngaards 59c1ec5a95 1.2.1 version number in trunk.
git-svn-id: file:///svn/unbound/trunk@1422 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-09 10:49:47 +00:00
Wouter Wijngaards 0b39c4232f Tag for 1.2.0 release.
git-svn-id: file:///svn/unbound/trunk@1421 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-09 10:48:34 +00:00
Wouter Wijngaards bcb13a174b remove possible race condition
git-svn-id: file:///svn/unbound/trunk@1420 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-08 16:51:44 +00:00
Wouter Wijngaards d525f6ab69 slightly tighter timeouts.
git-svn-id: file:///svn/unbound/trunk@1419 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-08 15:58:35 +00:00
Wouter Wijngaards f89c4c4774 ldns updated - fixup
git-svn-id: file:///svn/unbound/trunk@1418 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-08 09:30:54 +00:00
Wouter Wijngaards 5326670faf ldns updated
git-svn-id: file:///svn/unbound/trunk@1417 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-08 09:21:57 +00:00
Wouter Wijngaards 244a09bfa3 type fixup
git-svn-id: file:///svn/unbound/trunk@1416 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-07 14:30:43 +00:00
Wouter Wijngaards 2b7969bc84 unused param fix
git-svn-id: file:///svn/unbound/trunk@1415 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-07 14:29:21 +00:00
Wouter Wijngaards f3d116387d typo fix and iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1414 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-07 14:05:09 +00:00
Wouter Wijngaards e6c5255466 Wildcard support (from patch by Paul Wouters).
git-svn-id: file:///svn/unbound/trunk@1413 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-07 12:24:34 +00:00
Wouter Wijngaards 6e9d214816 fixup libunbound message buffer.
git-svn-id: file:///svn/unbound/trunk@1412 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-06 17:50:56 +00:00
Wouter Wijngaards c1ae463da5 chrooted include file fix
git-svn-id: file:///svn/unbound/trunk@1411 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-06 15:47:15 +00:00
Wouter Wijngaards 865852d3f7 HINFO not downcased any more
git-svn-id: file:///svn/unbound/trunk@1410 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-06 14:49:26 +00:00
Wouter Wijngaards 4eb2bdf2b1 fixup transparent zone answers.
git-svn-id: file:///svn/unbound/trunk@1409 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-06 13:51:12 +00:00
Wouter Wijngaards 062ad0eb69 test for HINFO.
git-svn-id: file:///svn/unbound/trunk@1408 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-06 11:31:21 +00:00
Wouter Wijngaards ca89f7290c Fixup assertion failure for certain malformed packets.
git-svn-id: file:///svn/unbound/trunk@1407 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-06 10:00:28 +00:00
Wouter Wijngaards 33ae9fd843 - added L.ROOT-SERVERS.NET. AAAA 2001:500:3::42 to builtin root hints.
- fixup so it works with libev-3.51 from http://dist.schmorp.de/libev/
- comm_timer_set performs base_set operation after event_add.



git-svn-id: file:///svn/unbound/trunk@1406 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-05 15:05:33 +00:00
Wouter Wijngaards 4c76f1c003 fixup getaddrinfo failure handling reported by Matthijs.
git-svn-id: file:///svn/unbound/trunk@1405 be551aaa-1e26-0410-a405-d3ace91eadb9
2009-01-05 08:30:25 +00:00
Wouter Wijngaards ccdc0e3c53 fixup unit test for BSD changes to infra storage.
git-svn-id: file:///svn/unbound/trunk@1404 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-18 14:44:15 +00:00
Wouter Wijngaards 9cb69874f6 fixup reopen of syslog to avoid dev/log dependency and log missing after HUP.
git-svn-id: file:///svn/unbound/trunk@1403 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-18 14:36:58 +00:00
Wouter Wijngaards 12aae4fd6f makedist snapshot name fix.
git-svn-id: file:///svn/unbound/trunk@1402 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-18 14:20:11 +00:00
Wouter Wijngaards 1bdf2b2b6a Fixup BSD port.
git-svn-id: file:///svn/unbound/trunk@1401 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-18 14:11:34 +00:00
Wouter Wijngaards 159c7e4d6c more verbose about server selection.
git-svn-id: file:///svn/unbound/trunk@1400 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-18 11:27:57 +00:00
Wouter Wijngaards 38d57b0f80 DLV unit test ldns tarball update
rc underscore removed.


git-svn-id: file:///svn/unbound/trunk@1399 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-18 10:56:18 +00:00
Wouter Wijngaards 666b066bf6 fixup for DLV lookup higher NSEC examination bug.
git-svn-id: file:///svn/unbound/trunk@1398 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-18 10:14:30 +00:00
Wouter Wijngaards d714dfe8d8 ipv6 counter in extended statistics.
git-svn-id: file:///svn/unbound/trunk@1397 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-17 14:50:03 +00:00
Wouter Wijngaards 340a6185d2 done.
git-svn-id: file:///svn/unbound/trunk@1396 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-17 14:04:06 +00:00
Wouter Wijngaards d00c045084 unbound-control status command.
git-svn-id: file:///svn/unbound/trunk@1395 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-17 14:03:49 +00:00
Wouter Wijngaards d090698555 removed doubles
git-svn-id: file:///svn/unbound/trunk@1394 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-17 12:31:12 +00:00
Wouter Wijngaards 11f61b6b26 done.
git-svn-id: file:///svn/unbound/trunk@1393 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-17 12:29:10 +00:00
Wouter Wijngaards 4b00c5f76b key cache TTL is taken from RRset ttl which is already capped at max-ttl.
git-svn-id: file:///svn/unbound/trunk@1392 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-17 12:28:43 +00:00
Wouter Wijngaards 31ffc5a6a9 follows ldns makedist.sh changes for maintainer releases.
git-svn-id: file:///svn/unbound/trunk@1391 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-17 11:48:19 +00:00
Wouter Wijngaards aa1b565b41 underscore for version number postfix.
git-svn-id: file:///svn/unbound/trunk@1390 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-16 16:02:33 +00:00
Wouter Wijngaards 3d3b875a70 makedist prerelease feature.
git-svn-id: file:///svn/unbound/trunk@1389 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-16 15:30:47 +00:00
Wouter Wijngaards 3d42b1fffa TODO items.
git-svn-id: file:///svn/unbound/trunk@1388 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-16 14:27:24 +00:00
Wouter Wijngaards 3e8ccb027f please doxygen
git-svn-id: file:///svn/unbound/trunk@1387 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-11 08:59:45 +00:00
Wouter Wijngaards 05643589cf better #219 fix.
git-svn-id: file:///svn/unbound/trunk@1386 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-11 08:14:22 +00:00
Wouter Wijngaards b616c4f833 iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1385 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-09 09:37:43 +00:00
Wouter Wijngaards cb4985f527 fix bug 221.
git-svn-id: file:///svn/unbound/trunk@1384 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-09 09:28:39 +00:00
Wouter Wijngaards 098f932df8 todo
git-svn-id: file:///svn/unbound/trunk@1383 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-03 16:12:46 +00:00
Wouter Wijngaards 4ac7881829 fixup remote control so most commands work in nonthreaded environment.
git-svn-id: file:///svn/unbound/trunk@1382 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-03 15:20:56 +00:00
Wouter Wijngaards bcf49eaf96 Added test.
git-svn-id: file:///svn/unbound/trunk@1381 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-03 14:07:08 +00:00
Wouter Wijngaards 9e96c6e3aa Fix bug reported by Jaco with non-threaded unbound and statistics.
iana portlist updated.



git-svn-id: file:///svn/unbound/trunk@1380 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-03 13:52:00 +00:00
Wouter Wijngaards 9a9f012352 SElinux policy files.
git-svn-id: file:///svn/unbound/trunk@1379 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-12-01 08:20:03 +00:00
Wouter Wijngaards 386ff5debe Fixup when all servers for a zone are offline.
git-svn-id: file:///svn/unbound/trunk@1378 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-26 09:46:31 +00:00
Wouter Wijngaards d7ee842525 root hints checks dig.
git-svn-id: file:///svn/unbound/trunk@1377 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-25 15:18:54 +00:00
Wouter Wijngaards ea1f00ebad Skip unsupported tests. Fixup streamtcp for more portability.
git-svn-id: file:///svn/unbound/trunk@1376 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-25 14:17:14 +00:00
Wouter Wijngaards b1ed30d5f4 fix bug #220, complain without-ssl.
git-svn-id: file:///svn/unbound/trunk@1375 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-25 08:11:46 +00:00
Wouter Wijngaards aa0f26e3fa freebsd job control for test.
git-svn-id: file:///svn/unbound/trunk@1374 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-24 15:35:00 +00:00
Wouter Wijngaards 9e21fb7fac testset port to vista/mingw.
git-svn-id: file:///svn/unbound/trunk@1373 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-24 15:05:33 +00:00
Wouter Wijngaards 8b919a3780 Updated documentation for key user privileges.
git-svn-id: file:///svn/unbound/trunk@1372 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-24 10:55:14 +00:00
Wouter Wijngaards 32f6afbb48 remove permissions from others.
git-svn-id: file:///svn/unbound/trunk@1371 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-21 18:41:10 +00:00
Wouter Wijngaards 576fe7d4c8 accept errors not printed any more.
git-svn-id: file:///svn/unbound/trunk@1370 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-21 09:15:44 +00:00
Wouter Wijngaards 27f450e8fa trunk is 1.1.2
git-svn-id: file:///svn/unbound/trunk@1369 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-20 14:28:56 +00:00
Wouter Wijngaards ecad71c519 Tag 1.1.1
git-svn-id: file:///svn/unbound/trunk@1368 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-20 14:26:56 +00:00
Wouter Wijngaards 8726449421 changelog
git-svn-id: file:///svn/unbound/trunk@1367 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-20 09:49:35 +00:00
Wouter Wijngaards fcf7df71d6 nicer comments
git-svn-id: file:///svn/unbound/trunk@1366 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-20 09:48:36 +00:00
Wouter Wijngaards 4ea644f5a2 rlimit formula
git-svn-id: file:///svn/unbound/trunk@1365 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-20 09:20:10 +00:00
Wouter Wijngaards e25608d1be fixup tcp accept.
git-svn-id: file:///svn/unbound/trunk@1364 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-20 08:06:05 +00:00
Wouter Wijngaards d1b2324429 fix bug #219.
git-svn-id: file:///svn/unbound/trunk@1363 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-19 16:05:23 +00:00
Wouter Wijngaards be6bbb470a grammar
git-svn-id: file:///svn/unbound/trunk@1362 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-18 13:40:38 +00:00
Wouter Wijngaards 59e74885b7 make clean nicer
git-svn-id: file:///svn/unbound/trunk@1361 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-18 13:30:41 +00:00
Wouter Wijngaards 2b6c544f69 1.1.1
git-svn-id: file:///svn/unbound/trunk@1360 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-18 12:38:08 +00:00
Wouter Wijngaards 632234b5e4 1.1.0 number.
git-svn-id: file:///svn/unbound/trunk@1357 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-18 12:22:07 +00:00
Wouter Wijngaards 8bc54c4380 port to 64bit.
git-svn-id: file:///svn/unbound/trunk@1356 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-18 09:14:24 +00:00
Wouter Wijngaards bbbbb3c533 iana updated
git-svn-id: file:///svn/unbound/trunk@1355 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-18 09:01:24 +00:00
Wouter Wijngaards 75cf6d0f86 better comment svn:NO TEST
git-svn-id: file:///svn/unbound/trunk@1354 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-17 14:19:05 +00:00
Wouter Wijngaards c653b8424b Fixup for problems with do-ip6: no and only ipv6 addresses.
git-svn-id: file:///svn/unbound/trunk@1353 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-17 12:47:34 +00:00
Wouter Wijngaards 9548455690 1.1.1 in svn trunk.
git-svn-id: file:///svn/unbound/trunk@1352 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-14 06:30:34 +00:00
Wouter Wijngaards bbf446f1a1 Created 1.1.0 release tag.
git-svn-id: file:///svn/unbound/trunk@1351 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-14 06:28:14 +00:00
Wouter Wijngaards 9fa2964d95 review comments.
git-svn-id: file:///svn/unbound/trunk@1350 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-13 13:45:27 +00:00
Wouter Wijngaards d0eb5cad47 silence host is down error, which the resolver operator cannot do anything
about.  Verbosity 2 shows it for debugging of course.



git-svn-id: file:///svn/unbound/trunk@1349 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-13 13:24:36 +00:00
Wouter Wijngaards e9d742c16d doc update for plans and done items
git-svn-id: file:///svn/unbound/trunk@1348 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-13 11:50:56 +00:00
Wouter Wijngaards 2547a0a9bb neater comments
git-svn-id: file:///svn/unbound/trunk@1347 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-13 10:19:14 +00:00
Wouter Wijngaards 3bdd807610 ldns version check added.
git-svn-id: file:///svn/unbound/trunk@1346 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-13 09:26:02 +00:00
Wouter Wijngaards 7fc590cda5 Fedora package files for 1.1.0, by Paul Wouters.
git-svn-id: file:///svn/unbound/trunk@1345 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-13 08:45:20 +00:00
Wouter Wijngaards 9525cdb01b add unbound-control manpage to makedist replace list.
git-svn-id: file:///svn/unbound/trunk@1344 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-12 09:20:35 +00:00
Wouter Wijngaards 21a64ef247 fixup wrap around for very large mem usage on printout.
git-svn-id: file:///svn/unbound/trunk@1343 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-11 13:47:25 +00:00
Wouter Wijngaards 5cfd778608 - unit test for negative cache, stress tests the refcounting.
- fix for refcounting error that could cause fptr_wlist fatal exit
	  in the negative cache rbtree (upcoming 1.1 feature). (Thanks to 
	  Attila Nagy for testing).
	- nicer comments in cachedump about failed RR to string conversion.


git-svn-id: file:///svn/unbound/trunk@1342 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-11 11:54:06 +00:00
Wouter Wijngaards 3973cd8f26 Fixup getaddrinfo compat.
git-svn-id: file:///svn/unbound/trunk@1341 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-10 08:04:22 +00:00
Wouter Wijngaards c12bf8692c used autoconf 2.61
git-svn-id: file:///svn/unbound/trunk@1340 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-08 10:49:16 +00:00
Wouter Wijngaards 327e1f4b10 Fixup eee build.
git-svn-id: file:///svn/unbound/trunk@1339 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-08 10:05:39 +00:00
Wouter Wijngaards 847107403f detect nonblocking broken.
git-svn-id: file:///svn/unbound/trunk@1338 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-07 14:28:06 +00:00
Wouter Wijngaards d469081eda Fixup warning on FreeBSD (hopefully).
git-svn-id: file:///svn/unbound/trunk@1337 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-07 09:35:25 +00:00
Wouter Wijngaards 345e5e82d3 Fix bug #217
git-svn-id: file:///svn/unbound/trunk@1336 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-07 09:24:39 +00:00
Wouter Wijngaards c6541a2def iana portlist updated.
doxygen comments better.



git-svn-id: file:///svn/unbound/trunk@1335 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-06 11:12:25 +00:00
Wouter Wijngaards 3708097870 Fixup decompression for private-name checks.
git-svn-id: file:///svn/unbound/trunk@1334 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-06 10:59:31 +00:00
Wouter Wijngaards 69af0f10e9 Elusive bad-file-descriptor error caught.
git-svn-id: file:///svn/unbound/trunk@1333 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-05 14:56:49 +00:00
Wouter Wijngaards 747dc4e3ab please lint.
git-svn-id: file:///svn/unbound/trunk@1332 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-05 10:50:43 +00:00
Wouter Wijngaards 6c7416128c fixup memleaks.
git-svn-id: file:///svn/unbound/trunk@1331 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-05 10:38:22 +00:00
Wouter Wijngaards 515b892024 write-strings warnings fixed.
git-svn-id: file:///svn/unbound/trunk@1330 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-04 14:53:50 +00:00
Wouter Wijngaards 3af6fd7980 Key algo RSASHA512.
git-svn-id: file:///svn/unbound/trunk@1329 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-04 07:50:38 +00:00
Wouter Wijngaards 0d01be50bc detection of sha256 and sha512 by testing if functionality was compiled
into openssl.


git-svn-id: file:///svn/unbound/trunk@1328 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-03 16:06:12 +00:00
Wouter Wijngaards 8a32f9003b - RSASHA256_NSEC3 and RSASHA512_NSEC3 algos are supported.
- updated ldns tarball (with those algos).



git-svn-id: file:///svn/unbound/trunk@1327 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-03 15:42:07 +00:00
Wouter Wijngaards 7bf176eeba Fixup static linking with libssl.
git-svn-id: file:///svn/unbound/trunk@1326 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-03 15:09:37 +00:00
Wouter Wijngaards c6af78bfd3 portlist updated.
git-svn-id: file:///svn/unbound/trunk@1325 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-03 14:47:50 +00:00
Wouter Wijngaards 8eb31df3d0 Created configure with autoconf 2.61
git-svn-id: file:///svn/unbound/trunk@1324 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-03 14:40:47 +00:00
Wouter Wijngaards 7176710b7f Fixup b32 compat for Mac OSX linker.
git-svn-id: file:///svn/unbound/trunk@1323 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-11-03 14:38:03 +00:00
Wouter Wijngaards 1b1694a959 More verbose on signer name error.
git-svn-id: file:///svn/unbound/trunk@1322 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-23 10:54:03 +00:00
Wouter Wijngaards 6cebdd2baf unwanted reply threshold like in the draft.
git-svn-id: file:///svn/unbound/trunk@1321 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-22 14:36:46 +00:00
Wouter Wijngaards 60d8b26ba1 root-hints check automated.
git-svn-id: file:///svn/unbound/trunk@1320 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-22 13:40:21 +00:00
Wouter Wijngaards 83a017d3d1 stub-prime option.
git-svn-id: file:///svn/unbound/trunk@1319 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-22 12:01:40 +00:00
Wouter Wijngaards 18b09fe9c1 ldns update.
iana update.



git-svn-id: file:///svn/unbound/trunk@1318 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-22 09:05:29 +00:00
Wouter Wijngaards f59b1a96b1 Fixup Cflags detection in configure.
git-svn-id: file:///svn/unbound/trunk@1317 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-22 07:40:37 +00:00
Wouter Wijngaards 8fb41f5c00 ported 1.1 to windows.
git-svn-id: file:///svn/unbound/trunk@1316 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-21 13:00:07 +00:00
Wouter Wijngaards 64959c8097 fixup update anchors to sort keys.
git-svn-id: file:///svn/unbound/trunk@1315 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-21 09:02:34 +00:00
Wouter Wijngaards 2a6846f30c fixup unbound control compilation on windows.
git-svn-id: file:///svn/unbound/trunk@1314 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-20 15:41:12 +00:00
Wouter Wijngaards 00f301d35f Ask more nameservers if choice is limited.
Lowered bogus-ttl to help validation-failure recovery times.



git-svn-id: file:///svn/unbound/trunk@1313 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-20 14:24:35 +00:00
Wouter Wijngaards f4ad52dffd Do not query bogus name servers.
git-svn-id: file:///svn/unbound/trunk@1312 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-20 13:51:47 +00:00
Wouter Wijngaards a50b796a40 iana portlist updated
git-svn-id: file:///svn/unbound/trunk@1311 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-20 09:28:09 +00:00
Wouter Wijngaards e5c52a7032 less log
git-svn-id: file:///svn/unbound/trunk@1310 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-20 09:11:17 +00:00
Wouter Wijngaards a0d9d48d8f root prime validation
git-svn-id: file:///svn/unbound/trunk@1309 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-17 15:07:28 +00:00
Wouter Wijngaards 1275afa125 please ranlib
git-svn-id: file:///svn/unbound/trunk@1308 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-17 09:19:37 +00:00
Wouter Wijngaards 371b9f08ef typefix
git-svn-id: file:///svn/unbound/trunk@1307 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-17 09:10:24 +00:00
Wouter Wijngaards 265c199445 Fixup negative TTLs Attila Nagy has reported.
git-svn-id: file:///svn/unbound/trunk@1306 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-16 13:12:32 +00:00
Wouter Wijngaards bf659c8362 Referral path checking, for spoof mitigation, improved.
git-svn-id: file:///svn/unbound/trunk@1305 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-15 13:32:49 +00:00
Wouter Wijngaards 3dc4715109 doc updates
git-svn-id: file:///svn/unbound/trunk@1304 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-15 11:16:54 +00:00
Wouter Wijngaards b3dd2b5b98 more portable check for make/gmake in iana portlist update checker.
git-svn-id: file:///svn/unbound/trunk@1303 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-14 15:15:55 +00:00
Wouter Wijngaards 5a1e91af35 test fix.
git-svn-id: file:///svn/unbound/trunk@1302 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-14 09:20:10 +00:00
Wouter Wijngaards a21136cf66 fwd_three updated.
git-svn-id: file:///svn/unbound/trunk@1301 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-14 09:13:17 +00:00
Wouter Wijngaards ebb63767cd update ldns src tarball.
git-svn-id: file:///svn/unbound/trunk@1300 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-14 09:06:15 +00:00
Wouter Wijngaards 07efa0f4ea Fixup stub and ldns.
git-svn-id: file:///svn/unbound/trunk@1299 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-14 09:05:17 +00:00
Wouter Wijngaards 1b8d87e202 stub udp update.
git-svn-id: file:///svn/unbound/trunk@1298 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-14 08:33:15 +00:00
Wouter Wijngaards 1e37e00a27 Change test to be more reliable.
git-svn-id: file:///svn/unbound/trunk@1297 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-14 08:30:30 +00:00
Wouter Wijngaards 628c970ecc ldns_update
git-svn-id: file:///svn/unbound/trunk@1296 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-13 14:23:21 +00:00
Wouter Wijngaards f59885053a iana portlist update
git-svn-id: file:///svn/unbound/trunk@1295 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-13 09:25:03 +00:00
Wouter Wijngaards dbaa5194a6 Recursion lame is detected and last resort is used to resolve.
git-svn-id: file:///svn/unbound/trunk@1294 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-13 09:11:42 +00:00
Wouter Wijngaards 5b7a514119 fixup tests
git-svn-id: file:///svn/unbound/trunk@1293 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-10 08:04:38 +00:00
Wouter Wijngaards b6696c1342 nsec3 negative cache works.
git-svn-id: file:///svn/unbound/trunk@1292 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-09 15:06:35 +00:00
Wouter Wijngaards bfb4e20f43 max iterations for neg cache.
git-svn-id: file:///svn/unbound/trunk@1291 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-09 13:06:06 +00:00
Wouter Wijngaards c73c662fce work on nsec3 negative cache for qtype DS .
git-svn-id: file:///svn/unbound/trunk@1290 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-08 14:42:46 +00:00
Wouter Wijngaards 45afaf3e08 nsec negative DS.
git-svn-id: file:///svn/unbound/trunk@1289 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-08 10:04:27 +00:00
Wouter Wijngaards c04451cc58 working on negative DS
git-svn-id: file:///svn/unbound/trunk@1288 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-07 15:22:32 +00:00
Wouter Wijngaards 6d721dd6bd another test package
git-svn-id: file:///svn/unbound/trunk@1287 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-07 07:55:36 +00:00
Wouter Wijngaards 408a0cfd31 requirements update with design decisions.
git-svn-id: file:///svn/unbound/trunk@1286 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-06 15:07:27 +00:00
Wouter Wijngaards 939fabd809 0x20 fallback code.
git-svn-id: file:///svn/unbound/trunk@1285 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-06 14:46:22 +00:00
Wouter Wijngaards 3ddabf26f3 please_lint
git-svn-id: file:///svn/unbound/trunk@1284 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-06 10:38:07 +00:00
Wouter Wijngaards e2277ca9d1 please_lint
git-svn-id: file:///svn/unbound/trunk@1283 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-06 09:42:31 +00:00
Wouter Wijngaards 351ef6e252 Option for DOS protection on slower links.
git-svn-id: file:///svn/unbound/trunk@1282 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-06 09:28:50 +00:00
Wouter Wijngaards 620c85ee32 missing test file
git-svn-id: file:///svn/unbound/trunk@1281 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-02 09:39:02 +00:00
Wouter Wijngaards 7d242d400f Easier update script.
git-svn-id: file:///svn/unbound/trunk@1280 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-02 09:22:02 +00:00
Wouter Wijngaards cb659ab13b fixup SHA256 algorithm set routine
git-svn-id: file:///svn/unbound/trunk@1279 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-02 09:05:20 +00:00
Wouter Wijngaards 74909b66b4 fixup pidfile unlink.
git-svn-id: file:///svn/unbound/trunk@1278 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-10-02 08:47:21 +00:00
Wouter Wijngaards 896e4fea2a local data PTR shorthand.
git-svn-id: file:///svn/unbound/trunk@1277 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-30 15:04:32 +00:00
Wouter Wijngaards 3385bcc255 Stub on same host works
git-svn-id: file:///svn/unbound/trunk@1276 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-30 13:40:44 +00:00
Wouter Wijngaards 5e1193f19d SHA256 support.
git-svn-id: file:///svn/unbound/trunk@1275 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-30 13:06:07 +00:00
Wouter Wijngaards 2e5c620f2c doxygen, detect SHA256 support for test.
git-svn-id: file:///svn/unbound/trunk@1274 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-30 11:35:48 +00:00
Wouter Wijngaards 13a68aac89 Fix for SHA256 DS downgrade. And test of resistance.
git-svn-id: file:///svn/unbound/trunk@1273 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-30 10:42:02 +00:00
Wouter Wijngaards d4fadf55a8 EDNS fallback when timeout and multiple query rtt backoff.
git-svn-id: file:///svn/unbound/trunk@1272 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-29 14:50:35 +00:00
Wouter Wijngaards a2b261f8b2 portlist updated.
git-svn-id: file:///svn/unbound/trunk@1271 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-26 13:48:00 +00:00
Wouter Wijngaards 556d5407e2 remote control tests.
git-svn-id: file:///svn/unbound/trunk@1270 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-26 13:02:34 +00:00
Wouter Wijngaards 66dcc95a78 plan update.
git-svn-id: file:///svn/unbound/trunk@1269 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-23 14:10:49 +00:00
Wouter Wijngaards 16734a0e04 flush data from cache.
git-svn-id: file:///svn/unbound/trunk@1268 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-23 14:07:02 +00:00
Wouter Wijngaards 91138fc32a doxygen fixup.
git-svn-id: file:///svn/unbound/trunk@1267 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-23 11:47:09 +00:00
Wouter Wijngaards cfceb6487d lookup delegation from cache and printout.
git-svn-id: file:///svn/unbound/trunk@1266 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-23 10:55:36 +00:00
Wouter Wijngaards de0f903d37 load from cache works
git-svn-id: file:///svn/unbound/trunk@1265 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-23 09:23:38 +00:00
Wouter Wijngaards 67bec33e20 cache dump and load files
git-svn-id: file:///svn/unbound/trunk@1264 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-22 18:05:22 +00:00
Wouter Wijngaards 46e50e861f dump and load cache.
git-svn-id: file:///svn/unbound/trunk@1263 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-22 15:20:18 +00:00
Wouter Wijngaards b479dfd33d ldns update, test update.
git-svn-id: file:///svn/unbound/trunk@1262 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-19 15:24:30 +00:00
Wouter Wijngaards cf4b56d883 add remove local data and local zone with remote control
(ldns-testpkts sync with ldns trunk).


git-svn-id: file:///svn/unbound/trunk@1261 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-19 14:49:29 +00:00
Wouter Wijngaards c77be35670 qps for histogram.
git-svn-id: file:///svn/unbound/trunk@1260 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 14:55:13 +00:00
Wouter Wijngaards 763431c059 cache hits in histogram.
git-svn-id: file:///svn/unbound/trunk@1259 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 14:45:15 +00:00
Wouter Wijngaards 089261572a histogram support for stats.
git-svn-id: file:///svn/unbound/trunk@1258 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 14:37:20 +00:00
Wouter Wijngaards 055ebe3d0b better docs.
git-svn-id: file:///svn/unbound/trunk@1257 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 12:11:20 +00:00
Wouter Wijngaards 33bc592a83 spelling more.
git-svn-id: file:///svn/unbound/trunk@1256 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 11:54:04 +00:00
Wouter Wijngaards 076fb3bc53 spelling.
git-svn-id: file:///svn/unbound/trunk@1255 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 11:52:43 +00:00
Wouter Wijngaards 10316f091f more locking.
git-svn-id: file:///svn/unbound/trunk@1254 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 11:51:09 +00:00
Wouter Wijngaards a14c4fa6e5 locking for munin
git-svn-id: file:///svn/unbound/trunk@1253 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 11:49:09 +00:00
Wouter Wijngaards 9d6df1964b documentation.
git-svn-id: file:///svn/unbound/trunk@1252 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 09:44:37 +00:00
Wouter Wijngaards 897bb0c0e6 fixup test.
git-svn-id: file:///svn/unbound/trunk@1251 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 08:53:50 +00:00
Wouter Wijngaards 50b728aa08 upgrade lee value to working. nicer desc in munin plugin.
git-svn-id: file:///svn/unbound/trunk@1250 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 08:47:04 +00:00
Wouter Wijngaards 25c1232d22 nice names for high query types.
git-svn-id: file:///svn/unbound/trunk@1249 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 08:38:53 +00:00
Wouter Wijngaards 5814e0f5b6 better munin, iana update
git-svn-id: file:///svn/unbound/trunk@1248 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 08:13:41 +00:00
Wouter Wijngaards 3ca6d2e5a2 Fixup error in time calculation.
git-svn-id: file:///svn/unbound/trunk@1247 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-18 07:55:01 +00:00
Wouter Wijngaards d4151219a2 print uptime always.
git-svn-id: file:///svn/unbound/trunk@1246 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-17 16:45:32 +00:00
Wouter Wijngaards e0d36e6561 munin plugin first version.
git-svn-id: file:///svn/unbound/trunk@1245 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-17 15:34:48 +00:00
Wouter Wijngaards 7a1ba7785d rcode stat printout fixed.
git-svn-id: file:///svn/unbound/trunk@1244 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-17 11:33:40 +00:00
Wouter Wijngaards 370236cb65 testpkts const fixup.
git-svn-id: file:///svn/unbound/trunk@1243 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-17 08:16:17 +00:00
Wouter Wijngaards 91972c229d gen configure on linux. ldns tarball updated.
git-svn-id: file:///svn/unbound/trunk@1242 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-17 08:06:13 +00:00
Wouter Wijngaards 144978d633 b32 compat stuff.
git-svn-id: file:///svn/unbound/trunk@1241 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-17 08:00:14 +00:00
Wouter Wijngaards 62fc91f7f1 threadsafe rrset counter.
git-svn-id: file:///svn/unbound/trunk@1240 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-17 07:13:31 +00:00
Wouter Wijngaards 636f742ef0 extended statistics.
git-svn-id: file:///svn/unbound/trunk@1239 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-16 14:08:38 +00:00
Wouter Wijngaards f0b77ed022 extended stats option.
git-svn-id: file:///svn/unbound/trunk@1238 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-16 09:08:45 +00:00
Wouter Wijngaards 0b3c133dd3 verbosity and stats control.
git-svn-id: file:///svn/unbound/trunk@1237 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-15 14:19:41 +00:00
Wouter Wijngaards 757eff88f5 Test, exit value.
git-svn-id: file:///svn/unbound/trunk@1236 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-15 10:36:13 +00:00
Wouter Wijngaards 3137c88a43 start, stop, reload commands.
git-svn-id: file:///svn/unbound/trunk@1235 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-15 08:35:45 +00:00
Wouter Wijngaards 08e0563483 remote setup.
git-svn-id: file:///svn/unbound/trunk@1234 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-12 13:01:20 +00:00
Wouter Wijngaards 9157324788 proto spec.
git-svn-id: file:///svn/unbound/trunk@1233 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-12 12:09:00 +00:00
Wouter Wijngaards f918da13d2 neater.
git-svn-id: file:///svn/unbound/trunk@1232 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-11 14:56:46 +00:00
Wouter Wijngaards e8e30550df fixup.
git-svn-id: file:///svn/unbound/trunk@1231 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-11 14:55:50 +00:00
Wouter Wijngaards 5dbc854a48 Install of unbound-control-setup.
git-svn-id: file:///svn/unbound/trunk@1230 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-11 14:30:55 +00:00
Wouter Wijngaards af57e5163d control channel security.
git-svn-id: file:///svn/unbound/trunk@1229 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-11 14:14:12 +00:00
Wouter Wijngaards 56b91454ba doxygen fix.
git-svn-id: file:///svn/unbound/trunk@1228 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-10 15:43:09 +00:00
Wouter Wijngaards 121cb15d67 remote control setup, port binding and service.
git-svn-id: file:///svn/unbound/trunk@1227 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-10 15:23:01 +00:00
Wouter Wijngaards 265eedb0d3 certificate creation script.
git-svn-id: file:///svn/unbound/trunk@1226 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-09 14:15:55 +00:00
Wouter Wijngaards 26429c9457 refactored code.
git-svn-id: file:///svn/unbound/trunk@1225 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-04 14:29:05 +00:00
Wouter Wijngaards 72904a3366 private-addresses.
git-svn-id: file:///svn/unbound/trunk@1224 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-04 12:25:15 +00:00
Wouter Wijngaards ff1a7ec42e private address and private domain config option read and store.
git-svn-id: file:///svn/unbound/trunk@1223 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-03 14:40:09 +00:00
Wouter Wijngaards 05cd134de9 Do not mark additional section items bogus.
git-svn-id: file:///svn/unbound/trunk@1222 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-02 14:35:13 +00:00
Wouter Wijngaards 960da40475 DoS protection.
git-svn-id: file:///svn/unbound/trunk@1221 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-02 13:04:47 +00:00
Wouter Wijngaards 01cabbebc1 do not allow cache snooping by default.
git-svn-id: file:///svn/unbound/trunk@1220 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-09-01 13:48:24 +00:00
Wouter Wijngaards a66e16cb31 new NS queries is not an option (off by default).
git-svn-id: file:///svn/unbound/trunk@1219 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-29 14:46:08 +00:00
Wouter Wijngaards 49d295755d plan update svn:NO TEST
git-svn-id: file:///svn/unbound/trunk@1218 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-29 13:41:06 +00:00
Wouter Wijngaards b858018446 planning svn:NO TEST
git-svn-id: file:///svn/unbound/trunk@1217 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-29 12:32:57 +00:00
Wouter Wijngaards 71a535a6f2 iana port update
git-svn-id: file:///svn/unbound/trunk@1216 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-29 08:02:29 +00:00
Wouter Wijngaards 28a388b517 1.1
git-svn-id: file:///svn/unbound/trunk@1215 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-29 07:48:40 +00:00
Wouter Wijngaards 51d548563c logfile creation fixup.
git-svn-id: file:///svn/unbound/trunk@1214 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-28 09:02:48 +00:00
Wouter Wijngaards 21cd9936d8 dlv negative cache size option.
git-svn-id: file:///svn/unbound/trunk@1213 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-27 13:02:22 +00:00
Wouter Wijngaards e474ca2619 bug #199.
git-svn-id: file:///svn/unbound/trunk@1212 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-27 11:29:46 +00:00
Wouter Wijngaards f809bfa145 Remove daemon(3) usage.
git-svn-id: file:///svn/unbound/trunk@1211 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-27 06:17:55 +00:00
Wouter Wijngaards 4993c646e7 use daemon(3) if available.
git-svn-id: file:///svn/unbound/trunk@1210 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-26 12:47:26 +00:00
Wouter Wijngaards 53fed5315c Drop privileges more.
git-svn-id: file:///svn/unbound/trunk@1209 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-26 12:11:42 +00:00
Wouter Wijngaards 21895f6013 iana port update.
git-svn-id: file:///svn/unbound/trunk@1208 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-26 10:39:35 +00:00
Wouter Wijngaards 82ce090a35 Remove overreaching NSEC rrsets.
git-svn-id: file:///svn/unbound/trunk@1207 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-26 10:32:46 +00:00
Wouter Wijngaards fcbc34bd7f DLV tests.
git-svn-id: file:///svn/unbound/trunk@1206 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-26 10:13:31 +00:00
Wouter Wijngaards 0720031ce0 patch to make realclean more clean.
git-svn-id: file:///svn/unbound/trunk@1205 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-25 06:23:21 +00:00
Wouter Wijngaards 23db41c292 iana port update
git-svn-id: file:///svn/unbound/trunk@1204 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-22 10:25:27 +00:00
Wouter Wijngaards d60b281055 more test DLV.
git-svn-id: file:///svn/unbound/trunk@1203 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-22 10:06:14 +00:00
Wouter Wijngaards a7cfe2bf65 Test DLV anchor.
git-svn-id: file:///svn/unbound/trunk@1202 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-21 14:58:39 +00:00
Wouter Wijngaards d9cd60a41c iana portlist update.
git-svn-id: file:///svn/unbound/trunk@1201 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-21 12:05:57 +00:00
Wouter Wijngaards a39a7704af DLV negative cache works.
git-svn-id: file:///svn/unbound/trunk@1200 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-21 10:43:45 +00:00
Wouter Wijngaards a61d10f715 Negative cache code.
git-svn-id: file:///svn/unbound/trunk@1199 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-20 13:31:06 +00:00
Wouter Wijngaards a4e4f424d1 negative cache work for DLV
git-svn-id: file:///svn/unbound/trunk@1198 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-19 15:27:31 +00:00
Wouter Wijngaards bcec1a7593 negative cache design.
git-svn-id: file:///svn/unbound/trunk@1197 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-18 15:00:17 +00:00
Wouter Wijngaards 38396319c7 Patch from Pierre David.
git-svn-id: file:///svn/unbound/trunk@1196 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-18 11:38:37 +00:00
Wouter Wijngaards ee874fab01 please doxygen.
git-svn-id: file:///svn/unbound/trunk@1195 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-18 08:36:28 +00:00
Wouter Wijngaards 8cbb13f251 Better logfile classification for log_bug, log_hex and log_addr.
git-svn-id: file:///svn/unbound/trunk@1194 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-18 08:17:07 +00:00
Wouter Wijngaards 87fe8871b0 doxygen.
git-svn-id: file:///svn/unbound/trunk@1193 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-15 14:00:08 +00:00
Wouter Wijngaards 55f7bbc051 negative cache design.
git-svn-id: file:///svn/unbound/trunk@1192 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-15 13:31:16 +00:00
Wouter Wijngaards 8e39c9c1cb basic DLV works.
iana port update.



git-svn-id: file:///svn/unbound/trunk@1191 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-15 10:55:09 +00:00
Wouter Wijngaards 7549bddfda DLV work
git-svn-id: file:///svn/unbound/trunk@1190 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-14 15:16:50 +00:00
Wouter Wijngaards 44f5800da9 proper handling of empty files and neater code.
git-svn-id: file:///svn/unbound/trunk@1189 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-13 15:18:39 +00:00
Wouter Wijngaards 4cf4659a1d dlv anchor file and chroot.
git-svn-id: file:///svn/unbound/trunk@1188 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-13 14:46:33 +00:00
Wouter Wijngaards 080d9d6540 - ldns snapshot r2699 taken (includes DLV type).
- DLV work, config file element, trust anchor read in.



git-svn-id: file:///svn/unbound/trunk@1187 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-13 14:30:35 +00:00
Wouter Wijngaards 77b79fde5d bug fixes 203, 204, 206.
git-svn-id: file:///svn/unbound/trunk@1186 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-13 07:11:42 +00:00
Wouter Wijngaards 1e4e8cb68a - Fixup rrset security updates overwriting 2181 trust status.
This makes validated to be insecure data just as worthless as
	  nonvalidated data, and 2181 rules prevent cache overwrites to them.
	- Fix assertion fail on bogus key handling.
	- dnssec lameness detection works on first query at trust apex.
	- NS queries get proper cache and dnssec lameness treatment.
	- fixup compilation without pthreads on linux.
	- NS queries are done after every referral.
	  validator is used on those NS records (if anchors enabled).




git-svn-id: file:///svn/unbound/trunk@1185 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-12 10:13:57 +00:00
Wouter Wijngaards 0d8ce6f075 more fixup pthreads compile.
git-svn-id: file:///svn/unbound/trunk@1184 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-11 14:02:37 +00:00
Wouter Wijngaards 23ac4b02e3 Fixup compilation without pthreads.
git-svn-id: file:///svn/unbound/trunk@1183 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-11 13:58:33 +00:00
Wouter Wijngaards 8b93a85a7d Porting of update-anchor script.
git-svn-id: file:///svn/unbound/trunk@1182 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-07 13:52:36 +00:00
Wouter Wijngaards 4fe0d98ff4 Same scrubber patch to trunk.
git-svn-id: file:///svn/unbound/trunk@1181 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-07 07:31:05 +00:00
Wouter Wijngaards a30026a7d8 iana port update.
git-svn-id: file:///svn/unbound/trunk@1178 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-05 11:39:32 +00:00
Wouter Wijngaards 9d068a12f5 fixup DS test for apex validation of NODATA.
git-svn-id: file:///svn/unbound/trunk@1177 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-05 10:54:27 +00:00
Wouter Wijngaards 144d35120c manpage fixup. TODO cleanup.
git-svn-id: file:///svn/unbound/trunk@1176 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-04 13:08:08 +00:00
Wouter Wijngaards 014cc821ba Fix bug #201
git-svn-id: file:///svn/unbound/trunk@1173 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-04 12:15:12 +00:00
Wouter Wijngaards 428524a8c8 Iana port list updated.
git-svn-id: file:///svn/unbound/trunk@1172 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-04 08:46:28 +00:00
Wouter Wijngaards 2d49dd1494 TODO for 1.1
git-svn-id: file:///svn/unbound/trunk@1171 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-08-04 08:30:49 +00:00
Wouter Wijngaards 995b01a9b7 bugfix to DS qtype from client.
git-svn-id: file:///svn/unbound/trunk@1170 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-30 21:38:37 +00:00
Wouter Wijngaards 665a98e47b print openssl version.
git-svn-id: file:///svn/unbound/trunk@1168 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-25 11:33:31 +00:00
Wouter Wijngaards fe106d38b2 remove socketpair compat.
git-svn-id: file:///svn/unbound/trunk@1167 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-25 09:33:14 +00:00
Wouter Wijngaards 75ac5e0fe0 make pipe work with fallback on windows.
git-svn-id: file:///svn/unbound/trunk@1166 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-25 09:26:15 +00:00
Wouter Wijngaards d452ba59b5 Added copyright statement from OpenBSD authors.
git-svn-id: file:///svn/unbound/trunk@1165 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-25 05:32:52 +00:00
Wouter Wijngaards c2c5b5522c windows tube functionality writeup.
git-svn-id: file:///svn/unbound/trunk@1164 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-23 15:19:18 +00:00
Wouter Wijngaards 34d75b1994 - moved pipe actions to util/tube.c. easier porting and shared code.
- check _raw() commpoint callbacks with fptr_wlist.
- iana port update.


git-svn-id: file:///svn/unbound/trunk@1163 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-23 09:23:03 +00:00
Wouter Wijngaards b61f24e8d3 #198 bug fixups.
git-svn-id: file:///svn/unbound/trunk@1162 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-21 07:59:29 +00:00
Wouter Wijngaards 072142cfa2 #198 fix.
git-svn-id: file:///svn/unbound/trunk@1161 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-19 15:34:57 +00:00
Wouter Wijngaards afe9b3e83c please doxygen, fixup fake func prototypes and make typedef more portable.
git-svn-id: file:///svn/unbound/trunk@1160 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-18 15:29:33 +00:00
Wouter Wijngaards e4ef5a6156 tube work for mingw port.
git-svn-id: file:///svn/unbound/trunk@1159 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-18 15:06:59 +00:00
Wouter Wijngaards ad041b9b8e branch for 1.0 support
git-svn-id: file:///svn/unbound/trunk@1158 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-18 13:00:57 +00:00
Wouter Wijngaards 45dd63d7c8 TODO request.
git-svn-id: file:///svn/unbound/trunk@1157 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-18 11:00:49 +00:00
Wouter Wijngaards 8ab18cb0f7 fds max test before start.
git-svn-id: file:///svn/unbound/trunk@1156 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-17 10:07:40 +00:00
Wouter Wijngaards 4e2ca85842 fix bug #195.
git-svn-id: file:///svn/unbound/trunk@1155 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-17 09:00:38 +00:00
Wouter Wijngaards 71d292580b fixup #196.
git-svn-id: file:///svn/unbound/trunk@1154 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-17 08:45:12 +00:00
Wouter Wijngaards d4b612e48b 1.0.1 tag
trunk to 1.0.2
sha256 support in trunk makedist.sh



git-svn-id: file:///svn/unbound/trunk@1153 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-16 13:16:36 +00:00
Wouter Wijngaards 3d7ad2de3c fixed makedist for manpage editing
git-svn-id: file:///svn/unbound/trunk@1152 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-16 12:15:23 +00:00
Wouter Wijngaards 24cb32dc6b update with testcode matches with ldns testcode.
git-svn-id: file:///svn/unbound/trunk@1151 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-16 09:51:54 +00:00
Wouter Wijngaards 4263f2a692 - lowered log_hex blocksize to fit through BSD syslog linesize.
- no useless initialisation if getpwnam not available.
- iana, ldns snapshot updated.



git-svn-id: file:///svn/unbound/trunk@1150 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-15 15:05:12 +00:00
Wouter Wijngaards 8459b5f55f fixup error handling in libunbound ub_resolve().
git-svn-id: file:///svn/unbound/trunk@1149 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-15 10:22:39 +00:00
Wouter Wijngaards 6acc20abf4 fixup for type DS queries from clients when trustanchor for that name exists.
git-svn-id: file:///svn/unbound/trunk@1148 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-15 09:45:50 +00:00
Wouter Wijngaards 498039108b iana portlist update
git-svn-id: file:///svn/unbound/trunk@1147 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-15 08:14:03 +00:00
Wouter Wijngaards d165625c4d default local zones draft 06.
git-svn-id: file:///svn/unbound/trunk@1146 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-15 07:46:40 +00:00
Wouter Wijngaards af6cbba475 changelog entry
git-svn-id: file:///svn/unbound/trunk@1145 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-14 09:19:02 +00:00
Matthijs Mekking 14f657933c free prev and origin after failing reading root hints.
note:
valgrind still complains about the following:

==19935==    by 0x40581E1: ldns_key_buf2rsa_raw (dnssec.c:421)
==19935==    by 0x40B1151: dnskey_verify_rrset_sig (val_sigcrypt.c:1265)




git-svn-id: file:///svn/unbound/trunk@1144 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-07-03 14:01:15 +00:00
Wouter Wijngaards 1808c93e15 import ldns portability fixes.
git-svn-id: file:///svn/unbound/trunk@1143 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-27 10:28:37 +00:00
Wouter Wijngaards 8078891a28 script to update trust anchors.
git-svn-id: file:///svn/unbound/trunk@1142 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-26 18:47:09 +00:00
Wouter Wijngaards 9a102eed3e streamtcp fixup.
git-svn-id: file:///svn/unbound/trunk@1141 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-26 14:24:22 +00:00
Wouter Wijngaards 02c493bd2d fixup compile.
git-svn-id: file:///svn/unbound/trunk@1140 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-25 15:57:41 +00:00
Wouter Wijngaards e2f8a1cb82 mingw port continues.
git-svn-id: file:///svn/unbound/trunk@1139 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-25 14:36:10 +00:00
Wouter Wijngaards 78a3c4e93d fixup unit test for lameness changes.
git-svn-id: file:///svn/unbound/trunk@1138 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-25 09:56:22 +00:00
Wouter Wijngaards 5eb7ff35ca fixup for newegg lameness.
git-svn-id: file:///svn/unbound/trunk@1137 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-25 09:39:57 +00:00
Wouter Wijngaards 4e1eab891b fixup test typos.
git-svn-id: file:///svn/unbound/trunk@1136 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-25 08:12:13 +00:00
Wouter Wijngaards 31a3035c60 Ancil test typo.
git-svn-id: file:///svn/unbound/trunk@1135 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-24 15:06:32 +00:00
Wouter Wijngaards aaab8cb352 fwd_ancil detect failure correctly.
git-svn-id: file:///svn/unbound/trunk@1134 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-24 14:53:30 +00:00
Wouter Wijngaards fc0dcf12c3 updated ldns tarball with mingw32 platform support.
git-svn-id: file:///svn/unbound/trunk@1133 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-24 14:46:21 +00:00
Wouter Wijngaards 4664c66f06 fixup tests to make test program. please lint.
git-svn-id: file:///svn/unbound/trunk@1132 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-24 14:40:53 +00:00
Wouter Wijngaards 56f3cd33ec Fixup ipv6 availability test.
git-svn-id: file:///svn/unbound/trunk@1131 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-24 14:35:53 +00:00
Wouter Wijngaards a64adc395f ipv6 test working for windows.
git-svn-id: file:///svn/unbound/trunk@1130 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-24 14:18:06 +00:00
Wouter Wijngaards 66f896ddbf iana update.
checklocks.c is not in the compile path for production code anymore.



git-svn-id: file:///svn/unbound/trunk@1129 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-24 09:24:08 +00:00
Wouter Wijngaards ee5ee20071 Porting continues. TCP works fine now.
git-svn-id: file:///svn/unbound/trunk@1128 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-23 13:52:03 +00:00
Wouter Wijngaards fc3fc7a1f3 unit test, testbound, basic udp and tcp tests are working on XP.
ipv6 not supported by OS is a warning (nonfatal).

git-svn-id: file:///svn/unbound/trunk@1127 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-18 14:27:30 +00:00
Wouter Wijngaards 7be0e5b814 testbound works on XP.
ioctlsocket nicer error message.

git-svn-id: file:///svn/unbound/trunk@1126 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-18 08:16:04 +00:00
Wouter Wijngaards d4cfee1f00 busy porting tests.
git-svn-id: file:///svn/unbound/trunk@1125 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-17 15:21:48 +00:00
Wouter Wijngaards f7059107b3 winsock_event handler, working resolution and validation on windows.
git-svn-id: file:///svn/unbound/trunk@1124 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-17 14:57:18 +00:00
Wouter Wijngaards 7a528cdf53 set USE_WINSOCK if on windows. error string routine. start and clean winsock.
git-svn-id: file:///svn/unbound/trunk@1123 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-16 15:02:52 +00:00
Wouter Wijngaards f90f5a2583 windows threads. detect gdi32. nicer DISABLED_THREADS define. Compiles on mingw32.
git-svn-id: file:///svn/unbound/trunk@1122 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-16 13:39:46 +00:00
Wouter Wijngaards 76ee7a352a iana portlist update
git-svn-id: file:///svn/unbound/trunk@1121 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-16 07:00:39 +00:00
Wouter Wijngaards 148e8a69c9 compiles cleaner on ming32, socketpair compat.
git-svn-id: file:///svn/unbound/trunk@1120 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-13 15:32:16 +00:00
Wouter Wijngaards 39e4ba0e78 fix mkdir check.
git-svn-id: file:///svn/unbound/trunk@1119 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-13 13:26:15 +00:00
Wouter Wijngaards afda1a8bcc mingw32 porting.
git-svn-id: file:///svn/unbound/trunk@1118 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-13 13:20:54 +00:00
Wouter Wijngaards 092a325270 unused definitions.
git-svn-id: file:///svn/unbound/trunk@1117 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-13 09:44:25 +00:00
Wouter Wijngaards cc6322ac0f newer autoconf.
git-svn-id: file:///svn/unbound/trunk@1116 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-10 09:52:25 +00:00
Wouter Wijngaards 2487f435f6 port to xandros.
git-svn-id: file:///svn/unbound/trunk@1115 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-10 09:42:25 +00:00
Wouter Wijngaards 423e1a95a8 Bug#183 fixup.
git-svn-id: file:///svn/unbound/trunk@1114 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-09 14:59:29 +00:00
Wouter Wijngaards 8ffff3c0a3 more portable lex warning fix.
git-svn-id: file:///svn/unbound/trunk@1113 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-09 09:34:40 +00:00
Wouter Wijngaards 39e01091e7 Fixup warning.
git-svn-id: file:///svn/unbound/trunk@1112 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-09 09:29:44 +00:00
Wouter Wijngaards 8527bd4aff Fixup Richard Doty reported lameness detection fault.
git-svn-id: file:///svn/unbound/trunk@1111 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-09 08:29:59 +00:00
Wouter Wijngaards 1dec098624 iana portlist update
git-svn-id: file:///svn/unbound/trunk@1110 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-08 09:35:32 +00:00
Wouter Wijngaards 283f2a5edb if multiple CNAME's, use the first.
git-svn-id: file:///svn/unbound/trunk@1109 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-08 09:27:48 +00:00
Wouter Wijngaards 0db56d8a0d iana portlist updated.
git-svn-id: file:///svn/unbound/trunk@1108 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-04 10:44:20 +00:00
Wouter Wijngaards 065d2ad96f newer libtool contents.
git-svn-id: file:///svn/unbound/trunk@1107 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-04 10:37:08 +00:00
Wouter Wijngaards d7f2306161 fixup localzone nodefault issue, the trailing dot was used in comparisons.
git-svn-id: file:///svn/unbound/trunk@1106 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-03 12:32:08 +00:00
Wouter Wijngaards 66c8bd4ad1 ldns 1.3.0 release as tarball included with unbound.
git-svn-id: file:///svn/unbound/trunk@1105 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-02 13:27:44 +00:00
Wouter Wijngaards 725929734e bug184 fixed.
git-svn-id: file:///svn/unbound/trunk@1104 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-02 13:14:12 +00:00
Wouter Wijngaards 60f51c1197 ldns tarball updated.
bug 185 fixed.


git-svn-id: file:///svn/unbound/trunk@1103 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-02 12:12:13 +00:00
Wouter Wijngaards 85abd17e90 bug 177 fix.
git-svn-id: file:///svn/unbound/trunk@1102 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-06-02 10:30:16 +00:00
Jelte Jansen ef69508048 fix for bug 180
git-svn-id: file:///svn/unbound/trunk@1101 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-28 14:29:29 +00:00
Jelte Jansen 97854e6bc5 fix from bug 178, thanks for noticing, Joerg
git-svn-id: file:///svn/unbound/trunk@1100 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-27 07:41:50 +00:00
Wouter Wijngaards 01af814844 gmtime_r threadsafe.
git-svn-id: file:///svn/unbound/trunk@1099 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-23 15:43:55 +00:00
Wouter Wijngaards 6de373e04c typo fix.
git-svn-id: file:///svn/unbound/trunk@1098 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-23 14:22:11 +00:00
Wouter Wijngaards 4a6d702edf - mingw32 porting.
- test for sys/wait.h
          - WSAEWOULDBLOCK test after nonblocking TCP connect.
          - write_iov_buffer removed: unused and no struct iov on windows.
          - signed/unsigned warning fixup mini_event.
          - use ioctlsocket to set nonblocking I/O if fnctl is unavailable.
          - skip signals that are not defined
          - detect pwd.h.
          - detect getpwnam, getrlimit, setsid, sbrk, chroot.
          - default config has no chroot if chroot() unavailable.
          - if no kill() then no pidfile is read or written.
          - gmtime_r is replaced by nonthreadsafe alternative if unavail.
            used in rrsig time validation errors.


git-svn-id: file:///svn/unbound/trunk@1097 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-23 14:13:07 +00:00
Wouter Wijngaards 0bad5716d4 TODO items from suggestions by Jean-Jacques Sarton.
git-svn-id: file:///svn/unbound/trunk@1096 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-23 10:43:16 +00:00
Wouter Wijngaards 55fe583de8 comment update
git-svn-id: file:///svn/unbound/trunk@1095 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-23 07:15:55 +00:00
Wouter Wijngaards 55aefcad19 fixup
git-svn-id: file:///svn/unbound/trunk@1094 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-22 16:59:59 +00:00
Wouter Wijngaards fa07056f79 mingw port.
relabel replaced functions to avoid conflicts with library.

git-svn-id: file:///svn/unbound/trunk@1093 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-22 13:30:22 +00:00
Wouter Wijngaards 5990dde29b check removed.
git-svn-id: file:///svn/unbound/trunk@1092 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-22 10:46:57 +00:00
Wouter Wijngaards f9074eb440 no lexer warnings.
git-svn-id: file:///svn/unbound/trunk@1091 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-22 10:41:13 +00:00
Wouter Wijngaards 54318b8c35 Fix bug #175.
git-svn-id: file:///svn/unbound/trunk@1090 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-22 09:00:56 +00:00
Wouter Wijngaards 3bbe7a2e0b rpm spec updated.
git-svn-id: file:///svn/unbound/trunk@1089 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-22 08:34:11 +00:00
Wouter Wijngaards 0f56fd3042 ignore 1.2.2 if installed, use ldns builtin.
git-svn-id: file:///svn/unbound/trunk@1087 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-19 20:23:45 +00:00
Wouter Wijngaards 0d3ecd25df CREDITS fix of history.
git-svn-id: file:///svn/unbound/trunk@1086 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-19 20:12:37 +00:00
Wouter Wijngaards 96d4800692 fedora 9 configure check.
git-svn-id: file:///svn/unbound/trunk@1085 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-19 19:17:32 +00:00
Wouter Wijngaards d13686227c 1.0.0 tag.
git-svn-id: file:///svn/unbound/trunk@1084 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-16 14:42:00 +00:00
Wouter Wijngaards e60174a000 hosts file fixup for MacOSX
git-svn-id: file:///svn/unbound/trunk@1083 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-16 11:35:00 +00:00
Wouter Wijngaards 556b4efb8a - fixup version info for library.
- fixup --disable-rpath more.



git-svn-id: file:///svn/unbound/trunk@1082 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-14 07:34:02 +00:00
Wouter Wijngaards cf3d92a7a7 no unnecessary linking with librt.
git-svn-id: file:///svn/unbound/trunk@1081 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-13 14:01:23 +00:00
Wouter Wijngaards cf19737ee6 1.0.0 version number.
git-svn-id: file:///svn/unbound/trunk@1080 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-13 13:46:24 +00:00
Wouter Wijngaards 3dca36a649 port list update
git-svn-id: file:///svn/unbound/trunk@1079 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-13 13:09:20 +00:00
Wouter Wijngaards aab6da9362 IPv6 servers
TODO items


git-svn-id: file:///svn/unbound/trunk@1078 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-13 12:33:41 +00:00
Wouter Wijngaards 8d472c8cf8 fixup no-ip4 error callback.
git-svn-id: file:///svn/unbound/trunk@1077 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-05-07 07:53:57 +00:00
Wouter Wijngaards baf8056ba5 Fixup, no touch files if not needed, copy when not exists.
git-svn-id: file:///svn/unbound/trunk@1076 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-25 15:47:59 +00:00
Wouter Wijngaards 17631b6fd8 RPM specfile.
git-svn-id: file:///svn/unbound/trunk@1075 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-25 15:23:45 +00:00
Wouter Wijngaards 1b3eb34cd1 DESTDIR is honoured by make install.
git-svn-id: file:///svn/unbound/trunk@1074 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-25 13:28:07 +00:00
Wouter Wijngaards 6d3f7cc4e0 0.11 tag.
git-svn-id: file:///svn/unbound/trunk@1073 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-24 15:23:00 +00:00
Wouter Wijngaards 3f94669a88 document correct default.
git-svn-id: file:///svn/unbound/trunk@1072 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-24 13:38:58 +00:00
Wouter Wijngaards 395f328d4a nicer text.
git-svn-id: file:///svn/unbound/trunk@1071 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-24 13:29:34 +00:00
Wouter Wijngaards 4ba9161e75 Fixup.
git-svn-id: file:///svn/unbound/trunk@1070 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-24 13:03:59 +00:00
Wouter Wijngaards 8638d6c019 test fix.
git-svn-id: file:///svn/unbound/trunk@1069 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-24 13:00:38 +00:00
Wouter Wijngaards 95296a2528 Use logical dir in test.
git-svn-id: file:///svn/unbound/trunk@1068 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-24 12:49:22 +00:00
Wouter Wijngaards 9dd64e357f chroot more tests and more documentation.
git-svn-id: file:///svn/unbound/trunk@1067 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-24 12:37:01 +00:00
Wouter Wijngaards 8ef2cb4705 port update.
git-svn-id: file:///svn/unbound/trunk@1066 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-23 06:47:48 +00:00
Wouter Wijngaards 9b55215eb6 Parse stats with threads, from Kai.
git-svn-id: file:///svn/unbound/trunk@1065 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-23 06:33:12 +00:00
Wouter Wijngaards 9f104a42d0 uses TCP internally. faster and better.
git-svn-id: file:///svn/unbound/trunk@1064 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-22 12:22:35 +00:00
Wouter Wijngaards 21e851b0fb test.
git-svn-id: file:///svn/unbound/trunk@1063 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-22 12:09:38 +00:00
Wouter Wijngaards 227ae5b7a4 SIGPIPE ignore.
git-svn-id: file:///svn/unbound/trunk@1062 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-22 10:19:24 +00:00
Wouter Wijngaards 9739014da1 fixup chroot and kill-HUP reread of config file.
git-svn-id: file:///svn/unbound/trunk@1061 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-21 11:34:25 +00:00
Wouter Wijngaards c49eefba59 rfc number.
git-svn-id: file:///svn/unbound/trunk@1060 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-21 09:37:32 +00:00
Wouter Wijngaards c6bbc4ea23 Iana update
git-svn-id: file:///svn/unbound/trunk@1059 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-21 09:22:49 +00:00
Wouter Wijngaards f7d8e3f4bd *
git-svn-id: file:///svn/unbound/trunk@1058 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-21 09:12:25 +00:00
Wouter Wijngaards dd7404f467 FEATURES document.
git-svn-id: file:///svn/unbound/trunk@1057 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-21 09:08:35 +00:00
Wouter Wijngaards 30a1d557bd porting.
git-svn-id: file:///svn/unbound/trunk@1056 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-16 16:09:25 +00:00
Wouter Wijngaards a377c6a9d5 note down idea.
git-svn-id: file:///svn/unbound/trunk@1055 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-16 11:01:25 +00:00
Wouter Wijngaards f47e78c543 clean query returns.
git-svn-id: file:///svn/unbound/trunk@1054 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-16 09:33:24 +00:00
Wouter Wijngaards f9fd2676f9 DSA signature compatibility.
git-svn-id: file:///svn/unbound/trunk@1053 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 19:51:28 +00:00
Wouter Wijngaards c858743222 Fixup unbound. Now still a switch DSA(ldns) DSA(bind) ...
git-svn-id: file:///svn/unbound/trunk@1052 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 18:01:14 +00:00
Wouter Wijngaards 9ab79dc0dc DSA test
git-svn-id: file:///svn/unbound/trunk@1051 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 15:19:25 +00:00
Wouter Wijngaards ffed368bfc TODO item
git-svn-id: file:///svn/unbound/trunk@1050 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 13:06:54 +00:00
Wouter Wijngaards 5abd6c8da1 example.conf fixup after Kai Storbeck's suggestion.
git-svn-id: file:///svn/unbound/trunk@1049 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 11:15:52 +00:00
Wouter Wijngaards d44b91ec12 solaris FAQ entry.
git-svn-id: file:///svn/unbound/trunk@1048 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 09:27:04 +00:00
Wouter Wijngaards 399a165cc3 checkconf better.
git-svn-id: file:///svn/unbound/trunk@1047 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 08:22:17 +00:00
Wouter Wijngaards 97ebee32d0 update to be same as ldns.
git-svn-id: file:///svn/unbound/trunk@1046 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 08:01:30 +00:00
Wouter Wijngaards 29f4a9ab78 new IANA ports.
git-svn-id: file:///svn/unbound/trunk@1045 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 07:45:46 +00:00
Wouter Wijngaards b6a93eae31 pidfile location.
git-svn-id: file:///svn/unbound/trunk@1044 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-15 07:37:25 +00:00
Wouter Wijngaards 3fced109b9 Check sig type for DSA.
git-svn-id: file:///svn/unbound/trunk@1043 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 15:57:52 +00:00
Wouter Wijngaards 77e7e73a32 Jelte found DSA sig solution, copied from ldns to fit into unbound validator.
git-svn-id: file:///svn/unbound/trunk@1042 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 15:34:09 +00:00
Wouter Wijngaards adb8eda081 linux lexer.
git-svn-id: file:///svn/unbound/trunk@1041 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 15:01:47 +00:00
Wouter Wijngaards 0cc33e29e7 please doxygen
git-svn-id: file:///svn/unbound/trunk@1040 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 15:01:11 +00:00
Wouter Wijngaards 9e9d7ba0a7 fixup test for new checkconf.
git-svn-id: file:///svn/unbound/trunk@1039 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 14:58:01 +00:00
Wouter Wijngaards 74530fdb64 fixup test for user name.
git-svn-id: file:///svn/unbound/trunk@1038 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 14:50:46 +00:00
Wouter Wijngaards 2f7bd77250 0x20 document, checkconf fix.
git-svn-id: file:///svn/unbound/trunk@1037 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 14:48:17 +00:00
Wouter Wijngaards dccc665658 fixup ID collisions in test.
git-svn-id: file:///svn/unbound/trunk@1036 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 11:07:11 +00:00
Wouter Wijngaards 2139a8572c and dotests.sh (svn:NO TEST)
git-svn-id: file:///svn/unbound/trunk@1035 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 08:52:30 +00:00
Wouter Wijngaards e65070ce6f tests for udp wait list.
git-svn-id: file:///svn/unbound/trunk@1034 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 08:51:09 +00:00
Wouter Wijngaards b9bf0872c2 update to stat script in contrib.
git-svn-id: file:///svn/unbound/trunk@1033 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-14 07:15:25 +00:00
Wouter Wijngaards 2904445bd2 Fixup.
git-svn-id: file:///svn/unbound/trunk@1032 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-11 16:05:55 +00:00
Wouter Wijngaards f17580e460 fixup tests for config change.
git-svn-id: file:///svn/unbound/trunk@1031 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-11 14:41:30 +00:00
Wouter Wijngaards 0f80e5e78a - removed base_port.
- created 256-port ephemeral space for the OS, 59802 available.


git-svn-id: file:///svn/unbound/trunk@1030 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-11 14:10:16 +00:00
Wouter Wijngaards a8bf62f962 - random port selection out of the configged ports.
- fixup threadsafety for libevent-1.4.3+ (event_base_get_method).



git-svn-id: file:///svn/unbound/trunk@1029 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-11 13:24:49 +00:00
Wouter Wijngaards 234defa371 iana ports automated.
git-svn-id: file:///svn/unbound/trunk@1028 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-10 10:52:22 +00:00
Wouter Wijngaards 20ee8c10f5 log file stats parse perl script from Kai Storbeck.
git-svn-id: file:///svn/unbound/trunk@1027 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-10 10:18:44 +00:00
Wouter Wijngaards 06f41d9d84 work with latest libevent trunk.
git-svn-id: file:///svn/unbound/trunk@1026 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-10 08:16:26 +00:00
Wouter Wijngaards f0cf79146c config available ports, iana assigned ports list.
git-svn-id: file:///svn/unbound/trunk@1025 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-09 15:07:37 +00:00
Wouter Wijngaards 7eeb7cc78c statistics cumulative option.
git-svn-id: file:///svn/unbound/trunk@1024 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-09 12:29:53 +00:00
Wouter Wijngaards 46e703c989 libev can be used (but not multithreaded) and del fd unused.
git-svn-id: file:///svn/unbound/trunk@1023 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-09 11:58:53 +00:00
Wouter Wijngaards d26b183ba6 - unbound tries to set the ulimit fds when started as server.
if that does not work, it will scale back its requirements.


git-svn-id: file:///svn/unbound/trunk@1022 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-04-08 15:02:52 +00:00
Wouter Wijngaards ff8c2ed1bc FAQ entry.
git-svn-id: file:///svn/unbound/trunk@1021 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-27 10:01:38 +00:00
Wouter Wijngaards 8359474330 AD bit like in dnssec-updates draft from last DNSEXT meeting.
git-svn-id: file:///svn/unbound/trunk@1020 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-26 08:31:15 +00:00
Wouter Wijngaards 64627b1a63 RTT banding, more spoof resistance randomness.
git-svn-id: file:///svn/unbound/trunk@1019 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-25 15:33:24 +00:00
Wouter Wijngaards 87700fea40 Enforce presence of query section in reply.
git-svn-id: file:///svn/unbound/trunk@1018 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-25 14:03:31 +00:00
Wouter Wijngaards bbe801da93 harvest CNAME.
git-svn-id: file:///svn/unbound/trunk@1017 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-07 10:38:24 +00:00
Wouter Wijngaards f35ae11ff4 harvest opt.
git-svn-id: file:///svn/unbound/trunk@1016 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-07 10:16:09 +00:00
Wouter Wijngaards 677d67c29c Patch from Koji, thanks!
git-svn-id: file:///svn/unbound/trunk@1015 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-05 14:54:51 +00:00
Wouter Wijngaards 6adf9e1459 Default config file location.
git-svn-id: file:///svn/unbound/trunk@1014 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-04 14:25:53 +00:00
Wouter Wijngaards 85af59c734 Fixup trust for CNAME chains. (and also DNAME).
git-svn-id: file:///svn/unbound/trunk@1013 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-04 11:00:49 +00:00
Wouter Wijngaards 30478d3e17 nicer indentation.
git-svn-id: file:///svn/unbound/trunk@1012 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-03 10:28:12 +00:00
Wouter Wijngaards 288f022dd6 tag 0.10, version upped to 0.11 in trunk.
git-svn-id: file:///svn/unbound/trunk@1011 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-03-03 10:03:38 +00:00
Wouter Wijngaards 8a359e134b tarball update.
git-svn-id: file:///svn/unbound/trunk@1010 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-29 13:23:44 +00:00
Wouter Wijngaards c9447139c8 more portable compilation inside.
git-svn-id: file:///svn/unbound/trunk@1009 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-29 11:44:23 +00:00
Wouter Wijngaards 822422cbfb confixlexer and parser from linux are a little more portable (despite the
signed/unsigned comparison warning).


git-svn-id: file:///svn/unbound/trunk@1008 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-29 10:59:26 +00:00
Wouter Wijngaards 34da89510c Note about dependencies.
git-svn-id: file:///svn/unbound/trunk@1007 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-29 10:35:05 +00:00
Wouter Wijngaards c5ef04b7b4 lexer and parser from freebsd.
git-svn-id: file:///svn/unbound/trunk@1006 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-29 10:23:52 +00:00
Wouter Wijngaards 372b4a1c12 portability.
git-svn-id: file:///svn/unbound/trunk@1005 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-29 10:22:07 +00:00
Wouter Wijngaards 3e103c2983 doc nicer.
git-svn-id: file:///svn/unbound/trunk@1004 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-29 09:28:55 +00:00
Wouter Wijngaards 6b51790054 installed to sbin.
git-svn-id: file:///svn/unbound/trunk@1003 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-28 19:44:11 +00:00
Wouter Wijngaards 9be7d20ac6 harvest print output.
git-svn-id: file:///svn/unbound/trunk@1002 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-28 16:19:20 +00:00
Wouter Wijngaards d0da5bc14c install to sbin
git-svn-id: file:///svn/unbound/trunk@1001 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-28 13:50:34 +00:00
Wouter Wijngaards 28dfc5fc39 harvest takes input.
git-svn-id: file:///svn/unbound/trunk@1000 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-28 13:07:03 +00:00
Wouter Wijngaards bc6617cf11 lint for libunbound.
git-svn-id: file:///svn/unbound/trunk@999 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-28 12:36:50 +00:00
Wouter Wijngaards 2b95664a66 + - fixed memory leaks in libunbound (during cancellation and wait).
+       - libunbound returns the answer packet in full.
+       - snprintf compat update.
+       - harvest performs lookup.
+       - ldns-tarball update with fix for ldns_dname_label.



git-svn-id: file:///svn/unbound/trunk@998 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-28 12:29:00 +00:00
Wouter Wijngaards acb8698a3c please lin.
git-svn-id: file:///svn/unbound/trunk@997 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-27 15:12:36 +00:00
Wouter Wijngaards 7a8fa9e3de harvest
git-svn-id: file:///svn/unbound/trunk@996 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-27 15:03:25 +00:00
Wouter Wijngaards d90c162edf config file option for draft-0x20.
git-svn-id: file:///svn/unbound/trunk@995 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-27 09:39:27 +00:00
Wouter Wijngaards 130a5f2dee can use DNS-0x20 draft casing.
git-svn-id: file:///svn/unbound/trunk@994 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-27 09:21:31 +00:00
Wouter Wijngaards 39b2a21a81 Answers use same case as query does.
git-svn-id: file:///svn/unbound/trunk@993 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-26 20:45:20 +00:00
Wouter Wijngaards c00d1e02cd fixup test for nc version differences.
git-svn-id: file:///svn/unbound/trunk@992 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-26 14:25:36 +00:00
Wouter Wijngaards c2390d030d verbosity uit.
git-svn-id: file:///svn/unbound/trunk@991 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-26 14:04:02 +00:00
Wouter Wijngaards 5979bc061f delayer in TCP.
git-svn-id: file:///svn/unbound/trunk@990 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-26 13:04:05 +00:00
Wouter Wijngaards 1dc9abfb79 Delayer util.
git-svn-id: file:///svn/unbound/trunk@989 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-25 15:35:23 +00:00
Wouter Wijngaards 9071852837 delay test program.
git-svn-id: file:///svn/unbound/trunk@988 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 15:40:50 +00:00
Wouter Wijngaards 2f4be547bd Notes.
git-svn-id: file:///svn/unbound/trunk@987 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 14:27:09 +00:00
Wouter Wijngaards cc8dfa660d counting speedup.
git-svn-id: file:///svn/unbound/trunk@986 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 14:03:49 +00:00
Wouter Wijngaards 99dfad38b2 faster message parse.
git-svn-id: file:///svn/unbound/trunk@985 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 12:54:14 +00:00
Wouter Wijngaards fa368eff78 simpler ptr loop check.
git-svn-id: file:///svn/unbound/trunk@984 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 11:19:21 +00:00
Wouter Wijngaards fb1bdb8ee0 default to faster internal event loop.
git-svn-id: file:///svn/unbound/trunk@983 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 10:19:49 +00:00
Wouter Wijngaards 9c0b217980 TODO remove optimizations that won't help.
git-svn-id: file:///svn/unbound/trunk@982 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 09:58:23 +00:00
Wouter Wijngaards bc7d3dc192 avoid reencoding the same reply in mesh reply.
git-svn-id: file:///svn/unbound/trunk@981 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-22 09:23:42 +00:00
Wouter Wijngaards 104a7fb3ea couple percent shaved off in compress_tree_lookup and dname_lab_cmp.
git-svn-id: file:///svn/unbound/trunk@980 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-21 15:25:22 +00:00
Jelte Jansen 6591aab69f right dir?
git-svn-id: file:///svn/unbound/trunk@979 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-21 11:08:23 +00:00
Wouter Wijngaards 49fd904db2 speed up message encoding.
git-svn-id: file:///svn/unbound/trunk@976 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-21 10:25:49 +00:00
Wouter Wijngaards 57511c1114 encoding speed test.
git-svn-id: file:///svn/unbound/trunk@975 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-20 15:35:49 +00:00
Wouter Wijngaards bb1bf0505e test fix for NSEC3 new algorithms.
git-svn-id: file:///svn/unbound/trunk@974 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-20 14:20:27 +00:00
Wouter Wijngaards 0253676384 better time printout.
git-svn-id: file:///svn/unbound/trunk@973 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-20 07:28:33 +00:00
Wouter Wijngaards 0627d1a43e do-daemonize
git-svn-id: file:///svn/unbound/trunk@972 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-20 07:26:03 +00:00
Wouter Wijngaards f3cfe6ed9c - setup speec_cache for need-ldns-testns in dotests.
- check number of queued replies on incoming queries to avoid overload
         on that account.
       - fptr whitelist checks are not disabled in optimize mode.



git-svn-id: file:///svn/unbound/trunk@971 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-20 07:18:42 +00:00
Wouter Wijngaards b018f6d9f7 better text.
git-svn-id: file:///svn/unbound/trunk@970 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 16:25:00 +00:00
Wouter Wijngaards 7b8218b2a2 race cond found in test.
git-svn-id: file:///svn/unbound/trunk@969 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 15:49:22 +00:00
Wouter Wijngaards 1b403f6ee1 UDP per select speedup.
git-svn-id: file:///svn/unbound/trunk@968 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 14:35:40 +00:00
Wouter Wijngaards 8a7bb2c4f6 nsec3 type codes.
git-svn-id: file:///svn/unbound/trunk@967 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 13:58:20 +00:00
Wouter Wijngaards b2710818d4 Faster due to time-sharing.
git-svn-id: file:///svn/unbound/trunk@966 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 13:12:23 +00:00
Wouter Wijngaards 0866b8e60b donotq localhost default back on yes.
git-svn-id: file:///svn/unbound/trunk@965 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 09:12:35 +00:00
Wouter Wijngaards 8b3c553f23 And man page too.
git-svn-id: file:///svn/unbound/trunk@964 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-19 08:11:38 +00:00
Wouter Wijngaards db6178e670 profiling speedups.
git-svn-id: file:///svn/unbound/trunk@963 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-18 15:45:14 +00:00
Wouter Wijngaards dd7ffb54ee nicer code.
git-svn-id: file:///svn/unbound/trunk@962 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-18 13:20:14 +00:00
Wouter Wijngaards a0cc6dfc5a Fixed bug in RD flag setting.
perf works better with long taking queries.


git-svn-id: file:///svn/unbound/trunk@961 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-18 13:16:06 +00:00
Wouter Wijngaards ffee03db49 patch from Jan-Piet Mens.
Error checking added.


git-svn-id: file:///svn/unbound/trunk@960 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-18 08:49:11 +00:00
Wouter Wijngaards f3cdeb500c cache speed test.
git-svn-id: file:///svn/unbound/trunk@959 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-15 15:54:30 +00:00
Wouter Wijngaards a345ffccfa fixup --prefix also changes config file default paths.
git-svn-id: file:///svn/unbound/trunk@958 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-15 14:13:09 +00:00
Wouter Wijngaards c9d58a02d7 FreeBSD rc.d script for unbound.
git-svn-id: file:///svn/unbound/trunk@957 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-15 13:43:30 +00:00
Wouter Wijngaards a561a26a80 getoptargorderdifferent
git-svn-id: file:///svn/unbound/trunk@956 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-14 16:36:33 +00:00
Wouter Wijngaards 45e6964a92 fixup make in test.
git-svn-id: file:///svn/unbound/trunk@955 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-14 16:21:22 +00:00
Wouter Wijngaards 94bf5d116f perf test.
git-svn-id: file:///svn/unbound/trunk@954 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-14 16:16:39 +00:00
Wouter Wijngaards 94f8dd838c start without a config file (all default settings).
git-svn-id: file:///svn/unbound/trunk@953 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-14 10:37:32 +00:00
Wouter Wijngaards ed224e1d64 empty line fixup.
git-svn-id: file:///svn/unbound/trunk@952 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-13 15:26:09 +00:00
Wouter Wijngaards 00165cbe65 perf tool work.
git-svn-id: file:///svn/unbound/trunk@951 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-13 15:19:50 +00:00
Wouter Wijngaards 06890aaf8e print version.
git-svn-id: file:///svn/unbound/trunk@950 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-13 13:24:41 +00:00
Wouter Wijngaards 954a73f8c6 Fixup recursion.
git-svn-id: file:///svn/unbound/trunk@948 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-12 14:26:19 +00:00
Wouter Wijngaards 5d8fe6ec49 please doc, lint
git-svn-id: file:///svn/unbound/trunk@946 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-11 15:34:11 +00:00
Wouter Wijngaards d7f47f4de6 nice option interface. Nice debug output stream option.
git-svn-id: file:///svn/unbound/trunk@945 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-11 15:22:57 +00:00
Wouter Wijngaards 49d73f5f56 etc hosts handling.
git-svn-id: file:///svn/unbound/trunk@944 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-11 10:27:37 +00:00
Wouter Wijngaards 1dd130be61 stats output text nice.
git-svn-id: file:///svn/unbound/trunk@943 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-11 09:19:32 +00:00
Wouter Wijngaards 58c34b2dda ub_
git-svn-id: file:///svn/unbound/trunk@942 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-11 08:52:14 +00:00
Wouter Wijngaards 8bde1c7cb3 fixes.
git-svn-id: file:///svn/unbound/trunk@941 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-08 13:27:49 +00:00
Wouter Wijngaards 0dcf1d71dc tag 0.9
git-svn-id: file:///svn/unbound/trunk@937 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-08 12:27:41 +00:00
Wouter Wijngaards 09e18ffdbb fixup validator classification of root referrals.
git-svn-id: file:///svn/unbound/trunk@936 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-08 12:24:01 +00:00
Wouter Wijngaards 04edbb68b7 do multiple queries over TCP.
git-svn-id: file:///svn/unbound/trunk@935 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-08 10:59:18 +00:00
Wouter Wijngaards 2884751446 and log entry for the portability fix.
git-svn-id: file:///svn/unbound/trunk@934 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-07 15:35:04 +00:00
Wouter Wijngaards c8982075c5 unsigned cast for prints.
git-svn-id: file:///svn/unbound/trunk@933 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-07 14:55:27 +00:00
Wouter Wijngaards 0c8d24b653 Fixes.
git-svn-id: file:///svn/unbound/trunk@932 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-07 14:13:03 +00:00
Wouter Wijngaards d2b3e464ac Fixup for solaris and libevent brokenness.
git-svn-id: file:///svn/unbound/trunk@931 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-07 14:09:24 +00:00
Wouter Wijngaards f3525b2081 log level 2.
git-svn-id: file:///svn/unbound/trunk@930 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-07 11:04:56 +00:00
Wouter Wijngaards 849026931b move around debug levels.
git-svn-id: file:///svn/unbound/trunk@929 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-07 09:46:49 +00:00
Wouter Wijngaards da073cfc3e fallback EDNS on NOTIMPL.
git-svn-id: file:///svn/unbound/trunk@928 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 15:08:38 +00:00
Wouter Wijngaards caaad8b810 TODO fixups.
Memory free is needed for HUP handling anyway.
interface separation already implemented.
better idea about nearmiss handling.


git-svn-id: file:///svn/unbound/trunk@927 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 15:00:59 +00:00
Wouter Wijngaards 0fe0251c8d Low pop statistics are not good.
git-svn-id: file:///svn/unbound/trunk@926 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 13:34:59 +00:00
Wouter Wijngaards 9be27227a1 rename files.
git-svn-id: file:///svn/unbound/trunk@925 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 13:18:24 +00:00
Wouter Wijngaards a9a47f8b41 result_free to resolve_free (thanks Benno).
git-svn-id: file:///svn/unbound/trunk@924 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 13:10:40 +00:00
Wouter Wijngaards 46f7dc4d08 nicer printout.
git-svn-id: file:///svn/unbound/trunk@923 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 10:13:26 +00:00
Wouter Wijngaards 0e5b4105d1 Fix for nothreading.
git-svn-id: file:///svn/unbound/trunk@922 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 10:09:54 +00:00
Wouter Wijngaards 9b31997a4c Clearer explanation how to get solaris threads.
git-svn-id: file:///svn/unbound/trunk@921 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-06 10:03:55 +00:00
Wouter Wijngaards 98552115d0 fixup typos
git-svn-id: file:///svn/unbound/trunk@920 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-05 15:22:10 +00:00
Wouter Wijngaards d58327876f Make parallel builds fixup.
git-svn-id: file:///svn/unbound/trunk@919 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-05 14:45:19 +00:00
Wouter Wijngaards 8b048a8229 Statistics test.
git-svn-id: file:///svn/unbound/trunk@918 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-05 13:53:05 +00:00
Wouter Wijngaards 967793aad3 statistics-interval config setting.
git-svn-id: file:///svn/unbound/trunk@917 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-05 10:23:44 +00:00
Wouter Wijngaards 6ffe218762 Fix for libevent 1.2 versions.
git-svn-id: file:///svn/unbound/trunk@916 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-02-01 12:53:02 +00:00
Wouter Wijngaards da8ae735ce Fixup getmem.
git-svn-id: file:///svn/unbound/trunk@915 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-31 15:09:24 +00:00
Wouter Wijngaards 8cdb815df6 ordering for alloc checks.
git-svn-id: file:///svn/unbound/trunk@914 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-31 14:45:10 +00:00
Wouter Wijngaards e48ecb0e15 nonblock bg pipes.
git-svn-id: file:///svn/unbound/trunk@913 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-31 10:40:58 +00:00
Wouter Wijngaards 635c65f4ed remove DEBUG
git-svn-id: file:///svn/unbound/trunk@912 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-30 16:35:34 +00:00
Wouter Wijngaards 2b4ef794b9 logging nicer, removal of reply_iov.
git-svn-id: file:///svn/unbound/trunk@911 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-30 14:46:01 +00:00
Wouter Wijngaards 0e1b3fb3e0 chroot checks for roothints and anchor files.
git-svn-id: file:///svn/unbound/trunk@910 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-30 11:21:20 +00:00
Wouter Wijngaards be483a3bfb libevent compatibility.
git-svn-id: file:///svn/unbound/trunk@909 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-28 15:57:27 +00:00
Wouter Wijngaards 6ef599255d protect config access. fix test.
git-svn-id: file:///svn/unbound/trunk@908 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-28 14:45:20 +00:00
Wouter Wijngaards c8f2bf0333 fixes for random number badness (lack of entropy and SIGFPE from RAND_cleanup
too early).


git-svn-id: file:///svn/unbound/trunk@907 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-28 14:34:53 +00:00
Wouter Wijngaards e5196b25ae more locks.
git-svn-id: file:///svn/unbound/trunk@906 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-28 13:42:55 +00:00
Wouter Wijngaards 193892e52d Two small fixes.
git-svn-id: file:///svn/unbound/trunk@905 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-28 09:31:29 +00:00
Wouter Wijngaards a6c543362d smaller fixes.
git-svn-id: file:///svn/unbound/trunk@904 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 16:17:36 +00:00
Wouter Wijngaards 32396dc677 more fixes, more tests.
git-svn-id: file:///svn/unbound/trunk@903 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 15:45:54 +00:00
Wouter Wijngaards ed57c4de4c - fixup race problems from opensll in rand init from library, with
a mutex around the rand init.
       - fix pass async_id=NULL to _async resolve().
       - rewrote _wait() routine, so that it is threadsafe.
       - cancelation is threadsafe.


git-svn-id: file:///svn/unbound/trunk@902 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 15:13:39 +00:00
Wouter Wijngaards bfe329e34d credits for testing.
git-svn-id: file:///svn/unbound/trunk@901 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 11:20:54 +00:00
Wouter Wijngaards 9e30587b1e refactor asynclook.
git-svn-id: file:///svn/unbound/trunk@900 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 11:17:48 +00:00
Wouter Wijngaards cf9837bf7f asynclook blocking mode.
git-svn-id: file:///svn/unbound/trunk@899 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 10:49:58 +00:00
Wouter Wijngaards 0bdfbccbdc please doxygen.
git-svn-id: file:///svn/unbound/trunk@898 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 10:41:17 +00:00
Wouter Wijngaards 3bb9aaafca Fixup race.
git-svn-id: file:///svn/unbound/trunk@897 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 10:23:57 +00:00
Wouter Wijngaards 7bfaf07981 test for async.
git-svn-id: file:///svn/unbound/trunk@896 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-25 09:53:04 +00:00
Wouter Wijngaards 2e28288b1d forwarder mode options for library.
git-svn-id: file:///svn/unbound/trunk@895 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-24 14:58:51 +00:00
Wouter Wijngaards 452b7cc069 Makefile fix.
git-svn-id: file:///svn/unbound/trunk@894 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-24 11:06:10 +00:00
Wouter Wijngaards 4d194ac2fa fwd_ancil needs ldns-testns.
git-svn-id: file:///svn/unbound/trunk@893 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-24 11:05:24 +00:00
Wouter Wijngaards f041511951 caution when retry, not excessively.
git-svn-id: file:///svn/unbound/trunk@892 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-24 10:53:40 +00:00
Wouter Wijngaards 0e4bda4c55 cancel().
git-svn-id: file:///svn/unbound/trunk@891 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-24 09:14:07 +00:00
Wouter Wijngaards e56a3a60ef bg resolution works.
git-svn-id: file:///svn/unbound/trunk@890 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-23 15:15:37 +00:00
Wouter Wijngaards faa7ad14c6 no more debug prints for auto ifs.
git-svn-id: file:///svn/unbound/trunk@889 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-23 08:49:57 +00:00
Wouter Wijngaards c87fe76e47 OPT.
git-svn-id: file:///svn/unbound/trunk@888 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-23 07:54:43 +00:00
Wouter Wijngaards a18af6d1e1 test program for bg lookups.
git-svn-id: file:///svn/unbound/trunk@887 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-22 16:28:41 +00:00
Wouter Wijngaards 3adebc8721 bg query and result code.
git-svn-id: file:///svn/unbound/trunk@886 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-22 14:17:44 +00:00
Wouter Wijngaards 1a4fadaf00 fix quit on timeout, and printing trailing dots.
git-svn-id: file:///svn/unbound/trunk@885 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-22 12:01:13 +00:00
Wouter Wijngaards b26f289ccc fix link testbound.
git-svn-id: file:///svn/unbound/trunk@884 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-22 11:28:07 +00:00
Wouter Wijngaards 0e000a8587 unbound.c pipe code.
git-svn-id: file:///svn/unbound/trunk@883 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-22 11:10:49 +00:00
Wouter Wijngaards 84ae5c8e79 Only causes either a spurious log_err or a spuriously dropped TCP DNS
transfer. 


git-svn-id: file:///svn/unbound/trunk@882 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-21 16:07:42 +00:00
Wouter Wijngaards 05f9d35f00 serialize, deserialize, raw commpoints.
case preserve note.


git-svn-id: file:///svn/unbound/trunk@881 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-21 16:03:59 +00:00
Wouter Wijngaards c7ad292438 unbound lib work.
git-svn-id: file:///svn/unbound/trunk@880 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-18 13:52:22 +00:00
Wouter Wijngaards b63db13e72 makedist fixup
git-svn-id: file:///svn/unbound/trunk@879 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-18 11:01:00 +00:00
Wouter Wijngaards 6ee18c6824 update ldns-testpkts.
git-svn-id: file:///svn/unbound/trunk@878 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-18 10:57:52 +00:00
Wouter Wijngaards e8f4ac9b1a Fix for Solaris 9.
git-svn-id: file:///svn/unbound/trunk@877 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-18 09:50:59 +00:00
Wouter Wijngaards 5e420a8275 manpage fixup, no more 6to4 mapping.
git-svn-id: file:///svn/unbound/trunk@876 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-18 09:18:12 +00:00
Wouter Wijngaards bb3a1178b6 BSD fix for ip4.
git-svn-id: file:///svn/unbound/trunk@875 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-18 09:09:55 +00:00
Wouter Wijngaards 306db56f1f support for IP_RECVDSTADDR.
git-svn-id: file:///svn/unbound/trunk@874 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-18 08:51:19 +00:00
Wouter Wijngaards 95b0a129e2 manual and pktinfo.
git-svn-id: file:///svn/unbound/trunk@873 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-17 15:35:34 +00:00
Wouter Wijngaards c4e1a83be5 TODO update.
git-svn-id: file:///svn/unbound/trunk@872 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-17 09:19:34 +00:00
Wouter Wijngaards fec9e1d262 if auto fix more.
git-svn-id: file:///svn/unbound/trunk@871 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-17 08:40:08 +00:00
Wouter Wijngaards c854c57c6f please doxygen.
git-svn-id: file:///svn/unbound/trunk@870 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-17 08:26:15 +00:00
Wouter Wijngaards ee6e142192 configure fixes.
git-svn-id: file:///svn/unbound/trunk@869 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-17 08:17:24 +00:00
Wouter Wijngaards ac74d176cc fix for localhost queries in automatic interface mode.
git-svn-id: file:///svn/unbound/trunk@868 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-16 12:47:44 +00:00
Wouter Wijngaards 8343901c0f TODO item for RFC compliance.
git-svn-id: file:///svn/unbound/trunk@867 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-16 09:32:28 +00:00
Wouter Wijngaards b7745a2e53 TC bit is formerr.
git-svn-id: file:///svn/unbound/trunk@866 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-16 08:53:56 +00:00
Wouter Wijngaards 82cab3f855 makedist fixup.
git-svn-id: file:///svn/unbound/trunk@865 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 15:47:16 +00:00
Wouter Wijngaards 6ce08cf242 fix for MacOS/X.
git-svn-id: file:///svn/unbound/trunk@864 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 15:13:40 +00:00
Wouter Wijngaards 877038b6d9 fix for solaris 10.
git-svn-id: file:///svn/unbound/trunk@863 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 14:53:32 +00:00
Wouter Wijngaards a2227517ed no problem with sysctl.
git-svn-id: file:///svn/unbound/trunk@862 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 14:20:13 +00:00
Wouter Wijngaards 04a896098e ancil test working on *BSD.
git-svn-id: file:///svn/unbound/trunk@861 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 14:11:47 +00:00
Wouter Wijngaards 7e84653485 better v6only disable code.
git-svn-id: file:///svn/unbound/trunk@860 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 14:07:49 +00:00
Wouter Wijngaards 71723c6276 fixup for -levent.
git-svn-id: file:///svn/unbound/trunk@859 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 13:19:59 +00:00
Wouter Wijngaards 219d0c70dd Remove warnings on Solaris 9.
git-svn-id: file:///svn/unbound/trunk@858 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 13:10:21 +00:00
Wouter Wijngaards 85c88707ca configure fixes.
git-svn-id: file:///svn/unbound/trunk@857 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 13:04:27 +00:00
Wouter Wijngaards e7d64c7eac fixy.
git-svn-id: file:///svn/unbound/trunk@856 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 12:58:17 +00:00
Wouter Wijngaards d7d8e117ef set ldflags during levent test.
git-svn-id: file:///svn/unbound/trunk@855 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 12:54:11 +00:00
Wouter Wijngaards d9e9a31562 regen configure.
git-svn-id: file:///svn/unbound/trunk@854 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 12:48:24 +00:00
Wouter Wijngaards 5d594b301f extra define for solaris ancillary data.
git-svn-id: file:///svn/unbound/trunk@853 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 12:47:44 +00:00
Wouter Wijngaards 648a776493 late flags.
git-svn-id: file:///svn/unbound/trunk@852 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 12:45:53 +00:00
Wouter Wijngaards 8404701a09 fixup test for BSD.
git-svn-id: file:///svn/unbound/trunk@851 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 11:54:15 +00:00
Wouter Wijngaards 4b065a443c nicer error msgs.
git-svn-id: file:///svn/unbound/trunk@850 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 10:39:32 +00:00
Wouter Wijngaards 0b04728785 lint more.
git-svn-id: file:///svn/unbound/trunk@849 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 10:18:36 +00:00
Wouter Wijngaards 76a31aacd3 test for ancillary data and fixes for lint and doxygen.
git-svn-id: file:///svn/unbound/trunk@848 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 10:10:22 +00:00
Wouter Wijngaards 179273a13a interface-automatic (IP6mapped, good for anycast service and so on).
git-svn-id: file:///svn/unbound/trunk@847 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-15 09:45:30 +00:00
Wouter Wijngaards 7f8b84d0e5 lint, optimize fix.
git-svn-id: file:///svn/unbound/trunk@846 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-14 10:21:09 +00:00
Wouter Wijngaards 2b08436c4c - in no debug sets NDEBUG to remove asserts.
- configure --enable-debug is needed for dependency generation
         for assertions and for compiler warnings.
       - ldns.tgz updated with ldns-trunk (where buffer.h is updated).


git-svn-id: file:///svn/unbound/trunk@845 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-14 09:51:20 +00:00
Wouter Wijngaards 5cc518f114 inverse.
git-svn-id: file:///svn/unbound/trunk@844 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-11 13:49:59 +00:00
Wouter Wijngaards 1315edc5e9 Nicer sizes possible in config file.
git-svn-id: file:///svn/unbound/trunk@843 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-11 13:20:22 +00:00
Wouter Wijngaards 97f5d3d28e more checks by checkconf.
git-svn-id: file:///svn/unbound/trunk@842 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-11 11:24:30 +00:00
Wouter Wijngaards ad78119e19 stubzone text.
git-svn-id: file:///svn/unbound/trunk@841 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-11 10:18:48 +00:00
Wouter Wijngaards 2756924a44 remove man page nroff warning.
git-svn-id: file:///svn/unbound/trunk@840 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-11 09:03:56 +00:00
Wouter Wijngaards 3fd809d537 TODO
git-svn-id: file:///svn/unbound/trunk@839 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-10 16:24:07 +00:00
Wouter Wijngaards 22b8057cca man page fixes for Solaris.
git-svn-id: file:///svn/unbound/trunk@838 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-10 15:46:55 +00:00
Wouter Wijngaards fe6f28ddc5 libevent .lo file linking.
git-svn-id: file:///svn/unbound/trunk@837 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-10 14:00:07 +00:00
Wouter Wijngaards 1e4dc049eb doc fix.
git-svn-id: file:///svn/unbound/trunk@836 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-10 13:40:12 +00:00
Wouter Wijngaards 1a4d24816b more portable libtool linking of included ldns package.
git-svn-id: file:///svn/unbound/trunk@835 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-10 11:47:07 +00:00
Wouter Wijngaards 1f47306af9 typo.
git-svn-id: file:///svn/unbound/trunk@834 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-10 09:25:14 +00:00
Wouter Wijngaards f1a3c9b646 quartile prints.
git-svn-id: file:///svn/unbound/trunk@833 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-10 09:02:18 +00:00
Wouter Wijngaards a67e62dd40 seeding bigger to make openssl happy.
git-svn-id: file:///svn/unbound/trunk@831 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-09 12:48:03 +00:00
Wouter Wijngaards 1b6d254224 warning about entropy.
git-svn-id: file:///svn/unbound/trunk@828 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-09 12:04:20 +00:00
Wouter Wijngaards a0e442eb32 rng fixup (trunk).
git-svn-id: file:///svn/unbound/trunk@827 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-09 10:55:37 +00:00
Wouter Wijngaards 7eaceaab2f text.
git-svn-id: file:///svn/unbound/trunk@825 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-04 18:00:45 +00:00
Wouter Wijngaards 2ba3ff9f7d document misconfiguration.
git-svn-id: file:///svn/unbound/trunk@824 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-04 13:13:50 +00:00
Wouter Wijngaards e7cb0f27cc refused stops retries.
git-svn-id: file:///svn/unbound/trunk@823 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-02 13:48:19 +00:00
Wouter Wijngaards 317938efba typo.
git-svn-id: file:///svn/unbound/trunk@822 be551aaa-1e26-0410-a405-d3ace91eadb9
2008-01-02 13:24:35 +00:00
Wouter Wijngaards d6ce1f426d small fries.
git-svn-id: file:///svn/unbound/trunk@821 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 14:54:10 +00:00
Wouter Wijngaards 9f97c4ac44 fix bogus flag.
git-svn-id: file:///svn/unbound/trunk@820 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 14:25:18 +00:00
Wouter Wijngaards 6a5f5e652a lint.
git-svn-id: file:///svn/unbound/trunk@819 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 14:09:25 +00:00
Wouter Wijngaards 61b42edaef portability of header file.
git-svn-id: file:///svn/unbound/trunk@818 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 14:07:38 +00:00
Wouter Wijngaards 060d4740c2 ldns update.
git-svn-id: file:///svn/unbound/trunk@817 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 12:12:51 +00:00
Wouter Wijngaards 5a198e0b4c small improvements.
git-svn-id: file:///svn/unbound/trunk@816 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 11:01:04 +00:00
Wouter Wijngaards abf85e9270 cname handling improved.
git-svn-id: file:///svn/unbound/trunk@815 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 10:43:10 +00:00
Wouter Wijngaards ab4b9aa250 manpage for unbound-host.
git-svn-id: file:///svn/unbound/trunk@814 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 09:03:29 +00:00
Wouter Wijngaards a2f143cfcc debug option.
git-svn-id: file:///svn/unbound/trunk@813 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-07 08:29:09 +00:00
Wouter Wijngaards e297886386 abort gone
git-svn-id: file:///svn/unbound/trunk@812 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-06 17:38:15 +00:00
Wouter Wijngaards cdf334528f unbound-host shows security info.
git-svn-id: file:///svn/unbound/trunk@811 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-06 17:05:21 +00:00
Wouter Wijngaards 1f9ad9e66e unbound-host works.
git-svn-id: file:///svn/unbound/trunk@810 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-06 16:35:36 +00:00
Wouter Wijngaards 75073cefea library resolution working.
git-svn-id: file:///svn/unbound/trunk@809 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-06 15:11:07 +00:00
Wouter Wijngaards 9374c1465a libworker.
git-svn-id: file:///svn/unbound/trunk@808 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-05 11:06:56 +00:00
Wouter Wijngaards a2311972e7 locking diff.
git-svn-id: file:///svn/unbound/trunk@807 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-05 06:41:39 +00:00
Wouter Wijngaards 11a764a82f moved unlock to please.
git-svn-id: file:///svn/unbound/trunk@806 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-04 21:53:19 +00:00
Wouter Wijngaards f187e1da7e fptrwlist and remove oldhack with islocked param.
git-svn-id: file:///svn/unbound/trunk@805 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-04 21:34:53 +00:00
Wouter Wijngaards 2dbc83d5ae markdelfunc for lock order problem in lruhash reclaim().
git-svn-id: file:///svn/unbound/trunk@804 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-04 21:18:25 +00:00
Wouter Wijngaards fcac316d63 coverity run fixes.
git-svn-id: file:///svn/unbound/trunk@803 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-04 17:54:14 +00:00
Wouter Wijngaards 43a2640a9c libunbound work.
git-svn-id: file:///svn/unbound/trunk@802 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-04 16:14:09 +00:00
Wouter Wijngaards 8892d4b63c makefile nit and modstack.
git-svn-id: file:///svn/unbound/trunk@801 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-04 13:23:41 +00:00
Wouter Wijngaards 1c33240c16 Small edits, work on design to make it work.
git-svn-id: file:///svn/unbound/trunk@800 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-03 18:45:56 +00:00
Wouter Wijngaards b97a63aa95 Link fix.
git-svn-id: file:///svn/unbound/trunk@799 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-03 18:11:42 +00:00
Wouter Wijngaards 2ef042ef0e move runtime path.
git-svn-id: file:///svn/unbound/trunk@798 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-03 17:46:18 +00:00
Wouter Wijngaards 185c6f76b1 Fix for build in subdir.
git-svn-id: file:///svn/unbound/trunk@796 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-03 17:33:12 +00:00
Wouter Wijngaards 87fe7013a0 test app, and hopefully useful tool.
git-svn-id: file:///svn/unbound/trunk@795 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-03 11:02:31 +00:00
Wouter Wijngaards 77019eeb5e - changed checkconf/ to smallapp/ to make room for more support tools.
(such as unbound-host).
       - install dirs created with -m 755 because they need to be accessible.
       - library extensive featurelist added to TODO.
       - please doxygen, lint.


git-svn-id: file:///svn/unbound/trunk@794 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-12-03 08:24:36 +00:00
Wouter Wijngaards 1152a4c5e8 don't forget to lock it.
git-svn-id: file:///svn/unbound/trunk@793 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-30 18:14:48 +00:00
Wouter Wijngaards 83f8775d5a More api work, makefile links library.
git-svn-id: file:///svn/unbound/trunk@792 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-30 14:53:57 +00:00
Wouter Wijngaards d9907b118f more.
git-svn-id: file:///svn/unbound/trunk@791 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-29 15:55:26 +00:00
Wouter Wijngaards 6ccdaf41e5 public API start.
git-svn-id: file:///svn/unbound/trunk@790 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-29 15:02:15 +00:00
Wouter Wijngaards eb4ba518f1 configure regenerated for 0.9
git-svn-id: file:///svn/unbound/trunk@789 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 16:10:55 +00:00
Wouter Wijngaards 6a355b37fe 0.8 tag.
git-svn-id: file:///svn/unbound/trunk@788 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 15:49:35 +00:00
Wouter Wijngaards e12d274954 fixup for duplication of NSECs / NSEC3s after following CNAMEs
(esp. wildcard CNAMEs and in-zone CNAMEs that then include nodata or
nxdomain proofs) where the CNAME is followed again to include more NSECs.


git-svn-id: file:///svn/unbound/trunk@787 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 13:41:31 +00:00
Wouter Wijngaards 9ade3e4811 nonRD fix.
git-svn-id: file:///svn/unbound/trunk@786 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 12:06:32 +00:00
Wouter Wijngaards 2c2eaecc6c nonRD fix.
git-svn-id: file:///svn/unbound/trunk@785 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 11:02:01 +00:00
Wouter Wijngaards 16906c53e6 log verbosity
git-svn-id: file:///svn/unbound/trunk@784 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 09:34:06 +00:00
Wouter Wijngaards b6d9b4bfcc CNAME chain marked as NXDOMAIN normalized to unbound preferred format.
git-svn-id: file:///svn/unbound/trunk@783 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 09:13:56 +00:00
Wouter Wijngaards 6bb12a5776 show it.
git-svn-id: file:///svn/unbound/trunk@782 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 08:41:41 +00:00
Wouter Wijngaards bce6c3405b nodefault test.
git-svn-id: file:///svn/unbound/trunk@781 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 08:26:57 +00:00
Wouter Wijngaards aa0c26ddec - tests for localdata multiple RR, and implicit zones.
- can specify TXT records for local data.



git-svn-id: file:///svn/unbound/trunk@780 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-28 08:10:45 +00:00
Wouter Wijngaards a1cbd214a5 Reduced operation sensitivity of message.
git-svn-id: file:///svn/unbound/trunk@779 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-27 16:18:09 +00:00
Wouter Wijngaards f64778a893 memory footprint improvements.
git-svn-id: file:///svn/unbound/trunk@778 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-27 15:52:41 +00:00
Wouter Wijngaards 9d3b5fa30d rfc2308 compliance.
git-svn-id: file:///svn/unbound/trunk@777 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-27 13:25:11 +00:00
Wouter Wijngaards 99590f93bd test and fixes.
git-svn-id: file:///svn/unbound/trunk@776 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-22 16:13:16 +00:00
Wouter Wijngaards b72563dcb7 local zone answers.
git-svn-id: file:///svn/unbound/trunk@775 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-22 13:48:58 +00:00
Wouter Wijngaards 6b0cf42b32 defaults.
git-svn-id: file:///svn/unbound/trunk@774 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-22 09:30:44 +00:00
Wouter Wijngaards 8df2959959 localzone internal data structures.
git-svn-id: file:///svn/unbound/trunk@773 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-21 16:19:31 +00:00
Wouter Wijngaards 1cda904545 localzon setup.
git-svn-id: file:///svn/unbound/trunk@772 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-20 16:38:41 +00:00
Wouter Wijngaards 416129dedb localzone and localdata configuration setup.
git-svn-id: file:///svn/unbound/trunk@771 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-20 14:48:33 +00:00
Wouter Wijngaards b9c417481b keep tcp address around for acl.
git-svn-id: file:///svn/unbound/trunk@770 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-19 16:31:22 +00:00
Wouter Wijngaards eda6528c14 access-control
git-svn-id: file:///svn/unbound/trunk@769 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-19 15:32:55 +00:00
Wouter Wijngaards fc8657c421 unit test for addr_in_common.
git-svn-id: file:///svn/unbound/trunk@767 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-19 13:21:30 +00:00
Wouter Wijngaards 5f50f5d2b4 unit test for addr_mask.
git-svn-id: file:///svn/unbound/trunk@766 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-19 13:02:15 +00:00
Wouter Wijngaards 31f803201d port from beta-0.7.1
git-svn-id: file:///svn/unbound/trunk@763 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-19 11:04:05 +00:00
Wouter Wijngaards ff975871ab fixup leaking unbound daemons.
git-svn-id: file:///svn/unbound/trunk@755 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-19 09:06:56 +00:00
Wouter Wijngaards 99a9914605 No downcasing for NSEC and RRSIG
git-svn-id: file:///svn/unbound/trunk@754 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-19 08:55:19 +00:00
Wouter Wijngaards 435fbd1794 acl list setup. 8 to tab in net_help.
git-svn-id: file:///svn/unbound/trunk@753 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-16 16:25:37 +00:00
Wouter Wijngaards fe09abe4e6 0.8 in trunk for auth features development.
git-svn-id: file:///svn/unbound/trunk@752 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-16 13:03:04 +00:00
Wouter Wijngaards e900e44f9f todo item is not needed at this time.
git-svn-id: file:///svn/unbound/trunk@750 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-16 12:53:57 +00:00
Wouter Wijngaards bfbac6bb36 Jakob in Credits.
git-svn-id: file:///svn/unbound/trunk@749 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-15 15:42:10 +00:00
Wouter Wijngaards cc21a1ca9a review fixups.
git-svn-id: file:///svn/unbound/trunk@748 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-15 14:27:47 +00:00
Wouter Wijngaards 919b1ab1b6 authority choices.
git-svn-id: file:///svn/unbound/trunk@747 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-14 15:07:54 +00:00
Wouter Wijngaards ad69492495 to 0.7
git-svn-id: file:///svn/unbound/trunk@745 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-14 13:38:13 +00:00
Wouter Wijngaards 2b2cfd7e4b fixup test for new default.
git-svn-id: file:///svn/unbound/trunk@744 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-14 09:51:22 +00:00
Wouter Wijngaards 84a3dbe660 testbed update.
git-svn-id: file:///svn/unbound/trunk@743 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-14 09:03:51 +00:00
Wouter Wijngaards d7b0d86b09 libevent signal problem has different signal handler registrations, and thus
needs handling in testbound, so that on a good exit, it does the exit.


git-svn-id: file:///svn/unbound/trunk@742 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-13 16:15:04 +00:00
Wouter Wijngaards bce5467f59 remove debug print.
git-svn-id: file:///svn/unbound/trunk@741 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-13 15:53:25 +00:00
Wouter Wijngaards a6ae1d6194 - bugreports to unbound-bugs@nlnetlabs.nl
- fixup testbound so it exits cleanly.
       - cleanup the caches on a reload, so that rrsetID numbers won't clash.


git-svn-id: file:///svn/unbound/trunk@740 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-12 13:58:34 +00:00
Wouter Wijngaards 0ee5532396 Fixup for signal handling. No more dangling unbound processes after
test suite.


git-svn-id: file:///svn/unbound/trunk@739 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-12 11:10:11 +00:00
Wouter Wijngaards 7c5182d3fd review.
git-svn-id: file:///svn/unbound/trunk@738 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-09 22:54:54 +00:00
Wouter Wijngaards d41f40b028 safer default interfaces.
git-svn-id: file:///svn/unbound/trunk@737 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-09 14:15:21 +00:00
Wouter Wijngaards 518e7511d7 default config file location, example conf installed.
git-svn-id: file:///svn/unbound/trunk@736 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-09 13:52:13 +00:00
Wouter Wijngaards 6048ba67fa Ldns fixup.
git-svn-id: file:///svn/unbound/trunk@735 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-09 09:50:48 +00:00
Wouter Wijngaards 0eddfd7528 new L root.
git-svn-id: file:///svn/unbound/trunk@734 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-08 13:02:02 +00:00
Wouter Wijngaards 3ed2f28b76 Fixup chroot (Thanks Jakob).
git-svn-id: file:///svn/unbound/trunk@733 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-08 10:44:30 +00:00
Wouter Wijngaards e9277fc201 harden off has more consequences.
git-svn-id: file:///svn/unbound/trunk@732 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-01 16:05:55 +00:00
Wouter Wijngaards 5d5f08e4fd fixup test.
git-svn-id: file:///svn/unbound/trunk@731 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-01 15:45:31 +00:00
Wouter Wijngaards a06131872d Harden dnssec stripped zones.
git-svn-id: file:///svn/unbound/trunk@730 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-01 15:32:27 +00:00
Wouter Wijngaards d2892aa5ab alloc id overflow handling.
git-svn-id: file:///svn/unbound/trunk@729 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-01 14:39:50 +00:00
Wouter Wijngaards 27c8952a2c touch up clear and verbose.
git-svn-id: file:///svn/unbound/trunk@728 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-01 13:22:12 +00:00
Wouter Wijngaards 5b966557cc chroot fixup.
git-svn-id: file:///svn/unbound/trunk@727 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-01 12:48:37 +00:00
Wouter Wijngaards 734abf9323 Fixup of reload bug.
git-svn-id: file:///svn/unbound/trunk@726 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-11-01 09:48:20 +00:00
Wouter Wijngaards 2725ad55fc hash clear function.
git-svn-id: file:///svn/unbound/trunk@725 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-31 16:15:44 +00:00
Wouter Wijngaards f79c387f3f - fix horrible oversight in sorting rrset references in a message,
sort per reference key pointer, not on referencepointer itself.
        - pidfile: "/etc/unbound/unbound.pid" is now the default.
        - tests changed to reflect the updated default.


git-svn-id: file:///svn/unbound/trunk@724 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-31 14:46:05 +00:00
Wouter Wijngaards 2e9785cfb5 better chroot support, and also default chroot and userchange.
git-svn-id: file:///svn/unbound/trunk@723 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-31 10:56:31 +00:00
Wouter Wijngaards 75c30382ba Build fix outside sourcedir.
git-svn-id: file:///svn/unbound/trunk@722 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-31 08:30:47 +00:00
Wouter Wijngaards fe44f5918a max ttl option.
git-svn-id: file:///svn/unbound/trunk@721 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-31 07:46:30 +00:00
Wouter Wijngaards 63dc8ffde2 ttl not greedy.
git-svn-id: file:///svn/unbound/trunk@720 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-30 21:40:16 +00:00
Wouter Wijngaards 2bb408e2aa Quieter low verbosity logging.
git-svn-id: file:///svn/unbound/trunk@719 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-30 14:59:01 +00:00
Wouter Wijngaards 0eb3149af5 Assertion incorrect. Compressed packets can be larger.
git-svn-id: file:///svn/unbound/trunk@718 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-30 13:40:43 +00:00
Wouter Wijngaards 298e1fd688 overload mode: too many queries situation is detected and queries are dropped.
git-svn-id: file:///svn/unbound/trunk@717 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-23 14:44:51 +00:00
Wouter Wijngaards 861483ac82 dnssec lame servers are used as last effort.
git-svn-id: file:///svn/unbound/trunk@716 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-23 12:37:18 +00:00
Wouter Wijngaards f92d51b3fe dnssec lameness detection improved to disable detection when not sure.
git-svn-id: file:///svn/unbound/trunk@715 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-23 08:30:21 +00:00
Wouter Wijngaards 633daf4bc7 dnssec lame detection.
git-svn-id: file:///svn/unbound/trunk@714 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-22 15:25:37 +00:00
Wouter Wijngaards b247774236 Detect recursion-lameness.
git-svn-id: file:///svn/unbound/trunk@713 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-22 12:05:46 +00:00
Wouter Wijngaards 63aa7463e8 ISO C
git-svn-id: file:///svn/unbound/trunk@712 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-22 09:14:29 +00:00
Wouter Wijngaards 280352760c Fixup tests.
git-svn-id: file:///svn/unbound/trunk@711 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-22 06:25:46 +00:00
Wouter Wijngaards f8dcdf6e3a And manual entry.
git-svn-id: file:///svn/unbound/trunk@710 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 18:11:04 +00:00
Wouter Wijngaards 2885210384 Donotquery for netblocks.
git-svn-id: file:///svn/unbound/trunk@709 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 18:09:11 +00:00
Wouter Wijngaards 253a6e0143 root-hints can be read from file.
git-svn-id: file:///svn/unbound/trunk@708 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 14:02:53 +00:00
Wouter Wijngaards 90df76f931 nicer error, random() improved.
git-svn-id: file:///svn/unbound/trunk@707 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 12:10:13 +00:00
Wouter Wijngaards 391504fd03 rework ldns-src inclusion.
git-svn-id: file:///svn/unbound/trunk@706 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 10:38:27 +00:00
Jelte Jansen da79cd57d9 hit me baby one more time
git-svn-id: file:///svn/unbound/trunk@705 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 08:37:27 +00:00
Wouter Wijngaards c8c099960a outgoing interfaces setting possible.
git-svn-id: file:///svn/unbound/trunk@704 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 08:32:36 +00:00
Jelte Jansen 3a84f02606 bsd-generated configlexer
git-svn-id: file:///svn/unbound/trunk@703 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 08:11:57 +00:00
Wouter Wijngaards 086b257b1d - lex fix
- unsecure validation neater
- const cast warning removal


git-svn-id: file:///svn/unbound/trunk@702 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-19 08:03:08 +00:00
Wouter Wijngaards f22716c237 Added yacc and lex files.
git-svn-id: file:///svn/unbound/trunk@701 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 22:49:08 +00:00
Wouter Wijngaards c74ae3212b and config.h.in.
git-svn-id: file:///svn/unbound/trunk@700 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 22:40:10 +00:00
Wouter Wijngaards b40163446e configure, ready to go.
git-svn-id: file:///svn/unbound/trunk@699 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 22:38:15 +00:00
Wouter Wijngaards ce11690aa1 keep cache of prealloced blocks.
git-svn-id: file:///svn/unbound/trunk@698 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 22:17:02 +00:00
Wouter Wijngaards 6f49c2fe55 regional nicer, remove region-allocator.
git-svn-id: file:///svn/unbound/trunk@697 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 20:31:43 +00:00
Wouter Wijngaards 63bef95aac regional.
git-svn-id: file:///svn/unbound/trunk@696 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 15:40:31 +00:00
Wouter Wijngaards f768fc1148 Ldns included.
git-svn-id: file:///svn/unbound/trunk@695 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 13:05:41 +00:00
Wouter Wijngaards 8e54424abc Fixup test with shorter timeout values.
git-svn-id: file:///svn/unbound/trunk@694 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 09:33:37 +00:00
Wouter Wijngaards c41d12bb94 Tests update.
git-svn-id: file:///svn/unbound/trunk@693 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 09:24:57 +00:00
Wouter Wijngaards 268ada0d33 errors have addresses with them.
git-svn-id: file:///svn/unbound/trunk@692 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-18 09:04:55 +00:00
Wouter Wijngaards 907ab3d99a failover to next server.
git-svn-id: file:///svn/unbound/trunk@691 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 19:23:01 +00:00
Wouter Wijngaards f12875c910 unit test fix.
git-svn-id: file:///svn/unbound/trunk@690 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 17:43:00 +00:00
Wouter Wijngaards 482658b1cc Faster timeouts, based on extracts of our logs.
git-svn-id: file:///svn/unbound/trunk@689 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 17:40:35 +00:00
Wouter Wijngaards 75792c34dc fixup insecure glue on referrals.
git-svn-id: file:///svn/unbound/trunk@688 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 15:48:54 +00:00
Wouter Wijngaards be0bdf0260 fixup test, less logging.
git-svn-id: file:///svn/unbound/trunk@687 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 14:49:12 +00:00
Wouter Wijngaards 08549c7610 remove warning.
git-svn-id: file:///svn/unbound/trunk@686 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 14:27:45 +00:00
Wouter Wijngaards 108539c94c fixup crashy.
git-svn-id: file:///svn/unbound/trunk@685 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 14:22:14 +00:00
Wouter Wijngaards a4d4d0fe3a no debug on low verbosity.
git-svn-id: file:///svn/unbound/trunk@684 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 14:10:46 +00:00
Wouter Wijngaards 9e732da50b Arc4random.
git-svn-id: file:///svn/unbound/trunk@683 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 12:08:34 +00:00
Wouter Wijngaards fe33f7c72c resolution fix.
git-svn-id: file:///svn/unbound/trunk@682 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-17 07:34:13 +00:00
Wouter Wijngaards 631ccb58bf size_t no underflow.
git-svn-id: file:///svn/unbound/trunk@681 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-16 14:39:27 +00:00
Wouter Wijngaards 189fafa1da buffer overflow code audit.
git-svn-id: file:///svn/unbound/trunk@680 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-16 13:03:57 +00:00
Wouter Wijngaards 4260a18fb1 assertions, zero termination for gethostname, log_hex without malloc.
git-svn-id: file:///svn/unbound/trunk@679 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-16 12:26:09 +00:00
Wouter Wijngaards 79f840acd4 require ldns-testns.
git-svn-id: file:///svn/unbound/trunk@678 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-15 14:47:22 +00:00
Wouter Wijngaards fed59bca84 fixup addr6 check.
git-svn-id: file:///svn/unbound/trunk@677 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-15 14:42:37 +00:00
Wouter Wijngaards aecdb781fc Fixup compression, and test for byteformat compression results.
git-svn-id: file:///svn/unbound/trunk@676 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-15 14:19:17 +00:00
Wouter Wijngaards bef17e9e7c fixup ip6 tcp.
git-svn-id: file:///svn/unbound/trunk@675 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-15 09:10:26 +00:00
Wouter Wijngaards 25da698bf1 disable rpath option.
git-svn-id: file:///svn/unbound/trunk@674 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-11 07:34:44 +00:00
Wouter Wijngaards 3aea7c2630 Fixup tests.
git-svn-id: file:///svn/unbound/trunk@673 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-10 09:33:27 +00:00
Wouter Wijngaards d4424931f4 no more AD bits, except when DO is set.
git-svn-id: file:///svn/unbound/trunk@672 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-09 15:33:40 +00:00
Wouter Wijngaards a5ac86f410 Fixup event callback checks.
git-svn-id: file:///svn/unbound/trunk@671 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-09 12:04:13 +00:00
Wouter Wijngaards aed61e4d8a whitelist does not work on events, due to deletions.
git-svn-id: file:///svn/unbound/trunk@670 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-09 11:58:58 +00:00
Wouter Wijngaards c46e1a1ee8 cleaner.
git-svn-id: file:///svn/unbound/trunk@669 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-09 07:53:35 +00:00
Wouter Wijngaards 2bfe2d5fe3 plan changes.
git-svn-id: file:///svn/unbound/trunk@668 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-09 07:46:57 +00:00
Wouter Wijngaards 75bfcb8c91 No early logfile open.
git-svn-id: file:///svn/unbound/trunk@667 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-09 07:43:32 +00:00
Wouter Wijngaards f4049b54c4 logfile first open bad permissions.
git-svn-id: file:///svn/unbound/trunk@666 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-09 07:11:14 +00:00
Wouter Wijngaards 9fec5d86d3 forgot whitelist entry.
git-svn-id: file:///svn/unbound/trunk@665 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-08 09:00:13 +00:00
Wouter Wijngaards f856eef411 fix warning on solaris.
git-svn-id: file:///svn/unbound/trunk@664 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-05 13:13:48 +00:00
Wouter Wijngaards 24d1ed15c4 please gcc more.
git-svn-id: file:///svn/unbound/trunk@663 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-05 13:02:50 +00:00
Wouter Wijngaards 26c4e7a182 please gcc on BSD.
git-svn-id: file:///svn/unbound/trunk@662 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-05 12:57:24 +00:00
Wouter Wijngaards 8e55996b7c function pointer whitelist for module operations. completing fptr work.
git-svn-id: file:///svn/unbound/trunk@661 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-05 12:42:25 +00:00
Wouter Wijngaards 2a547a35a7 function pointer whitelists on data types.
git-svn-id: file:///svn/unbound/trunk@660 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-05 11:41:12 +00:00
Wouter Wijngaards 9a60182c86 fptr whitelist network code callbacks.
git-svn-id: file:///svn/unbound/trunk@659 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-05 08:05:06 +00:00
Wouter Wijngaards 107a915c67 unbreak trunk.
git-svn-id: file:///svn/unbound/trunk@658 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-04 15:24:20 +00:00
Wouter Wijngaards 41e847df18 security audit changes.
git-svn-id: file:///svn/unbound/trunk@657 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-04 15:10:11 +00:00
Wouter Wijngaards 7ccfb10392 fixup nasty cache overwriting bug.
git-svn-id: file:///svn/unbound/trunk@656 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-03 19:11:50 +00:00
Wouter Wijngaards d4614cf1ce fixup cname out of unsec zone.
git-svn-id: file:///svn/unbound/trunk@655 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-03 13:33:23 +00:00
Wouter Wijngaards a740dfe195 Fixup and test.
git-svn-id: file:///svn/unbound/trunk@654 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-03 12:20:55 +00:00
Wouter Wijngaards a73089c5f0 loopfix.
git-svn-id: file:///svn/unbound/trunk@653 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-03 08:36:47 +00:00
Wouter Wijngaards 759f666177 regress test for CNAMEd address for nameserver.
git-svn-id: file:///svn/unbound/trunk@652 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-03 06:46:26 +00:00
Wouter Wijngaards e7883b13f4 crash fixup.
git-svn-id: file:///svn/unbound/trunk@651 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-01 14:55:08 +00:00
Wouter Wijngaards f0015b8919 skip unused tests.
git-svn-id: file:///svn/unbound/trunk@650 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-10-01 12:16:19 +00:00
Wouter Wijngaards 1115d50dce unbound-checkconf test.
git-svn-id: file:///svn/unbound/trunk@649 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-28 14:33:35 +00:00
Wouter Wijngaards dc34bb36b3 do lint, depend.
git-svn-id: file:///svn/unbound/trunk@648 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 15:01:22 +00:00
Wouter Wijngaards 8f8627a0c3 unbound-checkconf.
git-svn-id: file:///svn/unbound/trunk@647 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 13:39:49 +00:00
Wouter Wijngaards c2f8d43f9d fixup tests.
git-svn-id: file:///svn/unbound/trunk@646 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 11:29:37 +00:00
Wouter Wijngaards 6a482dc7f2 fixup test.
git-svn-id: file:///svn/unbound/trunk@645 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 11:15:42 +00:00
Wouter Wijngaards bc9f482b2a syslog feature.
git-svn-id: file:///svn/unbound/trunk@644 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-26 10:19:28 +00:00
Wouter Wijngaards 8659118a5e done items.
git-svn-id: file:///svn/unbound/trunk@643 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-25 14:01:30 +00:00
Wouter Wijngaards 01db268dff 0.5 release tag.
git-svn-id: file:///svn/unbound/trunk@642 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-25 13:00:26 +00:00
Wouter Wijngaards 6cb2b251c5 fixup exit status post test.
git-svn-id: file:///svn/unbound/trunk@641 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-25 12:29:24 +00:00
Wouter Wijngaards 41e1ffe1c4 no overload mode yet.
git-svn-id: file:///svn/unbound/trunk@640 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-25 12:25:37 +00:00
Wouter Wijngaards 5a6638fed0 test fixup.
git-svn-id: file:///svn/unbound/trunk@639 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-25 11:47:45 +00:00
Wouter Wijngaards fd3293a0ee NSEC3 tests, and fixup for qtype ANY wildcard proof.
git-svn-id: file:///svn/unbound/trunk@638 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-25 09:39:32 +00:00
Wouter Wijngaards 0f7ced491e NSEC3 test and fix for bitmap protection code.
git-svn-id: file:///svn/unbound/trunk@637 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-25 08:33:14 +00:00
Wouter Wijngaards 52e48a90ea NSEC3 tests.
git-svn-id: file:///svn/unbound/trunk@636 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-24 13:32:40 +00:00
Wouter Wijngaards 2a5bcffcc2 Make test command.
git-svn-id: file:///svn/unbound/trunk@635 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-24 08:04:05 +00:00
Wouter Wijngaards 931efbbaa0 Fixup and test for nonrec loop case.
git-svn-id: file:///svn/unbound/trunk@634 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 20:30:04 +00:00
Wouter Wijngaards 74468b2edb debug
git-svn-id: file:///svn/unbound/trunk@633 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 15:45:32 +00:00
Wouter Wijngaards f2ba9e985b overload mode is a TODO.
git-svn-id: file:///svn/unbound/trunk@632 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 15:12:31 +00:00
Wouter Wijngaards 553ebaf7a9 argument format.
git-svn-id: file:///svn/unbound/trunk@631 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 14:35:07 +00:00
Wouter Wijngaards 5043992159 remove subscript char warnings.
git-svn-id: file:///svn/unbound/trunk@630 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 14:15:05 +00:00
Wouter Wijngaards 463bd32b26 fixup locking in test code.
git-svn-id: file:///svn/unbound/trunk@629 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 13:55:07 +00:00
Wouter Wijngaards a81e19a6eb Fixup alloc in wrong region.
git-svn-id: file:///svn/unbound/trunk@628 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-21 13:34:44 +00:00
Wouter Wijngaards db695709e6 plans.
git-svn-id: file:///svn/unbound/trunk@627 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-20 14:39:22 +00:00
Wouter Wijngaards 62e37fe3ee quick fixup
git-svn-id: file:///svn/unbound/trunk@626 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-20 12:46:19 +00:00
Wouter Wijngaards c6e92c19b2 more liberal for ANS ENT bug. Fixup DS ENT handling too.
git-svn-id: file:///svn/unbound/trunk@625 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-20 12:31:35 +00:00
Wouter Wijngaards 9865f38f69 Fixup for a wildcarded NSEC with empty nonterminal query.
git-svn-id: file:///svn/unbound/trunk@624 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-20 11:37:15 +00:00
Wouter Wijngaards 8959cd47a8 NSEC rdata not lowercased.
git-svn-id: file:///svn/unbound/trunk@623 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-19 12:34:42 +00:00
Wouter Wijngaards c968fc7581 fixup glue timeout problems, and priming with safety belt.
git-svn-id: file:///svn/unbound/trunk@622 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-19 12:17:42 +00:00
Wouter Wijngaards cbd9764601 plan and comments.
git-svn-id: file:///svn/unbound/trunk@621 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-19 09:20:24 +00:00
Wouter Wijngaards 9c1f6e2df5 test ideas.
git-svn-id: file:///svn/unbound/trunk@620 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-18 14:24:41 +00:00
Wouter Wijngaards e8bcec4529 print validator classification type.
update plan items.


git-svn-id: file:///svn/unbound/trunk@619 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-18 12:33:51 +00:00
Wouter Wijngaards c4392dd54c wildcard nsec3 tests.
git-svn-id: file:///svn/unbound/trunk@618 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-18 08:28:35 +00:00
Wouter Wijngaards 748bfb0b0e more nsec3 tests.
git-svn-id: file:///svn/unbound/trunk@617 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-17 14:52:14 +00:00
Wouter Wijngaards 6510d8f20a namerror nsec3 proof works.
git-svn-id: file:///svn/unbound/trunk@616 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-17 14:03:35 +00:00
Wouter Wijngaards c7d15770c1 nsec3 hash function unit test.
git-svn-id: file:///svn/unbound/trunk@615 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-17 09:25:54 +00:00
Wouter Wijngaards 48aec18ef7 Fixup qname after prepend.
git-svn-id: file:///svn/unbound/trunk@614 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-14 14:05:52 +00:00
Wouter Wijngaards 7987b687dc NSEC3.
git-svn-id: file:///svn/unbound/trunk@613 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-14 11:15:42 +00:00
Wouter Wijngaards b22e1d4273 Use nsec3s_seen flag for speedup.
git-svn-id: file:///svn/unbound/trunk@612 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-13 15:11:25 +00:00
Wouter Wijngaards 92198b3624 if no NSEC3 present, skip validation.
git-svn-id: file:///svn/unbound/trunk@611 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-13 15:09:58 +00:00
Wouter Wijngaards facde2ca10 nsec3 work, prove name error.
git-svn-id: file:///svn/unbound/trunk@610 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-13 15:02:33 +00:00
Wouter Wijngaards d85debfae4 nsec3 work.
git-svn-id: file:///svn/unbound/trunk@609 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-12 14:16:46 +00:00
Wouter Wijngaards db452ffc16 manual page warning fix.
git-svn-id: file:///svn/unbound/trunk@608 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-12 05:59:45 +00:00
Wouter Wijngaards 26f9ea8942 nsec3 work.
git-svn-id: file:///svn/unbound/trunk@607 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-11 18:18:16 +00:00
Wouter Wijngaards b0b9193603 rwlock optional.
git-svn-id: file:///svn/unbound/trunk@606 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-07 13:28:23 +00:00
Wouter Wijngaards d2bf27acd7 search order.
git-svn-id: file:///svn/unbound/trunk@605 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-06 09:29:15 +00:00
Wouter Wijngaards 149ff1cd5a please older gcc.
git-svn-id: file:///svn/unbound/trunk@604 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-06 09:16:43 +00:00
Wouter Wijngaards 08bf892be6 port.
git-svn-id: file:///svn/unbound/trunk@603 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-06 09:14:13 +00:00
Wouter Wijngaards ab316be813 Find libevent on mac port.
git-svn-id: file:///svn/unbound/trunk@602 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-06 09:00:46 +00:00
Wouter Wijngaards 5134e8e1ae Fixup unused warnings when running without threads.
git-svn-id: file:///svn/unbound/trunk@601 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 14:56:38 +00:00
Wouter Wijngaards 4736eaf80d fixup memdebug option on solaris.
git-svn-id: file:///svn/unbound/trunk@600 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 14:07:53 +00:00
Wouter Wijngaards a404373112 and documentation.
git-svn-id: file:///svn/unbound/trunk@599 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 13:52:23 +00:00
Wouter Wijngaards 5f9e30aacb configure option for memory allocation debugging.
git-svn-id: file:///svn/unbound/trunk@598 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 13:47:23 +00:00
Wouter Wijngaards 7b76e85956 todo item.
git-svn-id: file:///svn/unbound/trunk@597 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 13:26:16 +00:00
Wouter Wijngaards cb3044c09d wildcard NSECs.
git-svn-id: file:///svn/unbound/trunk@596 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 12:58:25 +00:00
Wouter Wijngaards 009a68a795 QTYPE CNAME test.
git-svn-id: file:///svn/unbound/trunk@595 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 11:58:45 +00:00
Wouter Wijngaards f52b202747 trust anchor denial test.
git-svn-id: file:///svn/unbound/trunk@594 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 11:47:09 +00:00
Wouter Wijngaards a9ea07cbb3 test for referral with and without a DS.
git-svn-id: file:///svn/unbound/trunk@593 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 11:06:42 +00:00
Wouter Wijngaards e384cdaf70 any with DNAME record (test for synthesis of CNAME).
git-svn-id: file:///svn/unbound/trunk@592 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 09:54:18 +00:00
Wouter Wijngaards 18a5fb1fc5 ANY response validation test.
git-svn-id: file:///svn/unbound/trunk@591 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 09:50:02 +00:00
Wouter Wijngaards bf02cdbf5c nxdomain tests.
git-svn-id: file:///svn/unbound/trunk@590 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 09:04:51 +00:00
Wouter Wijngaards 4d473bd618 cname and dname tests.
git-svn-id: file:///svn/unbound/trunk@589 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-05 08:54:27 +00:00
Wouter Wijngaards 496c91c250 signature validation of different parts of a CNAME'd message works.
git-svn-id: file:///svn/unbound/trunk@588 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-04 15:29:28 +00:00
Wouter Wijngaards 91786f4cc6 fixup AUTH prepend list.
git-svn-id: file:///svn/unbound/trunk@587 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-04 14:06:43 +00:00
Wouter Wijngaards 359d9ec426 test for dname wildcard.
git-svn-id: file:///svn/unbound/trunk@586 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-04 13:10:06 +00:00
Wouter Wijngaards d45774fe03 wildcard DNAME detect
git-svn-id: file:///svn/unbound/trunk@585 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-04 12:57:40 +00:00
Wouter Wijngaards 0e11cd160d DNAME synthesis and validation fixups.
git-svn-id: file:///svn/unbound/trunk@584 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-04 12:44:43 +00:00
Wouter Wijngaards bb67a404fb tests, cleanup tmp when testbound fails, fixup referral glue cleanup.
git-svn-id: file:///svn/unbound/trunk@583 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-04 11:31:29 +00:00
Wouter Wijngaards 4016aa755e No leakage warning for double serviced callback.
git-svn-id: file:///svn/unbound/trunk@582 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-04 07:57:06 +00:00
Wouter Wijngaards b33c39334b please lint.
git-svn-id: file:///svn/unbound/trunk@581 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-03 14:05:38 +00:00
Wouter Wijngaards 6fe044de03 debug tool for mem stats.
git-svn-id: file:///svn/unbound/trunk@580 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-03 13:40:17 +00:00
Wouter Wijngaards 81fe98956c lame cache in bytes.
git-svn-id: file:///svn/unbound/trunk@579 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-03 10:19:10 +00:00
Wouter Wijngaards ab143fd1f8 fixup lameness cache memory accounting leak.
git-svn-id: file:///svn/unbound/trunk@578 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-03 10:08:16 +00:00
Wouter Wijngaards eb0deb1301 spurious memory leak (+364 bytes) removed during tcp timeout callback.
git-svn-id: file:///svn/unbound/trunk@577 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-03 09:45:18 +00:00
Wouter Wijngaards 8351afe61a cname nxdomain fixup.
git-svn-id: file:///svn/unbound/trunk@576 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-09-03 09:13:27 +00:00
Wouter Wijngaards edbbacecf9 referral test, sig removal.
git-svn-id: file:///svn/unbound/trunk@575 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-31 13:15:25 +00:00
Wouter Wijngaards 1e5a3fb786 fixup test
git-svn-id: file:///svn/unbound/trunk@574 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-31 12:58:23 +00:00
Wouter Wijngaards 7f4a12c652 positive check.
git-svn-id: file:///svn/unbound/trunk@573 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-31 12:49:17 +00:00
Wouter Wijngaards 49bb418691 Nodata tests.
git-svn-id: file:///svn/unbound/trunk@572 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-31 12:35:41 +00:00
Wouter Wijngaards 2540d6c511 iterator works better with failing hosts.
git-svn-id: file:///svn/unbound/trunk@571 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-31 09:38:55 +00:00
Wouter Wijngaards fd7af10ff6 please lint.
git-svn-id: file:///svn/unbound/trunk@570 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-31 07:56:00 +00:00
Wouter Wijngaards f304a2a459 can read bind-style config files for trust anchor information.
git-svn-id: file:///svn/unbound/trunk@569 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-31 07:44:16 +00:00
Wouter Wijngaards fceea2bcd5 bind config trusted keys read work.
git-svn-id: file:///svn/unbound/trunk@568 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-30 15:36:23 +00:00
Wouter Wijngaards 45297772c9 crypto cleanups at exit.
git-svn-id: file:///svn/unbound/trunk@567 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-30 13:38:52 +00:00
Wouter Wijngaards a22a3b1669 Memory cleanup.
- caught bad free of un-alloced data in worker_send error case.
       - memory accounting for key cache (trust anchors and temporary cache).
       - memory accounting fixup for outside network tcp pending waits.
       - memory accounting fixup for outside network tcp callbacks.
       - memory accounting for iterator fixed storage.
       - key cache size and slabs config options.


git-svn-id: file:///svn/unbound/trunk@566 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-30 12:45:19 +00:00
Wouter Wijngaards 341492391e support extremely small memory footprints.
git-svn-id: file:///svn/unbound/trunk@565 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-30 08:36:41 +00:00
Wouter Wijngaards de6d807e3d no convert to der for DSA signatures
signature test.


git-svn-id: file:///svn/unbound/trunk@564 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-29 14:27:04 +00:00
Wouter Wijngaards 134db23ea8 validate by default.
git-svn-id: file:///svn/unbound/trunk@563 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-29 13:27:21 +00:00
Wouter Wijngaards e8a709a315 please lint.
git-svn-id: file:///svn/unbound/trunk@562 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-29 12:20:25 +00:00
Wouter Wijngaards dd9da95c70 sign test tool.
git-svn-id: file:///svn/unbound/trunk@561 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-29 12:09:14 +00:00
Wouter Wijngaards 824ceffedb verbosity detail gives validation failures, but not boring algorithm logs.
git-svn-id: file:///svn/unbound/trunk@560 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 15:07:52 +00:00
Wouter Wijngaards e839035a7a doc fixup.
git-svn-id: file:///svn/unbound/trunk@559 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 14:14:20 +00:00
Wouter Wijngaards 3d832f5dca Small speedup.
git-svn-id: file:///svn/unbound/trunk@558 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 14:13:32 +00:00
Wouter Wijngaards 459039cf08 Faster verification.
git-svn-id: file:///svn/unbound/trunk@557 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 13:54:55 +00:00
Wouter Wijngaards 60470b186e permissive mode feature.
git-svn-id: file:///svn/unbound/trunk@556 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 11:53:27 +00:00
Wouter Wijngaards c988905aa4 enforce signature TTLs
git-svn-id: file:///svn/unbound/trunk@555 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 10:26:16 +00:00
Wouter Wijngaards af2b300529 No offtree signing.
git-svn-id: file:///svn/unbound/trunk@554 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 09:47:17 +00:00
Wouter Wijngaards 0e90c03e95 Referral validation.
git-svn-id: file:///svn/unbound/trunk@553 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 09:39:43 +00:00
Wouter Wijngaards f293924be8 No double use of buffers.
git-svn-id: file:///svn/unbound/trunk@552 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-28 08:03:45 +00:00
Wouter Wijngaards f9cc9481e2 validator also computes insecure and indeterminate for rrsets and stores
that.


git-svn-id: file:///svn/unbound/trunk@551 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-27 14:55:06 +00:00
Wouter Wijngaards 542b812690 do not cache nonRD replies in msg cache, the rrset cache is used for that.
store verification status in rrset cache to enable security for nonRD
replies and also speed up processing.


git-svn-id: file:///svn/unbound/trunk@550 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-27 13:46:05 +00:00
Wouter Wijngaards 674fdd5e39 send recursive queries to test cache drop off.
git-svn-id: file:///svn/unbound/trunk@549 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-27 11:26:03 +00:00
Wouter Wijngaards c9107bfb1a answer non-recursive straight from cache, if possible.
git-svn-id: file:///svn/unbound/trunk@548 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-27 09:53:16 +00:00
Wouter Wijngaards 5a62edfc26 larger default infra cache.
git-svn-id: file:///svn/unbound/trunk@547 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-24 14:58:36 +00:00
Wouter Wijngaards 87fafec48a DS and DNSKEY not from additional synthesis. Nicer signature expiration errors.
git-svn-id: file:///svn/unbound/trunk@546 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-24 13:14:23 +00:00
Wouter Wijngaards a490e8777f Fixup.
git-svn-id: file:///svn/unbound/trunk@545 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-24 12:24:07 +00:00
Wouter Wijngaards 3a422ba496 prettier proof routines.
git-svn-id: file:///svn/unbound/trunk@544 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-24 10:36:15 +00:00
Wouter Wijngaards 6890f55d17 refuse unsigned authority section. clean additional section as option.
git-svn-id: file:///svn/unbound/trunk@543 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-24 09:44:29 +00:00
Wouter Wijngaards b54a0400ab CNAME validation.
git-svn-id: file:///svn/unbound/trunk@542 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-23 15:23:45 +00:00
Wouter Wijngaards a7001366a1 review change.
git-svn-id: file:///svn/unbound/trunk@541 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-22 14:29:24 +00:00
Wouter Wijngaards a084af819c bogus ttl fixed value, config item.
git-svn-id: file:///svn/unbound/trunk@540 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-22 12:13:52 +00:00
Wouter Wijngaards 5c9f7c00ba manpage entry.
git-svn-id: file:///svn/unbound/trunk@539 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-21 20:45:31 +00:00
Wouter Wijngaards cf4ef6fbaf construct DS and DNSKEY from cache.
git-svn-id: file:///svn/unbound/trunk@538 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-21 14:05:10 +00:00
Wouter Wijngaards 9c8fd98719 Fixup.
git-svn-id: file:///svn/unbound/trunk@537 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-21 13:27:04 +00:00
Wouter Wijngaards 272096d611 Returns and caches validated replies.
git-svn-id: file:///svn/unbound/trunk@536 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-21 13:12:10 +00:00
Wouter Wijngaards 834a8fc30f any response validation.
git-svn-id: file:///svn/unbound/trunk@535 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-21 07:58:55 +00:00
Wouter Wijngaards 0f9ae7acd8 nxdomain validation.
git-svn-id: file:///svn/unbound/trunk@534 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-20 14:27:11 +00:00
Wouter Wijngaards 5605f8d003 nodata validation.
git-svn-id: file:///svn/unbound/trunk@533 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-20 13:39:58 +00:00
Wouter Wijngaards 1b42a51048 VALIDATE state and positive response validation.
git-svn-id: file:///svn/unbound/trunk@532 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-20 12:31:12 +00:00
Wouter Wijngaards 3f8b0b1cfe handle DNSKEY response state.
git-svn-id: file:///svn/unbound/trunk@531 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-20 08:10:57 +00:00
Wouter Wijngaards 453df0c66c nsec work, canonical compare routine and tests.
git-svn-id: file:///svn/unbound/trunk@530 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-17 14:25:42 +00:00
Wouter Wijngaards cedeaa8316 ds2ke and nsec work.
git-svn-id: file:///svn/unbound/trunk@529 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-17 11:41:49 +00:00
Wouter Wijngaards 9ddbb430ef findkey state.
git-svn-id: file:///svn/unbound/trunk@528 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-16 15:06:40 +00:00
Wouter Wijngaards 568f0699dc Fixup bug in response type calculation.
git-svn-id: file:///svn/unbound/trunk@527 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-16 13:35:37 +00:00
Wouter Wijngaards 24aad68487 fixup canon compare. Include full AXFR data in signature test.
git-svn-id: file:///svn/unbound/trunk@526 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-16 10:05:52 +00:00
Wouter Wijngaards e4aa70b4c5 key prime, DS test.
git-svn-id: file:///svn/unbound/trunk@525 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-16 09:33:35 +00:00
Wouter Wijngaards f6371f11a4 updated after resign.
git-svn-id: file:///svn/unbound/trunk@524 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-15 14:20:54 +00:00
Wouter Wijngaards ce290651d0 unit test will fail, but this fixes canonical order in unbound, waiting
for ldns fix.


git-svn-id: file:///svn/unbound/trunk@523 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-15 14:09:00 +00:00
Wouter Wijngaards 1d29f79974 verify unit test.
git-svn-id: file:///svn/unbound/trunk@522 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-15 13:18:32 +00:00
Wouter Wijngaards 927af50c81 please lint.
git-svn-id: file:///svn/unbound/trunk@521 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-15 09:04:44 +00:00
Wouter Wijngaards f06b1e8ef3 crypto verify routines.
git-svn-id: file:///svn/unbound/trunk@520 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-15 08:39:00 +00:00
Wouter Wijngaards c2b1ad1418 please lint.
git-svn-id: file:///svn/unbound/trunk@519 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 20:07:35 +00:00
Wouter Wijngaards 9db2d3fa78 cycle detection fix.
git-svn-id: file:///svn/unbound/trunk@518 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 19:42:36 +00:00
Wouter Wijngaards 8a290f6a16 Fixup parser, new test.
git-svn-id: file:///svn/unbound/trunk@517 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 15:33:07 +00:00
Wouter Wijngaards 016f27739d header fix.
git-svn-id: file:///svn/unbound/trunk@516 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 13:42:33 +00:00
Wouter Wijngaards c49a3af953 please lint.
git-svn-id: file:///svn/unbound/trunk@515 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 13:37:31 +00:00
Wouter Wijngaards 7d07e1b9c3 enable for lock checks.
git-svn-id: file:///svn/unbound/trunk@514 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 13:33:41 +00:00
Wouter Wijngaards f8719c1aa1 please lint and doxygen.
git-svn-id: file:///svn/unbound/trunk@513 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 13:18:50 +00:00
Wouter Wijngaards 448a9f414f fixups for memory.
git-svn-id: file:///svn/unbound/trunk@512 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-14 13:15:36 +00:00
Wouter Wijngaards 86723bd032 More logging.
git-svn-id: file:///svn/unbound/trunk@511 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-13 12:23:49 +00:00
Wouter Wijngaards 0374d468c8 hinfo treatment.
git-svn-id: file:///svn/unbound/trunk@510 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-13 11:53:24 +00:00
Wouter Wijngaards 2157540f35 makefile nicer in case flex is missing.
canonical compare.


git-svn-id: file:///svn/unbound/trunk@509 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-13 10:27:44 +00:00
Wouter Wijngaards 749ee526e8 canonical sort.
git-svn-id: file:///svn/unbound/trunk@508 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-10 15:12:06 +00:00
Wouter Wijngaards b12ae95d1d total allocation tracking.
git-svn-id: file:///svn/unbound/trunk@507 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-10 09:07:19 +00:00
Wouter Wijngaards 1dd6ef9f24 doc fixup for mac users.
git-svn-id: file:///svn/unbound/trunk@506 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-09 15:23:36 +00:00
Wouter Wijngaards 5166d65ea2 debug override date config option.
git-svn-id: file:///svn/unbound/trunk@505 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-09 15:16:25 +00:00
Wouter Wijngaards 9ada9f1093 -R ssl.
git-svn-id: file:///svn/unbound/trunk@504 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-09 11:52:24 +00:00
Wouter Wijngaards d5e4fa21de memory indication.
typo fix.


git-svn-id: file:///svn/unbound/trunk@503 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-09 10:14:32 +00:00
Wouter Wijngaards 45f95a18af rrsig checks.
git-svn-id: file:///svn/unbound/trunk@502 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-09 09:58:04 +00:00
Wouter Wijngaards 8f58908f45 sigcrypt keyset processing
git-svn-id: file:///svn/unbound/trunk@501 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-08 13:59:57 +00:00
Wouter Wijngaards bdb519c5c1 use sigcrypt.
git-svn-id: file:///svn/unbound/trunk@500 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-08 13:02:53 +00:00
Wouter Wijngaards 7726691af9 sigcrypt work.
git-svn-id: file:///svn/unbound/trunk@499 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-08 11:45:54 +00:00
Wouter Wijngaards eb5ab1f8e6 sigcrypt.
git-svn-id: file:///svn/unbound/trunk@498 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-07 15:18:25 +00:00
Wouter Wijngaards b2639ba961 val_util work.
git-svn-id: file:///svn/unbound/trunk@497 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-07 14:30:01 +00:00
Wouter Wijngaards c3a5bcb8d4 id number change
git-svn-id: file:///svn/unbound/trunk@496 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-07 09:24:20 +00:00
Wouter Wijngaards ff4f04de2a security status.
git-svn-id: file:///svn/unbound/trunk@495 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-07 08:27:23 +00:00
Wouter Wijngaards b24aac895f prime work.
git-svn-id: file:///svn/unbound/trunk@494 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-06 15:56:12 +00:00
Wouter Wijngaards 188bfacd05 validator work.
git-svn-id: file:///svn/unbound/trunk@493 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-06 12:57:29 +00:00
Wouter Wijngaards 4eaa855db9 dname isroot and dellabel
git-svn-id: file:///svn/unbound/trunk@492 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-06 11:06:00 +00:00
Wouter Wijngaards 44560e40ea key cache.
git-svn-id: file:///svn/unbound/trunk@491 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-06 09:34:58 +00:00
Wouter Wijngaards 1d83bb84ed key entry.
git-svn-id: file:///svn/unbound/trunk@490 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 14:56:24 +00:00
Wouter Wijngaards 9ebbdbabd3 create rrsets for verification later.
git-svn-id: file:///svn/unbound/trunk@489 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 14:12:28 +00:00
Wouter Wijngaards 6d8e67e7f9 oops.
git-svn-id: file:///svn/unbound/trunk@488 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 13:15:30 +00:00
Wouter Wijngaards eb1b1e6044 unit test trust anchor storage.
git-svn-id: file:///svn/unbound/trunk@487 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 13:15:16 +00:00
Wouter Wijngaards d48e17e1dd trust anchor storage and config.
git-svn-id: file:///svn/unbound/trunk@486 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 11:51:20 +00:00
Wouter Wijngaards 669a20084c check section.
git-svn-id: file:///svn/unbound/trunk@485 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 09:16:16 +00:00
Wouter Wijngaards 6b8f7df843 explanation for harden-glue.
git-svn-id: file:///svn/unbound/trunk@484 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 09:13:54 +00:00
Wouter Wijngaards 37a906991e replan
git-svn-id: file:///svn/unbound/trunk@483 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-03 08:45:06 +00:00
Wouter Wijngaards fd3e3ed05b validator, trust anchors.
git-svn-id: file:///svn/unbound/trunk@482 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 15:45:32 +00:00
Wouter Wijngaards ce12d59957 validator work.
git-svn-id: file:///svn/unbound/trunk@481 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 14:36:20 +00:00
Wouter Wijngaards c70c747c04 nicer walk_supers.
git-svn-id: file:///svn/unbound/trunk@480 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 12:22:29 +00:00
Wouter Wijngaards 6849c1030b passing of control between modules.
git-svn-id: file:///svn/unbound/trunk@479 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 12:13:08 +00:00
Wouter Wijngaards 947bd1ab91 Fixup scrubber and lameness.
git-svn-id: file:///svn/unbound/trunk@478 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 11:44:17 +00:00
Wouter Wijngaards c9a1cdec68 For test ldns.
git-svn-id: file:///svn/unbound/trunk@477 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 09:58:24 +00:00
Wouter Wijngaards dba780a00c Fixup duplicate delegations.
git-svn-id: file:///svn/unbound/trunk@476 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 09:21:58 +00:00
Wouter Wijngaards 4f8f9f2f74 choice.
git-svn-id: file:///svn/unbound/trunk@475 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 09:13:32 +00:00
Wouter Wijngaards 630d9dbc94 remove done and supers module interface calls.
git-svn-id: file:///svn/unbound/trunk@474 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 08:07:50 +00:00
Wouter Wijngaards c3f6bcb89a config change for libevent (newest).
git-svn-id: file:///svn/unbound/trunk@473 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-02 07:25:55 +00:00
Wouter Wijngaards 62b02dc911 don't fall through the if
git-svn-id: file:///svn/unbound/trunk@472 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-01 14:10:51 +00:00
Wouter Wijngaards 2122b961d3 callbacks via module specific function for walk_supers.
part of a move towards multiple modules for meshes.


git-svn-id: file:///svn/unbound/trunk@471 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-01 14:01:34 +00:00
Wouter Wijngaards 56916e48fb prime flag moved.
git-svn-id: file:///svn/unbound/trunk@470 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-01 12:59:37 +00:00
Wouter Wijngaards ec4878be75 query flags for detect cycle.
git-svn-id: file:///svn/unbound/trunk@469 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-01 11:29:12 +00:00
Wouter Wijngaards ac895c6d35 module configuration option.
git-svn-id: file:///svn/unbound/trunk@468 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-08-01 11:17:30 +00:00
Wouter Wijngaards 39e8652152 release 0.4 tag
git-svn-id: file:///svn/unbound/trunk@467 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-31 14:41:43 +00:00
Wouter Wijngaards cc94a2e202 todo, plan.
git-svn-id: file:///svn/unbound/trunk@466 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-31 08:11:48 +00:00
Wouter Wijngaards 7c219b4917 more todo.
git-svn-id: file:///svn/unbound/trunk@465 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-31 07:54:10 +00:00
Wouter Wijngaards b7052aa56a fixup fwd_three for default timeout.
git-svn-id: file:///svn/unbound/trunk@464 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-30 09:34:48 +00:00
Wouter Wijngaards dc4d8d2838 random number seed pid-tid fixup, todo.
git-svn-id: file:///svn/unbound/trunk@463 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-30 09:27:49 +00:00
Wouter Wijngaards 5f9edd6ca6 Updated planning.
git-svn-id: file:///svn/unbound/trunk@462 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-27 12:18:58 +00:00
Wouter Wijngaards 498a10a492 Credits file.
git-svn-id: file:///svn/unbound/trunk@461 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-27 07:34:54 +00:00
Wouter Wijngaards bb73083132 doc update
git-svn-id: file:///svn/unbound/trunk@460 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-27 07:22:30 +00:00
Wouter Wijngaards 912999e187 Removed unused -C commandline option (was for debug).
git-svn-id: file:///svn/unbound/trunk@459 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-27 06:41:42 +00:00
Wouter Wijngaards 185a7cd276 unput test.
git-svn-id: file:///svn/unbound/trunk@458 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-26 13:05:47 +00:00
Jelte Jansen b2b5b1e7f9 ignore aclocal.m4
git-svn-id: file:///svn/unbound/trunk@457 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-26 12:35:41 +00:00
Jelte Jansen ca9a8ae1bd updated to new 32bit arguments in ldns api
git-svn-id: file:///svn/unbound/trunk@456 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-26 12:26:16 +00:00
Wouter Wijngaards 78032304ca remove warning.
git-svn-id: file:///svn/unbound/trunk@455 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-26 11:35:38 +00:00
Wouter Wijngaards a037e0317c cycle detection test. TODO items
git-svn-id: file:///svn/unbound/trunk@454 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-26 10:04:05 +00:00
Wouter Wijngaards 3eb8f9028b AXFR IXFR test
git-svn-id: file:///svn/unbound/trunk@453 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-26 09:39:08 +00:00
Wouter Wijngaards 85bfa1bd35 cycle detection
git-svn-id: file:///svn/unbound/trunk@452 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-26 09:29:21 +00:00
Wouter Wijngaards 9bd8d5a929 glue fetch tested.
git-svn-id: file:///svn/unbound/trunk@451 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-25 14:12:44 +00:00
Wouter Wijngaards 8b0bbc6691 Tests can handle multiple hosts. Tests for chaos and iterator.
git-svn-id: file:///svn/unbound/trunk@450 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-25 12:31:04 +00:00
Wouter Wijngaards 84a1152109 addr.
git-svn-id: file:///svn/unbound/trunk@449 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-24 16:26:40 +00:00
Wouter Wijngaards ba1bda607b example config section in manual.
git-svn-id: file:///svn/unbound/trunk@448 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-24 10:12:18 +00:00
Wouter Wijngaards 1460965467 Memory reporting.
git-svn-id: file:///svn/unbound/trunk@447 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-20 15:51:06 +00:00
Wouter Wijngaards 522220494a name change. todo.
git-svn-id: file:///svn/unbound/trunk@446 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-20 14:16:02 +00:00
Wouter Wijngaards d2fd438713 Refetch glue code.
git-svn-id: file:///svn/unbound/trunk@445 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-20 09:41:44 +00:00
Wouter Wijngaards 8277eabcaf And changelog entry.
git-svn-id: file:///svn/unbound/trunk@444 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-20 09:13:49 +00:00
Wouter Wijngaards 84b0f323b5 Option to disable sanitize (normalize is still active), speeds up. But
some spoofing scenarios become possible. Default is the safe method.


git-svn-id: file:///svn/unbound/trunk@443 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-20 09:12:06 +00:00
Wouter Wijngaards 62287e64f7 Fill missing addresses for a delegation from the cache (if possible).
git-svn-id: file:///svn/unbound/trunk@442 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-20 07:14:36 +00:00
Wouter Wijngaards 306eda3809 check of CNAME chain in replies from cache.
git-svn-id: file:///svn/unbound/trunk@441 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-20 06:17:45 +00:00
Wouter Wijngaards 1d6715544a cname chain caching (part).
git-svn-id: file:///svn/unbound/trunk@440 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-19 15:16:39 +00:00
Wouter Wijngaards 4e4fabfc40 please lint
git-svn-id: file:///svn/unbound/trunk@439 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-19 14:10:09 +00:00
Wouter Wijngaards 5e48023c6c version.server and consorts support.
git-svn-id: file:///svn/unbound/trunk@438 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-19 13:50:00 +00:00
Wouter Wijngaards a96e895bc9 fixup of join deadlock warnings.
git-svn-id: file:///svn/unbound/trunk@437 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-19 11:32:47 +00:00
Wouter Wijngaards 55630293b9 shuffle NS selection randomly for getting addresses.
git-svn-id: file:///svn/unbound/trunk@436 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-19 09:25:55 +00:00
Wouter Wijngaards 59501db3bd test fixup, 127.0.0.1 is blocked.
git-svn-id: file:///svn/unbound/trunk@435 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-18 08:24:44 +00:00
Wouter Wijngaards 0b9807d677 Do not query addresses and configuration.
git-svn-id: file:///svn/unbound/trunk@434 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-18 08:14:44 +00:00
Wouter Wijngaards 9db3f47b98 please doxygen
git-svn-id: file:///svn/unbound/trunk@433 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-17 15:30:39 +00:00
Wouter Wijngaards c7883a9ebe Remove old forwarder mode, new @port option and tests ported over.
git-svn-id: file:///svn/unbound/trunk@432 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-17 15:26:45 +00:00
Wouter Wijngaards ab7a6bc2b9 more test
git-svn-id: file:///svn/unbound/trunk@431 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-17 14:07:40 +00:00
Wouter Wijngaards dc434596e4 testing.
git-svn-id: file:///svn/unbound/trunk@430 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-17 13:53:47 +00:00
Wouter Wijngaards 62dd62efd0 forward zones.
git-svn-id: file:///svn/unbound/trunk@429 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-07-17 13:45:45 +00:00
Wouter Wijngaards 6907d9a989 Histogram
git-svn-id: file:///svn/unbound/trunk@428 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-27 14:59:44 +00:00
Wouter Wijngaards 959088280f Do not select servers that are known to not give replies.
git-svn-id: file:///svn/unbound/trunk@427 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-27 13:26:32 +00:00
Wouter Wijngaards 5a66104adb fixup memory leak.
git-svn-id: file:///svn/unbound/trunk@426 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-27 11:12:58 +00:00
Wouter Wijngaards 3d9ea4721a Deletion error removed.
git-svn-id: file:///svn/unbound/trunk@425 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-27 09:45:39 +00:00
Wouter Wijngaards ee94589556 fixup tests, better stats, nicer api supers_walk().
git-svn-id: file:///svn/unbound/trunk@424 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-26 15:24:07 +00:00
Wouter Wijngaards 06cfef3252 Mesh used now.
git-svn-id: file:///svn/unbound/trunk@423 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-26 13:06:44 +00:00
Wouter Wijngaards 489e48b3d1 mesh work, now coded mesh service.
git-svn-id: file:///svn/unbound/trunk@422 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-25 13:54:03 +00:00
Wouter Wijngaards 479273df3c fixup in case the operator disables IPv4.
git-svn-id: file:///svn/unbound/trunk@421 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-22 14:24:00 +00:00
Wouter Wijngaards 9a1813e0bf Iterator does not alter qstate identity.
git-svn-id: file:///svn/unbound/trunk@420 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-22 13:24:26 +00:00
Wouter Wijngaards e939a7689f further mesh.
git-svn-id: file:///svn/unbound/trunk@419 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-22 12:39:08 +00:00
Wouter Wijngaards fcd489a12a Mesh design and preparatory cleanup.
- removed unused _node iterator value from rbtree_t. Takes up space.
      - iterator can handle querytargets state without a delegation point
        set, so that a priming(stub) subquery error can be handled.
      - iterator stores if it is priming or not.
      - log_query_info() neater logging.


git-svn-id: file:///svn/unbound/trunk@418 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-22 10:09:21 +00:00
Wouter Wijngaards b2deaa21ba mesh design.
git-svn-id: file:///svn/unbound/trunk@417 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 15:36:13 +00:00
Wouter Wijngaards 2b3f0026fe Use new ldns_buffer_copy();
git-svn-id: file:///svn/unbound/trunk@416 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 12:04:00 +00:00
Wouter Wijngaards a941253a81 Neater error for tcp connect problems.
git-svn-id: file:///svn/unbound/trunk@415 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 11:35:12 +00:00
Wouter Wijngaards 510b8df4b6 and doc msg
git-svn-id: file:///svn/unbound/trunk@414 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 10:23:34 +00:00
Wouter Wijngaards a342145ead fixup query release.
git-svn-id: file:///svn/unbound/trunk@413 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 10:23:07 +00:00
Wouter Wijngaards 0daf4a0b43 subreq depth fix
git-svn-id: file:///svn/unbound/trunk@412 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 09:36:27 +00:00
Wouter Wijngaards 78c8161cf4 Runnables from slumberlist done to clean it up.
git-svn-id: file:///svn/unbound/trunk@411 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 08:05:16 +00:00
Wouter Wijngaards 25092accc1 Fixup secondary buffer in case of error callback.
git-svn-id: file:///svn/unbound/trunk@410 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 07:52:51 +00:00
Wouter Wijngaards c4e81d06b7 Removed.
git-svn-id: file:///svn/unbound/trunk@409 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-21 07:39:13 +00:00
Wouter Wijngaards fed6a738de duplicate query callbacks work.
git-svn-id: file:///svn/unbound/trunk@408 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-20 14:01:58 +00:00
Wouter Wijngaards 133b65bc67 Freeup main module after module states.
git-svn-id: file:///svn/unbound/trunk@407 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-20 13:17:07 +00:00
Wouter Wijngaards cc9c205d88 Fixups.
git-svn-id: file:///svn/unbound/trunk@406 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-20 13:01:30 +00:00
Wouter Wijngaards 191e347415 fixup callbacks deletion.
git-svn-id: file:///svn/unbound/trunk@405 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-20 09:52:32 +00:00
Wouter Wijngaards 2573007d13 logging for num queries.
git-svn-id: file:///svn/unbound/trunk@404 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-20 09:17:09 +00:00
Wouter Wijngaards 9c33f8dcf4 fixup CNAME generated by scrubber.
git-svn-id: file:///svn/unbound/trunk@403 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-20 08:55:00 +00:00
Wouter Wijngaards 1c80108a5b coredump feature.
git-svn-id: file:///svn/unbound/trunk@402 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-20 07:47:56 +00:00
Wouter Wijngaards 6f9ec93b4a changelog entry
git-svn-id: file:///svn/unbound/trunk@401 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-19 15:08:07 +00:00
Wouter Wijngaards 890a3fe0a9 options to harden against very small EDNS bufsize or very large query packets.
git-svn-id: file:///svn/unbound/trunk@400 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-19 14:46:14 +00:00
Wouter Wijngaards 53d8141a00 RA bit set on error.
git-svn-id: file:///svn/unbound/trunk@399 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-19 13:59:34 +00:00
Wouter Wijngaards 534c4c194e RA bit in error now. fixup test.
git-svn-id: file:///svn/unbound/trunk@398 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-19 13:54:43 +00:00
Wouter Wijngaards 9f16769aa3 fix of flags in errors and very short bufsizes from edns.
git-svn-id: file:///svn/unbound/trunk@397 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-19 13:50:43 +00:00
Wouter Wijngaards d68a8204d2 AXFR handling and non-recursive handling.
git-svn-id: file:///svn/unbound/trunk@396 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-19 12:34:54 +00:00
Wouter Wijngaards 7be70582d2 - nicer layout in stats.c, review 0.3 change.
- spelling improvement, review 0.3 change.
       - uncapped timeout for server selection, so that very fast or slow
         servers will stand out from the rest.
       - target-fetch-policy: "3 2 1 0 0" config setting.
	 and docs.



git-svn-id: file:///svn/unbound/trunk@395 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-19 12:06:02 +00:00
Wouter Wijngaards 5543bd63b6 target fetch policy setting from config structure.
git-svn-id: file:///svn/unbound/trunk@394 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-18 15:24:14 +00:00
Wouter Wijngaards 1a629da2c3 Another offbyone.
git-svn-id: file:///svn/unbound/trunk@393 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-18 12:32:16 +00:00
Wouter Wijngaards 605d2dd751 fixup
git-svn-id: file:///svn/unbound/trunk@392 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-18 10:27:54 +00:00
Wouter Wijngaards 34c36a7616 Improve error handling.
git-svn-id: file:///svn/unbound/trunk@391 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-15 12:11:44 +00:00
Wouter Wijngaards 59824635da fixes.
git-svn-id: file:///svn/unbound/trunk@390 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-15 09:13:54 +00:00
Wouter Wijngaards 7608c92bb7 Small off by one in targetcount and double-callback fixup.
git-svn-id: file:///svn/unbound/trunk@389 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-15 08:40:30 +00:00
Wouter Wijngaards c7b302f43a slightly more verbose, on retries and dropped replies.
git-svn-id: file:///svn/unbound/trunk@388 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-13 15:14:23 +00:00
Wouter Wijngaards 526496a860 addr fixup.
git-svn-id: file:///svn/unbound/trunk@387 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-13 14:47:01 +00:00
Wouter Wijngaards 3c1e638757 no lock checks(file size) and align 64 bits, because otherwise bus error
on solaris.


git-svn-id: file:///svn/unbound/trunk@386 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-13 12:27:18 +00:00
Wouter Wijngaards ccafa0830f easy installation.
git-svn-id: file:///svn/unbound/trunk@385 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-13 11:14:20 +00:00
Wouter Wijngaards 330a321f13 more portable doxygen config file.
git-svn-id: file:///svn/unbound/trunk@384 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-12 18:23:56 +00:00
Wouter Wijngaards 37a8e7e370 fixup comments for doxygen 1.5
git-svn-id: file:///svn/unbound/trunk@383 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-12 14:51:49 +00:00
Wouter Wijngaards 7a6abc6a11 Better doxygen file.
git-svn-id: file:///svn/unbound/trunk@382 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-12 14:01:33 +00:00
Wouter Wijngaards 83defc87c6 Newer doxygen file. Aclocal update.
git-svn-id: file:///svn/unbound/trunk@381 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-12 13:56:08 +00:00
Wouter Wijngaards 2e352bc48c uses CNAMEs and DNAMEs from the cache.
git-svn-id: file:///svn/unbound/trunk@380 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-11 14:55:10 +00:00
Wouter Wijngaards c8b71a8b1e Nicer encoding. fixes.
git-svn-id: file:///svn/unbound/trunk@379 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-11 10:12:43 +00:00
Wouter Wijngaards d43a081730 lookup cname not in msg cache, but rrset cache.
git-svn-id: file:///svn/unbound/trunk@378 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-07 15:25:24 +00:00
Wouter Wijngaards 99d58fb600 comment. svn:NO TEST.
git-svn-id: file:///svn/unbound/trunk@377 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-07 15:17:29 +00:00
Wouter Wijngaards e8f7d9c150 ip6 functionality.
git-svn-id: file:///svn/unbound/trunk@376 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-07 15:04:27 +00:00
Wouter Wijngaards 162b28bea1 RA bit on in cached responses.
caches responses with CNAMEs corrected.


git-svn-id: file:///svn/unbound/trunk@375 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-07 14:20:23 +00:00
Wouter Wijngaards 019816dcf1 Tested serval targets, with CNAME's and indirection for recursion and
slumber list.


git-svn-id: file:///svn/unbound/trunk@374 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-07 13:21:04 +00:00
Wouter Wijngaards a11cc0c530 Fixup cname target name readout.
git-svn-id: file:///svn/unbound/trunk@373 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-07 10:38:02 +00:00
Wouter Wijngaards 01c703d3e6 fixup double linked list insertion code.
git-svn-id: file:///svn/unbound/trunk@372 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-07 07:58:02 +00:00
Wouter Wijngaards aaec3572e4 debug work.
git-svn-id: file:///svn/unbound/trunk@371 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-05 15:04:01 +00:00
Wouter Wijngaards 523c1bdb06 - priming failure returns SERVFAIL.
- priming gives LAME result, returns SERVFAIL.
       - debug routine to print dns_msg as handled by iterator.
       - memleak in config file stubs fixup.


git-svn-id: file:///svn/unbound/trunk@370 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-05 12:54:43 +00:00
Wouter Wijngaards 31b8352bc6 No double release of workrequest.
git-svn-id: file:///svn/unbound/trunk@369 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-05 10:58:14 +00:00
Wouter Wijngaards e98df72b44 - subrequests without parent store in cache and stop.
- worker slumber list for ongoing promiscuous queries.
       - subrequest error handling.



git-svn-id: file:///svn/unbound/trunk@368 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-05 10:51:47 +00:00
Wouter Wijngaards 7a882802b6 iterator finished state.
git-svn-id: file:///svn/unbound/trunk@367 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-05 07:54:42 +00:00
Wouter Wijngaards a8c3d57e0e Better reference.
git-svn-id: file:///svn/unbound/trunk@366 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-04 14:44:27 +00:00
Wouter Wijngaards 5eef2381f0 Process target responses, case preservation.
git-svn-id: file:///svn/unbound/trunk@365 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-04 13:53:01 +00:00
Wouter Wijngaards 81ae42fde0 Prime response state, both root priming and stub priming handling.
git-svn-id: file:///svn/unbound/trunk@364 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-04 12:22:38 +00:00
Wouter Wijngaards 2102aa0a3a cache lameness, set reply properly.
git-svn-id: file:///svn/unbound/trunk@363 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-04 11:52:10 +00:00
Wouter Wijngaards 5e42374cc8 Copy replyinfo routine.
git-svn-id: file:///svn/unbound/trunk@362 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-04 11:34:23 +00:00
Wouter Wijngaards e08155e86e Random nameserver selection.
git-svn-id: file:///svn/unbound/trunk@361 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-04 09:57:02 +00:00
Wouter Wijngaards d15e61a753 doc
git-svn-id: file:///svn/unbound/trunk@360 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-01 20:25:27 +00:00
Wouter Wijngaards a5e722d85f process_response, classify response, delegpt_from_message.
git-svn-id: file:///svn/unbound/trunk@359 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-01 20:24:33 +00:00
Wouter Wijngaards a84ed747dc please lint.
git-svn-id: file:///svn/unbound/trunk@358 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-01 12:56:18 +00:00
Wouter Wijngaards 0001a42efc conversion from parsed message to iterator region storage.
git-svn-id: file:///svn/unbound/trunk@357 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-01 12:52:07 +00:00
Wouter Wijngaards 3feea76968 neater code layout.
git-svn-id: file:///svn/unbound/trunk@356 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-01 12:25:38 +00:00
Wouter Wijngaards ef6480b696 cleaner allocation code.
git-svn-id: file:///svn/unbound/trunk@355 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-01 12:05:48 +00:00
Wouter Wijngaards 28f9864b53 scrubbing routines.
git-svn-id: file:///svn/unbound/trunk@354 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-06-01 09:42:31 +00:00
Wouter Wijngaards a7d3013334 scrubber work.
git-svn-id: file:///svn/unbound/trunk@353 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-31 14:57:24 +00:00
Wouter Wijngaards 80391ee2b8 query targets state.
git-svn-id: file:///svn/unbound/trunk@352 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-31 12:51:36 +00:00
Wouter Wijngaards c8939acc7f multiple subrequests at the same time.
git-svn-id: file:///svn/unbound/trunk@351 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-30 14:55:40 +00:00
Wouter Wijngaards b03a464d58 state init3.
git-svn-id: file:///svn/unbound/trunk@350 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-30 14:19:56 +00:00
Wouter Wijngaards a793689af0 init2 and double free fixup.
git-svn-id: file:///svn/unbound/trunk@349 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-30 11:45:44 +00:00
Wouter Wijngaards 635461389c iterator work.
git-svn-id: file:///svn/unbound/trunk@348 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-30 11:18:17 +00:00
Wouter Wijngaards 95d4dc2eb8 Removed CD bit flags from cache.
git-svn-id: file:///svn/unbound/trunk@347 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-30 05:39:04 +00:00
Wouter Wijngaards 3e7a53c5ca partial busy
git-svn-id: file:///svn/unbound/trunk@346 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-29 14:02:17 +00:00
Wouter Wijngaards d2318c50cd Name change to make naming more uniform.
git-svn-id: file:///svn/unbound/trunk@345 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-29 12:31:02 +00:00
Wouter Wijngaards 1065ff7c17 fixup cast and fixup TTL increase for duplicate rrset messages.
git-svn-id: file:///svn/unbound/trunk@344 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-29 12:26:45 +00:00
Wouter Wijngaards 1a9238ca5f message lookup and copy to region.
git-svn-id: file:///svn/unbound/trunk@343 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-29 10:32:11 +00:00
Wouter Wijngaards 5def8556c6 iterator and dns cache work.
git-svn-id: file:///svn/unbound/trunk@342 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-25 15:28:20 +00:00
Wouter Wijngaards 265993017d More code origins documented.
git-svn-id: file:///svn/unbound/trunk@341 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-25 12:25:15 +00:00
Wouter Wijngaards decd94f2a8 fixup lock code.
git-svn-id: file:///svn/unbound/trunk@340 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-25 12:20:18 +00:00
Wouter Wijngaards c7a9776d91 - Acknowledge use of unbound-java code in iterator. Nicer readme.
- services/cache/dns.c DNS Cache. Hybrid cache uses msgcache and
         rrset cache from module environment.
       - packed rrset key has type and class as easily accessable struct
         members. They are still kept in network format for fast msg encode.
       - dns cache find_delegation routine.


git-svn-id: file:///svn/unbound/trunk@339 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-25 12:02:37 +00:00
Wouter Wijngaards 6a08bfbb30 docs for config options for stub zones.
git-svn-id: file:///svn/unbound/trunk@338 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-24 13:57:52 +00:00
Wouter Wijngaards fa44214c61 tests need forwarding mode enabled.
git-svn-id: file:///svn/unbound/trunk@337 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-24 13:41:30 +00:00
Wouter Wijngaards 4a2c15be58 preparatory work for iterator.
git-svn-id: file:///svn/unbound/trunk@336 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-24 13:24:44 +00:00
Wouter Wijngaards 42312206c9 root hints.
git-svn-id: file:///svn/unbound/trunk@335 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-23 14:05:36 +00:00
Wouter Wijngaards 472e96622c setup of state; delegation point setup.
git-svn-id: file:///svn/unbound/trunk@334 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-23 09:34:01 +00:00
Wouter Wijngaards 5fa0d10608 please lint.
git-svn-id: file:///svn/unbound/trunk@333 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-23 06:27:23 +00:00
Wouter Wijngaards c4096b8654 precise timers for roundtrip UDP timeouts.
git-svn-id: file:///svn/unbound/trunk@332 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-23 06:24:01 +00:00
Wouter Wijngaards d48aa65684 more debug info for deadlocks.
git-svn-id: file:///svn/unbound/trunk@331 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-22 15:17:41 +00:00
Wouter Wijngaards cc48ec587f Fixes.
git-svn-id: file:///svn/unbound/trunk@330 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-22 15:02:39 +00:00
Wouter Wijngaards 687a99a82e EDNS test.
git-svn-id: file:///svn/unbound/trunk@329 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-22 13:40:49 +00:00
Wouter Wijngaards 66addd85e7 Fixup buffer position.
git-svn-id: file:///svn/unbound/trunk@328 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-22 13:00:14 +00:00
Wouter Wijngaards b461dc4111 outbound queries via serviced outside_network queries.
git-svn-id: file:///svn/unbound/trunk@327 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-22 12:36:02 +00:00
Wouter Wijngaards 1a90ff7b67 Serviced queries in outside network service get full EDNS, UDP retry and
TCP fallback attention.


git-svn-id: file:///svn/unbound/trunk@326 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-21 15:10:55 +00:00
Wouter Wijngaards 69bfd93616 Config options for infra cache.
git-svn-id: file:///svn/unbound/trunk@325 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-16 14:29:46 +00:00
Wouter Wijngaards ccb924d55f LRU touch of RRsets. Pretty complicated to do.
git-svn-id: file:///svn/unbound/trunk@324 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-16 12:48:48 +00:00
Wouter Wijngaards 55f571825a doc fix.
git-svn-id: file:///svn/unbound/trunk@323 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-15 15:12:03 +00:00
Wouter Wijngaards 0fa6818d48 infra cache config.
git-svn-id: file:///svn/unbound/trunk@322 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-15 15:11:12 +00:00
Wouter Wijngaards cb0d7805e2 host cache test.
git-svn-id: file:///svn/unbound/trunk@321 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-15 13:21:10 +00:00
Wouter Wijngaards 7a4e1baca9 Moved log_addr.
git-svn-id: file:///svn/unbound/trunk@320 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-15 12:18:28 +00:00
Wouter Wijngaards e6dccd8565 Host cache code.
git-svn-id: file:///svn/unbound/trunk@319 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-15 10:53:27 +00:00
Wouter Wijngaards 62461e23be Host cache setup.
git-svn-id: file:///svn/unbound/trunk@318 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-14 15:03:55 +00:00
Wouter Wijngaards f060064e38 timeout estimation code.
git-svn-id: file:///svn/unbound/trunk@317 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-14 13:22:02 +00:00
Wouter Wijngaards 09420fde81 more debug.
git-svn-id: file:///svn/unbound/trunk@316 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-14 10:39:12 +00:00
Wouter Wijngaards 5b6e516dd1 porting.
git-svn-id: file:///svn/unbound/trunk@315 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-14 09:26:03 +00:00
Wouter Wijngaards 00ebea939a Alignment fix.
git-svn-id: file:///svn/unbound/trunk@314 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-14 09:25:05 +00:00
Wouter Wijngaards fd57c88931 Build warnings on OSX.
git-svn-id: file:///svn/unbound/trunk@313 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-14 09:02:27 +00:00
Wouter Wijngaards 5f95ede1fc Fixup tests.
git-svn-id: file:///svn/unbound/trunk@312 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-11 14:33:38 +00:00
Wouter Wijngaards 49bc2f887c iterator module.
git-svn-id: file:///svn/unbound/trunk@311 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-11 14:16:42 +00:00
Wouter Wijngaards 696a07e7eb per query state for modules to allocate...
git-svn-id: file:///svn/unbound/trunk@310 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-10 14:36:05 +00:00
Wouter Wijngaards 1c90125ab2 subqueries
git-svn-id: file:///svn/unbound/trunk@309 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-10 13:28:32 +00:00
Wouter Wijngaards d388acddaa Zap.
git-svn-id: file:///svn/unbound/trunk@308 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-10 13:25:30 +00:00
Wouter Wijngaards 3aa83fe595 ids, alloc service
git-svn-id: file:///svn/unbound/trunk@307 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-10 12:56:49 +00:00
Wouter Wijngaards ced720ad99 Fix for compression. Module interface setup.
git-svn-id: file:///svn/unbound/trunk@306 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-10 11:53:55 +00:00
Wouter Wijngaards df07a8ae65 TODOs
git-svn-id: file:///svn/unbound/trunk@305 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-10 07:36:23 +00:00
Wouter Wijngaards 67537b99c8 tag 0.3.
git-svn-id: file:///svn/unbound/trunk@304 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-10 05:37:52 +00:00
Wouter Wijngaards 0c76097911 Test uses less file descriptors.
git-svn-id: file:///svn/unbound/trunk@303 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 10:55:35 +00:00
Wouter Wijngaards 5e409a8e75 Compiletest fix alloc.c
git-svn-id: file:///svn/unbound/trunk@302 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 09:55:30 +00:00
Wouter Wijngaards bdebd1bf7f Disabled copy of ldns-testpkts, could mess up compiles for people with ldns
without examples.


git-svn-id: file:///svn/unbound/trunk@301 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 09:15:58 +00:00
Wouter Wijngaards 21f63ce344 More test.
git-svn-id: file:///svn/unbound/trunk@300 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 09:12:44 +00:00
Wouter Wijngaards 9c51399e3e Lint fixup. splint gets confused by getrlimit.
git-svn-id: file:///svn/unbound/trunk@299 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 09:04:11 +00:00
Wouter Wijngaards 362a4f2e76 Checks ulimit open files.
git-svn-id: file:///svn/unbound/trunk@298 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 07:58:57 +00:00
Wouter Wijngaards db0eccacb4 Test for TCP mode over the wire.
git-svn-id: file:///svn/unbound/trunk@297 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 07:15:11 +00:00
Wouter Wijngaards c7ee0dfbca Test for fake-event support.
git-svn-id: file:///svn/unbound/trunk@296 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 07:10:55 +00:00
Wouter Wijngaards d0908148d6 TCP fallback if forwarder sends TC bit.
git-svn-id: file:///svn/unbound/trunk@295 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-09 07:00:10 +00:00
Wouter Wijngaards 6c3c370b2a TCP outgoing services.
git-svn-id: file:///svn/unbound/trunk@294 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-08 13:25:21 +00:00
Wouter Wijngaards ebd337689a No verbose for packet error. TC detect.
git-svn-id: file:///svn/unbound/trunk@293 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-07 15:01:27 +00:00
Wouter Wijngaards efd5b66026 unit test upgrade.
git-svn-id: file:///svn/unbound/trunk@292 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-07 14:22:30 +00:00
Wouter Wijngaards 067932c2c5 lint fixup.
git-svn-id: file:///svn/unbound/trunk@291 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-07 14:07:34 +00:00
Wouter Wijngaards 9c894946f2 EDNS errors.
git-svn-id: file:///svn/unbound/trunk@290 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-07 14:05:51 +00:00
Wouter Wijngaards c18d584466 Fix unit test to attach edns record.
git-svn-id: file:///svn/unbound/trunk@289 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-07 13:24:30 +00:00
Wouter Wijngaards f3c0cd34d8 EDNS for the client.
git-svn-id: file:///svn/unbound/trunk@288 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-07 13:17:27 +00:00
Wouter Wijngaards 841d09ff08 test rrset ttl refresh.
git-svn-id: file:///svn/unbound/trunk@287 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 14:14:08 +00:00
Wouter Wijngaards 68603f6f05 Not trusted, not updated, and now tested.
git-svn-id: file:///svn/unbound/trunk@286 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 13:54:55 +00:00
Wouter Wijngaards 072e0e973a Update rrset.
git-svn-id: file:///svn/unbound/trunk@285 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 13:48:24 +00:00
Wouter Wijngaards d4d4ba78e0 Send tcp buffers using writev.
git-svn-id: file:///svn/unbound/trunk@284 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 13:01:20 +00:00
Wouter Wijngaards 60884c3320 Nasty bug fixed in tcp writer. Commit before I rework the entire thing.
git-svn-id: file:///svn/unbound/trunk@283 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 12:45:59 +00:00
Wouter Wijngaards c74941e3b8 temp region kept for use during query processing.
git-svn-id: file:///svn/unbound/trunk@282 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 12:35:01 +00:00
Wouter Wijngaards 44ef71ff6c working on trust of rrsets.
git-svn-id: file:///svn/unbound/trunk@281 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 10:10:52 +00:00
Wouter Wijngaards caa76487f8 Alloc cache per thread gets used for deleted items.
git-svn-id: file:///svn/unbound/trunk@280 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 08:05:56 +00:00
Wouter Wijngaards 4732f7c4d6 config settings for rrset cache.
git-svn-id: file:///svn/unbound/trunk@279 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 07:34:10 +00:00
Wouter Wijngaards 3fea680228 Better estimate.
git-svn-id: file:///svn/unbound/trunk@278 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-04 06:56:37 +00:00
Wouter Wijngaards 8420d0b819 Use packedrrset msgformat in service.
git-svn-id: file:///svn/unbound/trunk@277 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-03 15:34:03 +00:00
Wouter Wijngaards d86f444442 start of EDNS work; TC truncation of message encoding.
git-svn-id: file:///svn/unbound/trunk@276 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-02 15:31:32 +00:00
Wouter Wijngaards 9d3e09b838 more dname tests.
git-svn-id: file:///svn/unbound/trunk@275 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-02 12:13:56 +00:00
Wouter Wijngaards 18c827fbe6 dname unit test work.
git-svn-id: file:///svn/unbound/trunk@274 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-02 09:35:19 +00:00
Wouter Wijngaards 182855d233 Documentation addresses and check buffer limit.
git-svn-id: file:///svn/unbound/trunk@273 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-01 15:11:53 +00:00
Wouter Wijngaards f31e3e5024 Nicer example interface address.
git-svn-id: file:///svn/unbound/trunk@272 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-01 14:43:24 +00:00
Wouter Wijngaards 7132e54ffa some basic stats.
git-svn-id: file:///svn/unbound/trunk@271 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-01 12:13:29 +00:00
Wouter Wijngaards 756cb86964 Tests for compression, and decompression in query section fix.
git-svn-id: file:///svn/unbound/trunk@270 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-05-01 10:18:37 +00:00
Wouter Wijngaards 0ce78d259f compression.
git-svn-id: file:///svn/unbound/trunk@269 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-27 14:55:47 +00:00
Wouter Wijngaards 496c39742a Compress rrsig owner names.
git-svn-id: file:///svn/unbound/trunk@268 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-27 13:58:59 +00:00
Wouter Wijngaards cfe9bcc585 please lint.
git-svn-id: file:///svn/unbound/trunk@267 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-27 12:48:09 +00:00
Wouter Wijngaards 1bffcab1f3 no more iov per rr.
git-svn-id: file:///svn/unbound/trunk@266 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-27 12:42:03 +00:00
Wouter Wijngaards 87bff3dc63 todo.
git-svn-id: file:///svn/unbound/trunk@265 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-27 09:43:39 +00:00
Wouter Wijngaards 379d94c4b2 TODO listing, comment fix
git-svn-id: file:///svn/unbound/trunk@264 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-27 09:37:38 +00:00
Wouter Wijngaards 856c9fa1a3 pow2 in comment.
git-svn-id: file:///svn/unbound/trunk@263 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-26 10:16:44 +00:00
Wouter Wijngaards 909e476db9 Better wording.
git-svn-id: file:///svn/unbound/trunk@262 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-26 10:14:27 +00:00
Wouter Wijngaards 8bdb52127c OMGponies.
git-svn-id: file:///svn/unbound/trunk@261 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-26 09:48:28 +00:00
Wouter Wijngaards 182b6b7b46 lint faster, lint fix and define.
git-svn-id: file:///svn/unbound/trunk@260 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-26 07:55:51 +00:00
Wouter Wijngaards f4ee65daa5 fp fix.
git-svn-id: file:///svn/unbound/trunk@259 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-26 07:33:29 +00:00
Wouter Wijngaards b383ddfad9 fixes offset.
git-svn-id: file:///svn/unbound/trunk@258 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-25 15:41:19 +00:00
Wouter Wijngaards f48553bc2d work on domain name compression.
git-svn-id: file:///svn/unbound/trunk@257 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-25 15:28:03 +00:00
Wouter Wijngaards 02f5c63635 parse type in host byte order.
git-svn-id: file:///svn/unbound/trunk@256 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-25 11:36:51 +00:00
Wouter Wijngaards add942bd40 RRSIG parsing and outputting.
git-svn-id: file:///svn/unbound/trunk@255 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-24 13:39:23 +00:00
Wouter Wijngaards 2d53f65c92 RRSIG parse plans.
git-svn-id: file:///svn/unbound/trunk@254 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-20 09:58:32 +00:00
Wouter Wijngaards 48db90e556 Unit test work
git-svn-id: file:///svn/unbound/trunk@253 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-20 08:10:07 +00:00
Wouter Wijngaards 918858f9c9 types. log buf larger to print packets.
git-svn-id: file:///svn/unbound/trunk@252 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-19 15:30:32 +00:00
Wouter Wijngaards 545feea82b Fixups after initial unit test.
git-svn-id: file:///svn/unbound/trunk@251 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-19 09:48:42 +00:00
Wouter Wijngaards 561385c35a review changes.
git-svn-id: file:///svn/unbound/trunk@250 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-18 13:57:01 +00:00
Wouter Wijngaards 5253d14449 Smaller test data.
git-svn-id: file:///svn/unbound/trunk@249 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-18 13:48:29 +00:00
Wouter Wijngaards 6ef0188400 Commit to help ldns test.
git-svn-id: file:///svn/unbound/trunk@248 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-18 08:50:44 +00:00
Wouter Wijngaards 3507ec2e64 Unit test for parser with lots fo content.
git-svn-id: file:///svn/unbound/trunk@247 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-17 15:18:24 +00:00
Wouter Wijngaards 1cb321662d test for msgparse.
git-svn-id: file:///svn/unbound/trunk@246 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-17 14:03:33 +00:00
Wouter Wijngaards 8bda1b6893 message parsing code in one file.
git-svn-id: file:///svn/unbound/trunk@245 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-17 11:56:48 +00:00
Wouter Wijngaards 200993b89f Message create.
git-svn-id: file:///svn/unbound/trunk@244 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-17 10:18:39 +00:00
Wouter Wijngaards da25a5b377 store hash value.
git-svn-id: file:///svn/unbound/trunk@243 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-17 09:18:12 +00:00
Wouter Wijngaards ae30307d6d copy and decompress.
git-svn-id: file:///svn/unbound/trunk@242 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-17 09:14:45 +00:00
Wouter Wijngaards 4283fec985 ids and parsing rrs.
git-svn-id: file:///svn/unbound/trunk@241 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-16 15:21:50 +00:00
Wouter Wijngaards 558de9982d Parsing of messages into parse internal representation.
git-svn-id: file:///svn/unbound/trunk@240 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-13 15:00:56 +00:00
Wouter Wijngaards dc1513899f Dname compare routines with compression pointers.
git-svn-id: file:///svn/unbound/trunk@239 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-12 14:54:34 +00:00
Wouter Wijngaards eb51f48214 dname compare lower case version. Preserves case.
git-svn-id: file:///svn/unbound/trunk@238 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-12 14:02:02 +00:00
Wouter Wijngaards 6763650624 Parsing
git-svn-id: file:///svn/unbound/trunk@237 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-11 14:26:29 +00:00
Wouter Wijngaards 01fa72378f parse setup.
git-svn-id: file:///svn/unbound/trunk@236 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-10 09:03:05 +00:00
Wouter Wijngaards 6b90203bce Increased timeouts, for busy open.
Unit test would fail; due to open busy with other tasks.


git-svn-id: file:///svn/unbound/trunk@235 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-10 07:59:45 +00:00
Wouter Wijngaards 83039ba0b0 please lint, docs.
Fixup ignored return value.


git-svn-id: file:///svn/unbound/trunk@234 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-10 07:56:05 +00:00
Wouter Wijngaards 6457115869 Commit code, and see if unit test is fixed (with less busy open).
git-svn-id: file:///svn/unbound/trunk@233 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-10 07:11:57 +00:00
Wouter Wijngaards 286892dadc Header change for message store.
git-svn-id: file:///svn/unbound/trunk@232 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-10 05:39:12 +00:00
Wouter Wijngaards d51196ddc0 Results of discussion.
git-svn-id: file:///svn/unbound/trunk@231 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-05 14:53:32 +00:00
Wouter Wijngaards d366a7a660 Memory layout rrsets.
git-svn-id: file:///svn/unbound/trunk@230 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-04 13:02:13 +00:00
Wouter Wijngaards 94288dae09 0.3, dname.c
git-svn-id: file:///svn/unbound/trunk@229 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-04 09:47:30 +00:00
Wouter Wijngaards e49b05d0cd tag 0.2
git-svn-id: file:///svn/unbound/trunk@228 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-03 14:17:42 +00:00
Wouter Wijngaards e7228803a0 Tweaked for memory requirements on OSX.
git-svn-id: file:///svn/unbound/trunk@227 be551aaa-1e26-0410-a405-d3ace91eadb9
2007-04-03 14:14:11 +00:00
634 changed files with 270051 additions and 7466 deletions
+357 -60
View File
@@ -1,9 +1,17 @@
# Copyright 2007 NLnet Labs
# See the file LICENSE for the license
#
# Standard installation pathnames
QUIET=yes
debug_enabled=@debug_enabled@
ifeq "$(QUIET)" ""
ifeq ($(debug_enabled),yes)
QUIET=yes
LIBTOOLQUIET=yes
else
QUIET=no
LIBTOOLQUIET=yes
endif
endif
ifeq "$(QUIET)" "yes"
Q=@
INFO=@echo
@@ -18,129 +26,418 @@ srcdir=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
mandir=@mandir@
libdir=@libdir@
# datarootdir is here to please some checkers, use datadir.
datarootdir=@datarootdir@
datadir=@datadir@
includedir=@includedir@
doxygen=@doxygen@
libtool=@libtool@
ldnsdir=@ldnsdir@
staticexe=@staticexe@
EXEEXT=@EXEEXT@
configfile=@ub_conf_file@
UNBOUND_RUN_DIR=@UNBOUND_RUN_DIR@
CHECKLOCK_SRC=@CHECKLOCK_SRC@
UB_ON_WINDOWS=@UB_ON_WINDOWS@
WITH_PYTHONMODULE=@WITH_PYTHONMODULE@
WITH_PYUNBOUND=@WITH_PYUNBOUND@
PYTHON_SITE_PKG=@PYTHON_SITE_PKG@
SWIG=@SWIG@
YACC=@YACC@
LEX=@LEX@
STRIP=@STRIP@
CC=@CC@
CPPFLAGS=-I. @CPPFLAGS@ @DEFS@
CFLAGS=-I. @CFLAGS@
CPPFLAGS=-I. @CPPFLAGS@
ifneq "$(srcdir)" "."
CPPFLAGS:=-I$(srcdir) $(CPPFLAGS)
endif
CPPFLAGS:=$(strip $(CPPFLAGS))
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
LIBS=$(strip @LIBS@)
LIBOBJS=@LIBOBJS@
RUNTIME_PATH=@RUNTIME_PATH@
DEPFLAG=@DEPFLAG@
DATE=$(shell date +%Y%m%d)
LIBTOOL=$(libtool)
ifeq "$(QUIET)" "yes"
ifeq "$(LIBTOOLQUIET)" "yes"
LIBTOOL+=--quiet
endif
BUILD=build/
WINDRES=@WINDRES@
LINT=splint
LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc
LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list -Dglob64=glob -Dglobfree64=globfree
# compat with openssl linux edition.
LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t
LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray
INSTALL=$(srcdir)/install-sh
INSTALL=$(srcdir)/install-sh
ifeq "$(WITH_PYTHONMODULE)" "yes"
PYTHONMOD_SRC=$(srcdir)/pythonmod/*.c
endif
COMMON_SRC=$(wildcard services/*.c util/*.c util/data/*.c util/storage/*.c) util/configparser.c util/configlexer.c testcode/checklocks.c
COMMON_OBJ=$(addprefix $(BUILD),$(COMMON_SRC:.c=.o))
COMPAT_OBJ=$(addprefix $(BUILD)compat/,$(LIBOBJS))
UNITTEST_SRC=$(wildcard testcode/unit*.c) $(COMMON_SRC)
UNITTEST_OBJ=$(addprefix $(BUILD),$(UNITTEST_SRC:.c=.o)) $(COMPAT_OBJ)
DAEMON_SRC=$(wildcard daemon/*.c) $(COMMON_SRC)
DAEMON_OBJ=$(addprefix $(BUILD),$(DAEMON_SRC:.c=.o)) $(COMPAT_OBJ)
TESTBOUND_SRC=testcode/testbound.c testcode/ldns-testpkts.c daemon/worker.c daemon/daemon.c testcode/replay.c testcode/fake_event.c $(filter-out util/netevent.c services/listen_dnsport.c services/outside_network.c, $(COMMON_SRC))
TESTBOUND_OBJ=$(addprefix $(BUILD),$(TESTBOUND_SRC:.c=.o)) $(COMPAT_OBJ)
LOCKVERIFY_SRC=testcode/lock_verify.c $(COMMON_SRC)
LOCKVERIFY_OBJ=$(addprefix $(BUILD),$(LOCKVERIFY_SRC:.c=.o)) $(COMPAT_OBJ)
ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) $(TESTBOUND_SRC) $(LOCKVERIFY_SRC)
ALL_OBJ=$(addprefix $(BUILD),$(ALL_SRC:.c=.o) $(addprefix compat/,$(LIBOBJS))) $(COMPAT_OBJ)
COMMON_SRC=$(patsubst $(srcdir)/%,%, $(wildcard $(srcdir)/services/*.c \
$(srcdir)/services/cache/*.c $(srcdir)/util/*.c \
$(srcdir)/util/data/*.c $(srcdir)/util/storage/*.c \
$(srcdir)/iterator/*.c $(srcdir)/validator/*.c $(PYTHONMOD_SRC))) \
util/configparser.c util/configlexer.c $(CHECKLOCK_SRC)
COMMON_OBJ=$(addprefix $(BUILD),$(COMMON_SRC:.c=.lo))
COMPAT_SRC=$(addprefix compat/,$(LIBOBJS:.o=.c))
COMPAT_OBJ=$(addprefix $(BUILD)compat/,$(LIBOBJS:.o=.lo))
UNITTEST_SRC=$(patsubst $(srcdir)/%,%, \
$(wildcard $(srcdir)/testcode/unit*.c)) \
testcode/readhex.c testcode/ldns-testpkts.c smallapp/worker_cb.c \
$(COMMON_SRC)
UNITTEST_OBJ=$(addprefix $(BUILD),$(UNITTEST_SRC:.c=.lo)) $(COMPAT_OBJ)
DAEMON_SRC=$(patsubst $(srcdir)/%,%, $(wildcard $(srcdir)/daemon/*.c)) \
$(COMMON_SRC)
DAEMON_OBJ=$(addprefix $(BUILD),$(DAEMON_SRC:.c=.lo)) $(COMPAT_OBJ)
CHECKCONF_SRC=smallapp/unbound-checkconf.c smallapp/worker_cb.c $(COMMON_SRC)
CHECKCONF_OBJ=$(addprefix $(BUILD),$(CHECKCONF_SRC:.c=.lo)) $(COMPAT_OBJ)
CONTROL_SRC=smallapp/unbound-control.c smallapp/worker_cb.c $(COMMON_SRC)
CONTROL_OBJ=$(addprefix $(BUILD),$(CONTROL_SRC:.c=.lo)) $(COMPAT_OBJ)
HOST_SRC=smallapp/unbound-host.c
HOST_OBJ=$(addprefix $(BUILD),$(HOST_SRC:.c=.lo)) $(COMPAT_OBJ)
TESTBOUND_SRC=testcode/testbound.c testcode/ldns-testpkts.c \
daemon/worker.c daemon/acl_list.c daemon/daemon.c daemon/stats.c \
testcode/replay.c testcode/fake_event.c $(filter-out util/netevent.c \
services/listen_dnsport.c services/outside_network.c, $(COMMON_SRC))
TESTBOUND_OBJ=$(addprefix $(BUILD),$(TESTBOUND_SRC:.c=.lo)) $(COMPAT_OBJ)
LOCKVERIFY_SRC=testcode/lock_verify.c smallapp/worker_cb.c $(COMMON_SRC)
LOCKVERIFY_OBJ=$(addprefix $(BUILD),$(LOCKVERIFY_SRC:.c=.lo)) $(COMPAT_OBJ)
PKTVIEW_SRC=testcode/pktview.c testcode/readhex.c smallapp/worker_cb.c \
$(COMMON_SRC)
PKTVIEW_OBJ=$(addprefix $(BUILD),$(PKTVIEW_SRC:.c=.lo)) $(COMPAT_OBJ)
SIGNIT_SRC=testcode/signit.c smallapp/worker_cb.c $(COMMON_SRC)
SIGNIT_OBJ=$(addprefix $(BUILD),$(SIGNIT_SRC:.c=.lo)) $(COMPAT_OBJ)
MEMSTATS_SRC=testcode/memstats.c smallapp/worker_cb.c $(COMMON_SRC)
MEMSTATS_OBJ=$(addprefix $(BUILD),$(MEMSTATS_SRC:.c=.lo)) $(COMPAT_OBJ)
ASYNCLOOK_SRC=testcode/asynclook.c util/log.c util/locks.c
ASYNCLOOK_OBJ=$(addprefix $(BUILD),$(ASYNCLOOK_SRC:.c=.lo)) $(COMPAT_OBJ)
STREAMTCP_SRC=testcode/streamtcp.c smallapp/worker_cb.c $(COMMON_SRC)
STREAMTCP_OBJ=$(addprefix $(BUILD),$(STREAMTCP_SRC:.c=.lo)) $(COMPAT_OBJ)
PERF_SRC=testcode/perf.c smallapp/worker_cb.c $(COMMON_SRC)
PERF_OBJ=$(addprefix $(BUILD),$(PERF_SRC:.c=.lo)) $(COMPAT_OBJ)
DELAYER_SRC=testcode/delayer.c smallapp/worker_cb.c $(COMMON_SRC)
DELAYER_OBJ=$(addprefix $(BUILD),$(DELAYER_SRC:.c=.lo)) $(COMPAT_OBJ)
HARVEST_SRC=testcode/harvest.c
HARVEST_OBJ=$(addprefix $(BUILD),$(HARVEST_SRC:.c=.lo)) $(COMPAT_OBJ)
LIBUNBOUND_SRC=$(patsubst $(srcdir)/%,%, \
$(wildcard $(srcdir)/libunbound/*.c) $(COMMON_SRC))
LIBUNBOUND_OBJ=$(addprefix $(BUILD),$(LIBUNBOUND_SRC:.c=.lo)) $(COMPAT_OBJ)
ALL_SRC=$(sort $(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \
$(TESTBOUND_SRC) $(LOCKVERIFY_SRC) $(PKTVIEW_SRC) $(SIGNIT_SRC) \
$(MEMSTATS_SRC) $(CHECKCONF_SRC) $(LIBUNBOUND_SRC) $(HOST_SRC) \
$(ASYNCLOOK_SRC) $(STREAMTCP_SRC) $(PERF_SRC) $(DELAYER_SRC) \
$(HARVEST_SRC) $(CONTROL_SRC))
ALL_OBJ=$(addprefix $(BUILD),$(ALL_SRC:.c=.lo) \
$(addprefix compat/,$(LIBOBJS:.o=.lo))) $(COMPAT_OBJ)
ifeq "$(UB_ON_WINDOWS)" "yes"
DAEMON_SRC+=winrc/win_svc.c winrc/w_inst.c
DAEMON_OBJ+=$(BUILD)winrc/rsrc_unbound.o $(BUILD)winrc/win_svc.lo
HOST_OBJ+=$(BUILD)winrc/rsrc_unbound_host.o
CONTROL_OBJ+=$(BUILD)winrc/rsrc_unbound_control.o
CHECKCONF_OBJ+=$(BUILD)winrc/rsrc_unbound_checkconf.o
WINAPPS=$(addsuffix $(EXEEXT), unbound-service-install \
unbound-service-remove anchor-update)
COMPAT_WINAPP=$(filter-out $(BUILD)compat/ctime_r.lo, $(COMPAT_OBJ))
SVCINST_SRC=winrc/unbound-service-install.c winrc/w_inst.c
SVCINST_OBJ=$(addprefix $(BUILD),$(SVCINST_SRC:.c=.lo)) $(COMPAT_WINAPP) \
$(BUILD)winrc/rsrc_svcinst.o
SVCUNINST_SRC=winrc/unbound-service-remove.c winrc/w_inst.c
SVCUNINST_OBJ=$(addprefix $(BUILD),$(SVCUNINST_SRC:.c=.lo)) $(COMPAT_WINAPP) \
$(BUILD)winrc/rsrc_svcuninst.o
ANCHORUPD_SRC=winrc/anchor-update.c
ANCHORUPD_OBJ=$(addprefix $(BUILD),$(ANCHORUPD_SRC:.c=.lo)) $(COMPAT_WINAPP) \
$(BUILD)winrc/rsrc_anchorupd.o
ALL_SRC:=$(sort $(ALL_SRC) $(SVCINST_SRC) $(SVCUNINST_SRC) $(ANCHORUPD_SRC))
ALL_OBJ:=$(sort $(ALL_OBJ) $(SVCINST_OBJ) $(SVCUNINST_OBJ) $(ANCHORUPD_OBJ))
$(BUILD)%.o: $(srcdir)/%.rc $(srcdir)/config.h
$(INFO) Resource $<
@if test ! -z "$(ldnsdir)" -a ! -e $(ldnsdir)/include/ldns/ldns.h; \
then (cd $(ldnsdir); $(MAKE) copy-headers); fi
@-if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$Q$(WINDRES) $(CPPFLAGS) $< $@
endif
COMPILE=$(LIBTOOL) --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS)
LINK=$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS)
LINK_LIB=$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -release $(VERSION)
LINK=$(LIBTOOL) --tag=CC --mode=link $(strip $(CC) $(staticexe) $(RUNTIME_PATH) $(CFLAGS) $(LDFLAGS))
LINK_LIB=$(LIBTOOL) --tag=CC --mode=link $(strip $(CC) $(RUNTIME_PATH) $(CFLAGS) $(LDFLAGS) $(staticexe) -version-number @LIBUNBOUND_CURRENT@:@LIBUNBOUND_REVISION@:@LIBUNBOUND_AGE@ -no-undefined)
$(BUILD)%.o: $(srcdir)/%.c
.PHONY: clean realclean doc lint all install uninstall tests test download_ldns strip lib
$(BUILD)%.lo: $(srcdir)/%.c
$(INFO) Build $<
@if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$Q$(COMPILE) -c $< -o $@
@if test ! -z "$(ldnsdir)" -a ! -e $(ldnsdir)/include/ldns/ldns.h; \
then (cd $(ldnsdir); $(MAKE) copy-headers); fi
@-if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$Q$(COMPILE) -o $@ -c $<
.PHONY: clean realclean doc lint all
all: $(COMMON_OBJ) unbound$(EXEEXT) unbound-checkconf$(EXEEXT) lib unbound-host$(EXEEXT) unbound-control$(EXEEXT) unbound-control-setup $(WINAPPS)
all: $(COMMON_OBJ) unbound unittest testbound lock-verify
TEST_BIN=$(addsuffix $(EXEEXT),asynclook delayer harvest lock-verify \
memstats perf pktview signit streamtcp testbound unittest)
tests: all $(TEST_BIN)
unbound: $(DAEMON_OBJ)
test: tests
if test -x "`which bash`"; then bash testcode/do-tests.sh; else sh testcode/do-tests.sh; fi
lib: libunbound.la
ifeq ($(patsubst ldns-src%,ldns-src,$(ldnsdir)),ldns-src)
ldnslib=$(ldnsdir)/lib/libldns.a
$(ldnslib): $(ldnsdir)/lib
$(ldnsdir)/lib:
@if test ! -z "$(ldnsdir)"; \
then (cd $(ldnsdir) && $(MAKE)); fi
else
ldnslib=
endif
libunbound.la: $(LIBUNBOUND_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $^ $(LIBS)
$Q$(LINK_LIB) -export-symbols $(srcdir)/libunbound/ubsyms.def -o $@ $(sort $(LIBUNBOUND_OBJ)) -rpath $(libdir) $(LIBS)
unittest: $(UNITTEST_OBJ)
unbound$(EXEEXT): $(DAEMON_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $^ $(LIBS)
$Q$(LINK) -o $@ $(sort $(DAEMON_OBJ)) -lssl $(LIBS)
testbound: $(TESTBOUND_OBJ)
unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $^ $(LIBS)
$Q$(LINK) -o $@ $(sort $(CHECKCONF_OBJ)) $(LIBS)
lock-verify: $(LOCKVERIFY_OBJ)
unbound-control$(EXEEXT): $(CONTROL_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $^ $(LIBS)
$Q$(LINK) -o $@ $(sort $(CONTROL_OBJ)) -lssl $(LIBS)
testcode/ldns-testpkts.c: $(ldnsdir)/examples/ldns-testpkts.c \
$(ldnsdir)/examples/ldns-testpkts.h
cp $(ldnsdir)/examples/ldns-testpkts.c testcode/ldns-testpkts.c
cp $(ldnsdir)/examples/ldns-testpkts.h testcode/ldns-testpkts.h
unbound-host$(EXEEXT): $(HOST_OBJ) libunbound.la $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(HOST_OBJ)) -L. -L.libs -lunbound $(LIBS)
unbound-service-install$(EXEEXT): $(SVCINST_OBJ)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(SVCINST_OBJ)) $(LIBS)
unbound-service-remove$(EXEEXT): $(SVCUNINST_OBJ)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(SVCUNINST_OBJ)) $(LIBS)
anchor-update$(EXEEXT): $(ANCHORUPD_OBJ) libunbound.la $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(ANCHORUPD_OBJ)) -L. -L.libs -lunbound $(LIBS)
unittest$(EXEEXT): $(UNITTEST_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(UNITTEST_OBJ)) $(LIBS)
testbound$(EXEEXT): $(TESTBOUND_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(TESTBOUND_OBJ)) -lssl $(LIBS)
lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(LOCKVERIFY_OBJ)) $(LIBS)
pktview$(EXEEXT): $(PKTVIEW_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(PKTVIEW_OBJ)) $(LIBS)
signit$(EXEEXT): $(SIGNIT_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(SIGNIT_OBJ)) $(LIBS)
memstats$(EXEEXT): $(MEMSTATS_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(MEMSTATS_OBJ)) $(LIBS)
asynclook$(EXEEXT): $(ASYNCLOOK_OBJ) $(ldnslib) libunbound.la
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(ASYNCLOOK_OBJ)) $(LIBS) -L. -L.libs -lunbound
streamtcp$(EXEEXT): $(STREAMTCP_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(STREAMTCP_OBJ)) $(LIBS)
perf$(EXEEXT): $(PERF_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(PERF_OBJ)) $(LIBS)
delayer$(EXEEXT): $(DELAYER_OBJ) $(ldnslib)
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(DELAYER_OBJ)) $(LIBS)
harvest$(EXEEXT): $(HARVEST_OBJ) $(ldnslib) libunbound.la
$(INFO) Link $@
$Q$(LINK) -o $@ $(sort $(HARVEST_OBJ)) $(LIBS) -L. -L.libs -lunbound
unbound-control-setup: $(srcdir)/smallapp/unbound-control-setup.sh
$(INFO) Sed $@
$Qsed -e 's:^DESTDIR=.*$$:DESTDIR=$(UNBOUND_RUN_DIR):' < $< > $@
$Q-chmod +x $@
#testcode/ldns-testpkts.c: $(ldnsdir)/examples/ldns-testpkts.c \
# $(ldnsdir)/examples/ldns-testpkts.h
# cp $(ldnsdir)/examples/ldns-testpkts.c testcode/ldns-testpkts.c
# cp $(ldnsdir)/examples/ldns-testpkts.h testcode/ldns-testpkts.h
ifeq "$(WITH_PYTHONMODULE)" "yes"
$(srcdir)/pythonmod/pythonmod.c: pythonmod/interface.h
%.h: $(srcdir)/%.i $(srcdir)/config.h
@-if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$(INFO) Swig $<
$Q$(SWIG) $(CPPFLAGS) -o $@ -python $<
endif
ifeq "$(WITH_PYUNBOUND)" "yes"
libunbound/python/libunbound_wrap.c: $(srcdir)/libunbound/python/libunbound.i $(srcdir)/libunbound/unbound.h
@-if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$(INFO) Swig $<
$Q$(SWIG) -python -o $@ $(CPPFLAGS) $<
all: _unbound.la
_unbound.la: $(BUILD)libunbound/python/libunbound_wrap.lo libunbound.la
$(INFO) Link $@
$Q$(LIBTOOL) --tag=CC --mode=link $(strip $(CC) $(RUNTIME_PATH) $(CFLAGS) $(LDFLAGS) -module -version-number @LIBUNBOUND_CURRENT@:@LIBUNBOUND_REVISION@:@LIBUNBOUND_AGE@ -no-undefined) -o $@ $< -rpath $(PYTHON_SITE_PKG) L. -L.libs -lunbound $(LIBS)
endif
util/config_file.c: util/configparser.h
util/configlexer.c: $(srcdir)/util/configlexer.lex util/configparser.h
$(INFO) Lex $<
@if test ! -d util; then $(INSTALL) -d util; fi
$Qecho "#include \"util/configyyrename.h\"" > $@
$Q$(LEX) -i -t $< >> $@
ifeq "$(strip $(LEX))" ":"
$Qecho "rebuild lexer, but no lex program, skipped"
else
@-if test ! -d util; then $(INSTALL) -d util; fi
$Qecho "#include \"config.h\"" > $@
$Qecho "#include \"util/configyyrename.h\"" >> $@
$Q$(LEX) -t $< >> $@
endif
util/configparser.c util/configparser.h: $(srcdir)/util/configparser.y
$(INFO) Yacc $<
@if test ! -d util; then $(INSTALL) -d util; fi
@-if test ! -d util; then $(INSTALL) -d util; fi
$Q$(YACC) -d -o util/configparser.c $<
clean:
rm -f *.o *.d *.lo *~ tags
rm -rf autom4te.cache .libs build doc/html
rm -f unbound$(EXEEXT) unbound-checkconf$(EXEEXT) unbound-host$(EXEEXT) unbound-control$(EXEEXT) unbound-control-setup libunbound.la
rm -rf autom4te.cache .libs build doc/html doc/xml
realclean: clean
rm -f config.status config.log config.h.in config.h
rm -f configure config.sub config.guess ltmain.sh aclocal.m4 libtool
rm -f util/configlexer.c util/configparser.c util/configparser.h
rm -f $(TEST_BIN)
if test -d ldns-src; then rm -rf ldns-src; fi
rm -f Makefile
lint:
$Qfor i in $(filter-out util/configparser.c,$(filter-out util/configlexer.c,$(sort $(ALL_SRC)))); do \
echo lint $$i; \
$(LINT) $(LINTFLAGS) -I. -I$(srcdir) -I$(ldnsdir)/include $(srcdir)/$$i ; \
if [ $$? -ne 0 ] ; then exit 1 ; fi ; \
done
$(BUILD)%.lint: $(srcdir)/%.c
$(INFO) Lint $<
@-if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$Q$(LINT) $(LINTFLAGS) -I. -I$(srcdir) -I$(ldnsdir)/include $<
$Qtouch $@
lint: $(addprefix $(BUILD),$(filter-out util/configparser.lint,$(filter-out util/configlexer.lint,$(sort $(ALL_SRC:.c=.lint)))))
tags: $(srcdir)/*.[ch] $(srcdir)/*/*.[ch]
ctags -f $(srcdir)/tags $(srcdir)/*.[ch] $(srcdir)/*/*.[ch]
doc:
ifdef doxygen
$(doxygen) $(srcdir)/doc/unbound.doxygen
if test -n "$(doxygen)"; then \
$(doxygen) $(srcdir)/doc/unbound.doxygen; fi
ifeq "$(findstring yes,$(WITH_PYUNBOUND)$(WITH_PYTHONMODULE))" "yes"
if test -x "`which sphinx-build 2>&1`"; then \
sphinx-build -b html pythonmod/doc doc/html/pythonmod; \
sphinx-build -b html libunbound/python/doc doc/html/pyunbound;\
fi
endif
strip:
$(STRIP) unbound$(EXEEXT)
$(STRIP) unbound-checkconf$(EXEEXT)
$(STRIP) unbound-control$(EXEEXT)
$(STRIP) unbound-host$(EXEEXT)
install:
$(INSTALL) -m 755 -d $(DESTDIR)$(sbindir)
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man8
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man5
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man3
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
$(INSTALL) -m 755 -d $(DESTDIR)$(libdir)
$(INSTALL) -m 755 -d $(DESTDIR)$(includedir)
$(LIBTOOL) --mode=install cp unbound$(EXEEXT) $(DESTDIR)$(sbindir)/unbound$(EXEEXT)
$(LIBTOOL) --mode=install cp unbound-checkconf$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-checkconf$(EXEEXT)
$(LIBTOOL) --mode=install cp unbound-control$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-control$(EXEEXT)
$(LIBTOOL) --mode=install cp unbound-host$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-host$(EXEEXT)
ifeq "$(WITH_PYTHONMODULE)" "yes"
$(INSTALL) -m 755 -d $(DESTDIR)$(PYTHON_SITE_PKG)
$(INSTALL) -c -m 644 pythonmod/unboundmodule.py $(DESTDIR)$(PYTHON_SITE_PKG)/unboundmodule.py
endif
ifeq "$(WITH_PYUNBOUND)" "yes"
$(INSTALL) -m 755 -d $(DESTDIR)$(PYTHON_SITE_PKG)
$(INSTALL) -c -m 644 libunbound/python/unbound.py $(DESTDIR)$(PYTHON_SITE_PKG)/unbound.py
$(LIBTOOL) --mode=install cp _unbound.la $(DESTDIR)$(PYTHON_SITE_PKG)
endif
$(INSTALL) -c -m 644 doc/unbound.8 $(DESTDIR)$(mandir)/man8
$(INSTALL) -c -m 644 doc/unbound-checkconf.8 $(DESTDIR)$(mandir)/man8
$(INSTALL) -c -m 644 doc/unbound-control.8 $(DESTDIR)$(mandir)/man8
$(INSTALL) -c -m 644 doc/unbound.conf.5 $(DESTDIR)$(mandir)/man5
$(INSTALL) -c -m 644 $(srcdir)/doc/unbound-host.1 $(DESTDIR)$(mandir)/man1
$(INSTALL) -c -m 644 doc/libunbound.3 $(DESTDIR)$(mandir)/man3
$(INSTALL) -c -m 755 unbound-control-setup $(DESTDIR)$(sbindir)/unbound-control-setup
if test ! -e $(DESTDIR)$(configfile); then $(INSTALL) -d `dirname $(DESTDIR)$(configfile)`; $(INSTALL) -c -m 644 doc/example.conf $(DESTDIR)$(configfile); fi
$(LIBTOOL) --mode=install cp $(srcdir)/libunbound/unbound.h $(DESTDIR)$(includedir)/unbound.h
$(LIBTOOL) --mode=install cp libunbound.la $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
uninstall:
rm -f -- $(DESTDIR)$(sbindir)/unbound$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-checkconf$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-host$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-control$(EXEEXT) $(DESTDIR)$(sbindir)/unbound-control-setup
rm -f -- $(DESTDIR)$(mandir)/man8/unbound.8 $(DESTDIR)$(mandir)/man8/unbound-checkconf.8 $(DESTDIR)$(mandir)/man5/unbound.conf.5 $(DESTDIR)$(mandir)/man8/unbound-control.8
rm -f -- $(DESTDIR)$(mandir)/man1/unbound-host.1 $(DESTDIR)$(mandir)/man3/libunbound.3
rm -f -- $(DESTDIR)$(includedir)/unbound.h
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/libunbound.la
ifeq "$(WITH_PYTHONMODULE)" "yes"
rm -f -- $(DESTDIR)$(PYTHON_SITE_PKG)/unboundmodule.py
endif
ifeq "$(WITH_PYUNBOUND)" "yes"
rm -f -- $(DESTDIR)$(PYTHON_SITE_PKG)/unbound.py
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(PYTHON_SITE_PKG)/_unbound.la
endif
@echo
@echo "You still need to remove "`dirname $(DESTDIR)$(configfile)`" , $(DESTDIR)$(configfile) by hand"
download_ldns:
svn export https://www.nlnetlabs.nl/svn/ldns/trunk/makedist.sh ldns_makedist.sh
./ldns_makedist.sh -s -d https://www.nlnetlabs.nl/svn/ldns/trunk
mv ldns-[0-9]*.tar.gz ldns-src.tar.gz
rm ldns-*.tar.gz.sha1 ldns_makedist.sh
iana_update:
curl -o port-numbers.tmp http://www.iana.org/assignments/port-numbers
awk '/Unassigned|Reserved/ {next;} { match($$0, "[0-9]+/udp"); if (RLENGTH > 0) print substr($$0, RSTART, RLENGTH - 4) ","}' port-numbers.tmp | sort -nu > portslist.tmp
cat portslist.tmp > util/iana_ports.inc
rm -f port-numbers.tmp portslist.tmp
# Automatic dependencies.
$(BUILD)%.d: $(srcdir)/%.c
$(INFO) Depend $<
@if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$Q$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< \
| sed '\''s!\(.*\)\.o[ :]*!$(dir $@)\1.o $@ : !g'\'' > $@; \
[ -s $@ ] || rm -f $@'
@if test ! -z "$(ldnsdir)" -a ! -e $(ldnsdir)/include/ldns/ldns.h; \
then (cd $(ldnsdir); $(MAKE) copy-headers); fi
@-if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
$Q$(SHELL) -ec '$(CC) $(DEPFLAG) $(CPPFLAGS) $(CFLAGS) $< | sed '\''s!\(.*\)\.o[ :]*!$(dir $@)\1.lo $@ : !g'\'' > $@; [ -s $@ ] || rm -f $@'
-include $(addprefix $(BUILD),$(ALL_SRC:.c=.d))
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),realclean)
ifeq ($(debug_enabled),yes)
-include $(addprefix $(BUILD),$(ALL_SRC:.c=.d) $(COMPAT_SRC:.c=.d))
endif
endif
endif
+11
View File
@@ -0,0 +1,11 @@
Unbound README
* ./configure && make && make install
* on BSDs and Solaris use gmake (GNU make).
* You can use libevent if you want. libevent is useful when using
many (10000) outgoing ports. By default max 256 ports are opened at
the same time and the builtin alternative is equally capable and a
little faster.
* More detailed README, README.svn, README.tests in doc directory
* manual pages can be found in doc directory, and are installed, unbound(8).
* example configuration file doc/example.conf
+122
View File
@@ -0,0 +1,122 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ac_pkg_swig.html
# ===========================================================================
#
# SYNOPSIS
#
# AC_PROG_SWIG([major.minor.micro])
#
# DESCRIPTION
#
# This macro searches for a SWIG installation on your system. If found you
# should call SWIG via $(SWIG). You can use the optional first argument to
# check if the version of the available SWIG is greater than or equal to
# the value of the argument. It should have the format: N[.N[.N]] (N is a
# number between 0 and 999. Only the first N is mandatory.)
#
# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that
# the swig package is this version number or higher.
#
# In configure.in, use as:
#
# AC_PROG_SWIG(1.3.17)
# SWIG_ENABLE_CXX
# SWIG_MULTI_MODULE_SUPPORT
# SWIG_PYTHON
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
# Copyright (c) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([AC_PROG_SWIG],[
AC_PATH_PROG([SWIG],[swig])
if test -z "$SWIG" ; then
AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org])
SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
elif test -n "$1" ; then
AC_MSG_CHECKING([for SWIG version])
[swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
AC_MSG_RESULT([$swig_version])
if test -n "$swig_version" ; then
# Calculate the required version number components
[required=$1]
[required_major=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_major" ; then
[required_major=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_minor" ; then
[required_minor=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_patch" ; then
[required_patch=0]
fi
# Calculate the available version number components
[available=$swig_version]
[available_major=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_major" ; then
[available_major=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_minor" ; then
[available_minor=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_patch=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_patch" ; then
[available_patch=0]
fi
if test $available_major -ne $required_major \
-o $available_minor -ne $required_minor \
-o $available_patch -lt $required_patch ; then
AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org])
SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false'
else
AC_MSG_NOTICE([SWIG executable is '$SWIG'])
SWIG_LIB=`$SWIG -swiglib`
AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
fi
else
AC_MSG_WARN([cannot determine SWIG version])
SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false'
fi
fi
AC_SUBST([SWIG_LIB])
])
Vendored
+5322 -3767
View File
File diff suppressed because it is too large Load Diff
+1207
View File
File diff suppressed because it is too large Load Diff
+200
View File
@@ -0,0 +1,200 @@
AC_DEFUN([AC_PYTHON_DEVEL],[
#
# Allow the use of a (user set) custom python version
#
AC_ARG_VAR([PYTHON_VERSION],[The installed Python
version to use, for example '2.3'. This string
will be appended to the Python interpreter
canonical name.])
AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
if test -z "$PYTHON"; then
AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
PYTHON_VERSION=""
fi
if test -z "$PYTHON_VERSION"; then
PYTHON_VERSION=`$PYTHON -c "import sys, string; \
print string.split(sys.version)[[0]]"`
fi
#
# Check for a version of Python >= 2.1.0
#
AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
ac_supports_python_ver=`$PYTHON -c "import sys, string; \
ver = string.split(sys.version)[[0]]; \
print ver >= '2.1.0'"`
if test "$ac_supports_python_ver" != "True"; then
if test -z "$PYTHON_NOVERSIONCHECK"; then
AC_MSG_RESULT([no])
AC_MSG_FAILURE([
This version of the AC@&t@_PYTHON_DEVEL macro
doesn't work properly with versions of Python before
2.1.0. You may need to re-run configure, setting the
variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG,
PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
to something else than an empty string.
])
else
AC_MSG_RESULT([skip at user request])
fi
else
AC_MSG_RESULT([yes])
fi
#
# if the macro parameter ``version'' is set, honour it
#
if test -n "$1"; then
AC_MSG_CHECKING([for a version of Python $1])
ac_supports_python_ver=`$PYTHON -c "import sys, string; \
ver = string.split(sys.version)[[0]]; \
print ver $1"`
if test "$ac_supports_python_ver" = "True"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([this package requires Python $1.
If you have it installed, but it isn't the default Python
interpreter in your system path, please pass the PYTHON_VERSION
variable to configure. See ``configure --help'' for reference.
])
PYTHON_VERSION=""
fi
fi
#
# Check if you have distutils, else fail
#
AC_MSG_CHECKING([for the distutils Python package])
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
if test -z "$ac_distutils_result"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot import Python module "distutils".
Please check your Python installation. The error was:
$ac_distutils_result])
PYTHON_VERSION=""
fi
#
# Check for Python include path
#
AC_MSG_CHECKING([for Python include path])
if test -z "$PYTHON_CPPFLAGS"; then
python_path=`$PYTHON -c "import distutils.sysconfig; \
print distutils.sysconfig.get_python_inc();"`
if test -n "${python_path}"; then
python_path="-I$python_path"
fi
PYTHON_CPPFLAGS=$python_path
fi
AC_MSG_RESULT([$PYTHON_CPPFLAGS])
AC_SUBST([PYTHON_CPPFLAGS])
#
# Check for Python library path
#
AC_MSG_CHECKING([for Python library path])
if test -z "$PYTHON_LDFLAGS"; then
# (makes two attempts to ensure we've got a version number
# from the interpreter)
py_version=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \
print join(get_config_vars('VERSION'))"`
if test "$py_version" = "[None]"; then
if test -n "$PYTHON_VERSION"; then
py_version=$PYTHON_VERSION
else
py_version=`$PYTHON -c "import sys; \
print sys.version[[:3]]"`
fi
fi
PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
from string import join; \
print '-L' + get_python_lib(0,1), \
'-L' + os.path.dirname(get_python_lib(0,1)), \
'-lpython';"`$py_version
fi
AC_MSG_RESULT([$PYTHON_LDFLAGS])
AC_SUBST([PYTHON_LDFLAGS])
#
# Check for site packages
#
AC_MSG_CHECKING([for Python site-packages path])
if test -z "$PYTHON_SITE_PKG"; then
PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
print distutils.sysconfig.get_python_lib(0,0);"`
fi
AC_MSG_RESULT([$PYTHON_SITE_PKG])
AC_SUBST([PYTHON_SITE_PKG])
#
# libraries which must be linked in when embedding
#
AC_MSG_CHECKING(python extra libraries)
if test -z "$PYTHON_EXTRA_LIBS"; then
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print conf('LOCALMODLIBS'), conf('LIBS')"`
fi
AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
AC_SUBST(PYTHON_EXTRA_LIBS)
#
# linking flags needed when embedding
#
AC_MSG_CHECKING(python extra linking flags)
if test -z "$PYTHON_EXTRA_LDFLAGS"; then
PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
conf = distutils.sysconfig.get_config_var; \
print conf('LINKFORSHARED')"`
fi
AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
AC_SUBST(PYTHON_EXTRA_LDFLAGS)
#
# final check to see if everything compiles alright
#
AC_MSG_CHECKING([consistency of all components of python development environment])
AC_LANG_PUSH([C])
# save current global flags
LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
AC_TRY_LINK([
#include <Python.h>
],[
Py_Initialize();
],[pythonexists=yes],[pythonexists=no])
AC_MSG_RESULT([$pythonexists])
if test ! "$pythonexists" = "yes"; then
AC_MSG_ERROR([
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
])
PYTHON_VERSION=""
fi
AC_LANG_POP
# turn back to default flags
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
#
# all done!
#
])
+39
View File
@@ -0,0 +1,39 @@
/* taken from ldns 1.6.1 */
#include "config.h"
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#include "util/locks.h"
/** the lock for ctime buffer */
static lock_basic_t ctime_lock;
/** has it been inited */
static int ctime_r_init = 0;
/** cleanup ctime_r on exit */
static void
ctime_r_cleanup(void)
{
if(ctime_r_init) {
ctime_r_init = 0;
lock_basic_destroy(&ctime_lock);
}
}
char *ctime_r(const time_t *timep, char *buf)
{
char* result;
if(!ctime_r_init) {
/* still small race where this init can be done twice,
* which is mostly harmless */
ctime_r_init = 1;
lock_basic_init(&ctime_lock);
atexit(&ctime_r_cleanup);
}
lock_basic_lock(&ctime_lock);
result = ctime(timep);
if(buf && result)
strcpy(buf, result);
lock_basic_unlock(&ctime_lock);
return result;
}
+4 -4
View File
@@ -149,23 +149,23 @@ struct addrinfo {
#ifdef getaddrinfo
# undef getaddrinfo
#endif
#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d))
#define getaddrinfo(a,b,c,d) (getaddrinfo_unbound(a,b,c,d))
int getaddrinfo(const char *, const char *,
const struct addrinfo *, struct addrinfo **);
#endif /* !HAVE_GETADDRINFO */
#if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)
#define gai_strerror(a) (ssh_gai_strerror(a))
#define gai_strerror(a) (gai_strerror_unbound(a))
char *gai_strerror(int);
#endif /* !HAVE_GAI_STRERROR */
#ifndef HAVE_FREEADDRINFO
#define freeaddrinfo(a) (ssh_freeaddrinfo(a))
#define freeaddrinfo(a) (freeaddrinfo_unbound(a))
void freeaddrinfo(struct addrinfo *);
#endif /* !HAVE_FREEADDRINFO */
#ifndef HAVE_GETNAMEINFO
#define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g))
#define getnameinfo(a,b,c,d,e,f,g) (getnameinfo_unbound(a,b,c,d,e,f,g))
int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
char *, size_t, int);
#endif /* !HAVE_GETNAMEINFO */
+107
View File
@@ -0,0 +1,107 @@
/*
* Taken from FreeBSD src / lib / libc / stdtime / localtime.c 1.43 revision.
* localtime.c 7.78.
* tzfile.h 1.8
* adapted to be replacement gmtime_r.
*/
#include "config.h"
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#define MONSPERYEAR 12
#define DAYSPERNYEAR 365
#define DAYSPERLYEAR 366
#define SECSPERMIN 60
#define SECSPERHOUR (60*60)
#define SECSPERDAY (24*60*60)
#define DAYSPERWEEK 7
#define TM_SUNDAY 0
#define TM_MONDAY 1
#define TM_TUESDAY 2
#define TM_WEDNESDAY 3
#define TM_THURSDAY 4
#define TM_FRIDAY 5
#define TM_SATURDAY 6
#define TM_YEAR_BASE 1900
#define EPOCH_YEAR 1970
#define EPOCH_WDAY TM_THURSDAY
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
static const int mon_lengths[2][MONSPERYEAR] = {
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
static const int year_lengths[2] = {
DAYSPERNYEAR, DAYSPERLYEAR
};
static void
timesub(timep, offset, tmp)
const time_t * const timep;
const long offset;
struct tm * const tmp;
{
long days;
long rem;
long y;
int yleap;
const int * ip;
days = *timep / SECSPERDAY;
rem = *timep % SECSPERDAY;
rem += (offset);
while (rem < 0) {
rem += SECSPERDAY;
--days;
}
while (rem >= SECSPERDAY) {
rem -= SECSPERDAY;
++days;
}
tmp->tm_hour = (int) (rem / SECSPERHOUR);
rem = rem % SECSPERHOUR;
tmp->tm_min = (int) (rem / SECSPERMIN);
/*
** A positive leap second requires a special
** representation. This uses "... ??:59:60" et seq.
*/
tmp->tm_sec = (int) (rem % SECSPERMIN) ;
tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYSPERWEEK);
if (tmp->tm_wday < 0)
tmp->tm_wday += DAYSPERWEEK;
y = EPOCH_YEAR;
#define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400)
while (days < 0 || days >= (long) year_lengths[yleap = isleap(y)]) {
long newy;
newy = y + days / DAYSPERNYEAR;
if (days < 0)
--newy;
days -= (newy - y) * DAYSPERNYEAR +
LEAPS_THRU_END_OF(newy - 1) -
LEAPS_THRU_END_OF(y - 1);
y = newy;
}
tmp->tm_year = y - TM_YEAR_BASE;
tmp->tm_yday = (int) days;
ip = mon_lengths[yleap];
for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon))
days = days - (long) ip[tmp->tm_mon];
tmp->tm_mday = (int) (days + 1);
tmp->tm_isdst = 0;
}
/*
* Re-entrant version of gmtime.
*/
struct tm * gmtime_r(const time_t* timep, struct tm *tm)
{
timesub(timep, 0L, tm);
return tm;
}
+4
View File
@@ -56,8 +56,12 @@
#include <sys/types.h>
#include <sys/param.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#include <ctype.h>
#if 0
+8
View File
@@ -23,8 +23,12 @@
#include <sys/param.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <string.h>
#include <errno.h>
#include <stdio.h>
@@ -62,7 +66,11 @@ inet_ntop(int af, const void *src, char *dst, size_t size)
case AF_INET6:
return (inet_ntop6(src, dst, size));
default:
#ifdef EAFNOSUPPORT
errno = EAFNOSUPPORT;
#else
errno = ENOSYS;
#endif
return (NULL);
}
/* NOTREACHED */
+4
View File
@@ -70,7 +70,11 @@ inet_pton(af, src, dst)
case AF_INET6:
return (inet_pton6(src, dst));
default:
#ifdef EAFNOSUPPORT
errno = EAFNOSUPPORT;
#else
errno = ENOSYS;
#endif
return (-1);
}
/* NOTREACHED */
+2 -5
View File
@@ -1,11 +1,8 @@
/* Just a replacement, if the original malloc is not
GNU-compliant. See autoconf documentation. */
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include "config.h"
#undef malloc
#include <sys/types.h>
void *malloc ();
@@ -14,7 +11,7 @@ void *malloc ();
If N is zero, allocate a 1-byte block. */
void *
rpl_malloc (size_t n)
rpl_malloc_unbound (size_t n)
{
if (n == 0)
n = 1;
+5 -5
View File
@@ -528,7 +528,7 @@ static long double abs_val (long double value)
return result;
}
static long double pow10 (int exp)
static long double compat_pow10 (int exp)
{
long double result = 1;
@@ -541,7 +541,7 @@ static long double pow10 (int exp)
return result;
}
static long round (long double value)
static long compat_round (long double value)
{
long intpart;
@@ -602,12 +602,12 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
/* We "cheat" by converting the fractional part to integer by
* multiplying by a factor of 10
*/
fracpart = round ((pow10 (max)) * (ufvalue - intpart));
fracpart = compat_round ((compat_pow10 (max)) * (ufvalue - intpart));
if (fracpart >= pow10 (max))
if (fracpart >= compat_pow10 (max))
{
intpart++;
fracpart -= pow10 (max);
fracpart -= compat_pow10 (max);
}
#ifdef DEBUG_SNPRINTF
Vendored Executable
+1561
View File
File diff suppressed because it is too large Load Diff
+824
View File
@@ -0,0 +1,824 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Directory to chroot to */
#undef CHROOT_DIR
/* Pathname to the Unbound configuration file */
#undef CONFIGFILE
/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
*/
#undef DARWIN_BROKEN_SETREUID
/* Whether daemon is deprecated */
#undef DEPRECATED_DAEMON
/* Define if you want to use debug lock checking (slow). */
#undef ENABLE_LOCK_CHECKS
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Whether the C compiler accepts the "format" attribute */
#undef HAVE_ATTR_FORMAT
/* Whether the C compiler accepts the "unused" attribute */
#undef HAVE_ATTR_UNUSED
/* Define to 1 if your system has a working `chown' function. */
#undef HAVE_CHOWN
/* Define to 1 if you have the `chroot' function. */
#undef HAVE_CHROOT
/* Define to 1 if you have the `ctime_r' function. */
#undef HAVE_CTIME_R
/* Define to 1 if you have the `daemon' function. */
#undef HAVE_DAEMON
/* Define to 1 if you have the declaration of
`SSL_COMP_get_compression_methods', and to 0 if you don't. */
#undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `event_base_free' function. */
#undef HAVE_EVENT_BASE_FREE
/* Define to 1 if you have the `event_base_get_method' function. */
#undef HAVE_EVENT_BASE_GET_METHOD
/* Define to 1 if you have the `event_base_new' function. */
#undef HAVE_EVENT_BASE_NEW
/* Define to 1 if you have the `event_base_once' function. */
#undef HAVE_EVENT_BASE_ONCE
/* Define to 1 if you have the <event.h> header file. */
#undef HAVE_EVENT_H
/* Define to 1 if you have the `EVP_sha1' function. */
#undef HAVE_EVP_SHA1
/* Define to 1 if you have the `EVP_sha256' function. */
#undef HAVE_EVP_SHA256
/* Define to 1 if you have the `EVP_sha512' function. */
#undef HAVE_EVP_SHA512
/* Define to 1 if you have the `ev_loop' function. */
#undef HAVE_EV_LOOP
/* Define to 1 if you have the `fcntl' function. */
#undef HAVE_FCNTL
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
/* Whether getaddrinfo is available */
#undef HAVE_GETADDRINFO
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `getpwnam' function. */
#undef HAVE_GETPWNAM
/* Define to 1 if you have the `getrlimit' function. */
#undef HAVE_GETRLIMIT
/* Define to 1 if you have the `glob' function. */
#undef HAVE_GLOB
/* Define to 1 if you have the <glob.h> header file. */
#undef HAVE_GLOB_H
/* Define to 1 if you have the `gmtime_r' function. */
#undef HAVE_GMTIME_R
/* Define to 1 if you have the <grp.h> header file. */
#undef HAVE_GRP_H
/* If you have HMAC_CTX_init */
#undef HAVE_HMAC_CTX_INIT
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
/* Define to 1 if you have the `inet_ntop' function. */
#undef HAVE_INET_NTOP
/* Define to 1 if you have the `inet_pton' function. */
#undef HAVE_INET_PTON
/* Define to 1 if you have the `initgroups' function. */
#undef HAVE_INITGROUPS
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* if the function 'ioctlsocket' is available */
#undef HAVE_IOCTLSOCKET
/* Define to 1 if you have the <iphlpapi.h> header file. */
#undef HAVE_IPHLPAPI_H
/* Define to 1 if you have the `kill' function. */
#undef HAVE_KILL
/* Define to 1 if you have the `ldns' library (-lldns). */
#undef HAVE_LIBLDNS
/* Define to 1 if you have the `localtime_r' function. */
#undef HAVE_LOCALTIME_R
/* Define to 1 if you have the <login_cap.h> header file. */
#undef HAVE_LOGIN_CAP_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the `OPENSSL_config' function. */
#undef HAVE_OPENSSL_CONFIG
/* Define to 1 if you have the <openssl/conf.h> header file. */
#undef HAVE_OPENSSL_CONF_H
/* Define to 1 if you have the <openssl/engine.h> header file. */
#undef HAVE_OPENSSL_ENGINE_H
/* Define to 1 if you have the <openssl/err.h> header file. */
#undef HAVE_OPENSSL_ERR_H
/* Define to 1 if you have the <openssl/rand.h> header file. */
#undef HAVE_OPENSSL_RAND_H
/* Define to 1 if you have the <openssl/ssl.h> header file. */
#undef HAVE_OPENSSL_SSL_H
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
/* Define to 1 if the system has the type `pthread_rwlock_t'. */
#undef HAVE_PTHREAD_RWLOCK_T
/* Define to 1 if the system has the type `pthread_spinlock_t'. */
#undef HAVE_PTHREAD_SPINLOCK_T
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* Define if you have Python libraries and header files. */
#undef HAVE_PYTHON
/* Define to 1 if you have the `random' function. */
#undef HAVE_RANDOM
/* Define to 1 if you have the `recvmsg' function. */
#undef HAVE_RECVMSG
/* Define to 1 if you have the `sbrk' function. */
#undef HAVE_SBRK
/* Define to 1 if you have the `sendmsg' function. */
#undef HAVE_SENDMSG
/* Define to 1 if you have the `setregid' function. */
#undef HAVE_SETREGID
/* Define to 1 if you have the `setresgid' function. */
#undef HAVE_SETRESGID
/* Define to 1 if you have the `setresuid' function. */
#undef HAVE_SETRESUID
/* Define to 1 if you have the `setreuid' function. */
#undef HAVE_SETREUID
/* Define to 1 if you have the `setsid' function. */
#undef HAVE_SETSID
/* Define to 1 if you have the `setusercontext' function. */
#undef HAVE_SETUSERCONTEXT
/* Define to 1 if you have the `sigprocmask' function. */
#undef HAVE_SIGPROCMASK
/* Define to 1 if you have the `sleep' function. */
#undef HAVE_SLEEP
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Using Solaris threads */
#undef HAVE_SOLARIS_THREADS
/* Define to 1 if you have the `srandom' function. */
#undef HAVE_SRANDOM
/* Define if you have the SSL libraries installed. */
#undef HAVE_SSL
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stdbool.h> header file. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define if you have Swig libraries and header files. */
#undef HAVE_SWIG
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define to 1 if you have the `tzset' function. */
#undef HAVE_TZSET
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
/* Using Windows threads */
#undef HAVE_WINDOWS_THREADS
/* Define to 1 if you have the <winsock2.h> header file. */
#undef HAVE_WINSOCK2_H
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Define to 1 if you have the `writev' function. */
#undef HAVE_WRITEV
/* Define to 1 if you have the <ws2tcpip.h> header file. */
#undef HAVE_WS2TCPIP_H
/* Define to 1 if you have the `_beginthreadex' function. */
#undef HAVE__BEGINTHREADEX
/* if lex has yylex_destroy */
#undef LEX_HAS_YYLEX_DESTROY
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Define to the maximum message length to pass to syslog. */
#undef MAXSYSLOGMSGLEN
/* Define if mkdir has one argument. */
#undef MKDIR_HAS_ONE_ARG
/* Define if the network stack does not fully support nonblocking io (causes
lower performance). */
#undef NONBLOCKING_IS_BROKEN
/* Put -D_ALL_SOURCE define in config.h */
#undef OMITTED__D_ALL_SOURCE
/* Put -D_BSD_SOURCE define in config.h */
#undef OMITTED__D_BSD_SOURCE
/* Put -D_GNU_SOURCE define in config.h */
#undef OMITTED__D_GNU_SOURCE
/* Put -D_LARGEFILE_SOURCE=1 define in config.h */
#undef OMITTED__D_LARGEFILE_SOURCE_1
/* Put -D_POSIX_C_SOURCE=200112 define in config.h */
#undef OMITTED__D_POSIX_C_SOURCE_200112
/* Put -D_XOPEN_SOURCE=600 define in config.h */
#undef OMITTED__D_XOPEN_SOURCE_600
/* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
#undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1
/* Put -D__EXTENSIONS__ define in config.h */
#undef OMITTED__D__EXTENSIONS__
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* default pidfile location */
#undef PIDFILE
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
#undef PTHREAD_CREATE_JOINABLE
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* version number for resource files */
#undef RSRC_PACKAGE_VERSION
/* Directory to chdir to */
#undef RUN_DIR
/* Shared data */
#undef SHARE_DIR
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Use win32 resources and API */
#undef UB_ON_WINDOWS
/* default username */
#undef UB_USERNAME
/* use statistics for allocs and frees, for debug use */
#undef UNBOUND_ALLOC_STATS
/* define this to enable debug checks. */
#undef UNBOUND_DEBUG
/* Define this to enable GOST support. */
#undef USE_GOST
/* Define if you want to use internal select based events */
#undef USE_MINI_EVENT
/* Define this to enable SHA256 and SHA512 support. */
#undef USE_SHA2
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Whether the windows socket API is used */
#undef USE_WINSOCK
/* the version of the windows API enabled */
#undef WINVER
/* Define if you want Python module. */
#undef WITH_PYTHONMODULE
/* Define if you want PyUnbound. */
#undef WITH_PYUNBOUND
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
#undef _LARGEFILE_SOURCE
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* in_addr_t */
#undef in_addr_t
/* in_port_t */
#undef in_port_t
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `short' if <sys/types.h> does not define. */
#undef int16_t
/* Define to `int' if <sys/types.h> does not define. */
#undef int32_t
/* Define to `long long' if <sys/types.h> does not define. */
#undef int64_t
/* Define to `signed char' if <sys/types.h> does not define. */
#undef int8_t
/* Define if replacement function should be used. */
#undef malloc
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to 'int' if not defined */
#undef rlim_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to 'int' if not defined */
#undef socklen_t
/* Define to `int' if <sys/types.h> does not define. */
#undef ssize_t
/* Define to 'unsigned char if not defined */
#undef u_char
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define to `unsigned short' if <sys/types.h> does not define. */
#undef uint16_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef uint32_t
/* Define to `unsigned long long' if <sys/types.h> does not define. */
#undef uint64_t
/* Define to `unsigned char' if <sys/types.h> does not define. */
#undef uint8_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork
#if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
#define _GNU_SOURCE 1
#endif
#if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
#define _BSD_SOURCE 1
#endif
#if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
#define __EXTENSIONS__ 1
#endif
#if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 200112
#endif
#if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
#define _XOPEN_SOURCE 600
#endif
#if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
#define _XOPEN_SOURCE_EXTENDED 1
#endif
#if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
#define _ALL_SOURCE 1
#endif
#if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
#define _LARGEFILE_SOURCE 1
#endif
#ifndef UNBOUND_DEBUG
# define NDEBUG
#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <errno.h>
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#ifdef HAVE_OPENSSL_ERR_H
#include <openssl/err.h>
#endif
#ifdef HAVE_OPENSSL_RAND_H
#include <openssl/rand.h>
#endif
#ifdef HAVE_OPENSSL_CONF_H
#include <openssl/conf.h>
#endif
#ifdef HAVE_OPENSSL_ENGINE_H
#include <openssl/engine.h>
#endif
#ifdef HAVE_ATTR_FORMAT
# define ATTR_FORMAT(archetype, string_index, first_to_check) \
__attribute__ ((format (archetype, string_index, first_to_check)))
#else /* !HAVE_ATTR_FORMAT */
# define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
#endif /* !HAVE_ATTR_FORMAT */
#if defined(DOXYGEN)
# define ATTR_UNUSED(x) x
#elif defined(__cplusplus)
# define ATTR_UNUSED(x)
#elif defined(HAVE_ATTR_UNUSED)
# define ATTR_UNUSED(x) x __attribute__((unused))
#else /* !HAVE_ATTR_UNUSED */
# define ATTR_UNUSED(x) x
#endif /* !HAVE_ATTR_UNUSED */
#ifndef HAVE_FSEEKO
#define fseeko fseek
#define ftello ftell
#endif /* HAVE_FSEEKO */
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256
#endif
#ifndef HAVE_SNPRINTF
#define snprintf snprintf_unbound
#define vsnprintf vsnprintf_unbound
#include <stdarg.h>
int snprintf (char *str, size_t count, const char *fmt, ...);
int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
#endif /* HAVE_SNPRINTF */
#ifndef HAVE_INET_PTON
#define inet_pton inet_pton_unbound
int inet_pton(int af, const char* src, void* dst);
#endif /* HAVE_INET_PTON */
#ifndef HAVE_INET_NTOP
#define inet_ntop inet_ntop_unbound
const char *inet_ntop(int af, const void *src, char *dst, size_t size);
#endif
#ifndef HAVE_INET_ATON
#define inet_aton inet_aton_unbound
int inet_aton(const char *cp, struct in_addr *addr);
#endif
#ifndef HAVE_MEMMOVE
#define memmove memmove_unbound
void *memmove(void *dest, const void *src, size_t n);
#endif
#ifndef HAVE_STRLCPY
#define strlcpy strlcpy_unbound
size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
#ifndef HAVE_GMTIME_R
#define gmtime_r gmtime_r_unbound
struct tm *gmtime_r(const time_t *timep, struct tm *result);
#endif
#ifndef HAVE_SLEEP
#define sleep(x) Sleep((x)*1000) /* on win32 */
#endif /* HAVE_SLEEP */
#ifndef HAVE_USLEEP
#define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
#endif /* HAVE_USLEEP */
#ifndef HAVE_RANDOM
#define random rand /* on win32, for tests only (bad random) */
#endif /* HAVE_RANDOM */
#ifndef HAVE_SRANDOM
#define srandom(x) srand(x) /* on win32, for tests only (bad random) */
#endif /* HAVE_SRANDOM */
/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
#ifdef HAVE_WINSOCK2_H
#define FD_SET_T (u_int)
#else
#define FD_SET_T
#endif
#ifndef IPV6_MIN_MTU
#define IPV6_MIN_MTU 1280
#endif /* IPV6_MIN_MTU */
#ifndef HAVE_CTIME_R
#define ctime_r unbound_ctime_r
char *ctime_r(const time_t *timep, char *buf);
#endif
#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
/* using version of libevent that is not threadsafe. */
# define LIBEVENT_SIGNAL_PROBLEM 1
#endif
#ifndef CHECKED_INET6
# define CHECKED_INET6
# ifdef AF_INET6
# define INET6
# else
# define AF_INET6 28
# endif
#endif /* CHECKED_INET6 */
/* maximum nesting of included files */
#define MAXINCLUDES 10
#ifndef HAVE_GETADDRINFO
struct sockaddr_storage;
#include "compat/fake-rfc2553.h"
#endif
#include "ldns/ldns.h"
#ifdef UNBOUND_ALLOC_STATS
# define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
# define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
# define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
# define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
void *unbound_stat_malloc(size_t size);
void *unbound_stat_calloc(size_t nmemb, size_t size);
void unbound_stat_free(void *ptr);
void *unbound_stat_realloc(void *ptr, size_t size);
void *unbound_stat_malloc_log(size_t size, const char* file, int line,
const char* func);
void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
int line, const char* func);
void unbound_stat_free_log(void *ptr, const char* file, int line,
const char* func);
void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
int line, const char* func);
#endif /* UNBOUND_ALLOC_STATS */
/** default port for DNS traffic. */
#define UNBOUND_DNS_PORT 53
Vendored Executable
+1686
View File
File diff suppressed because it is too large Load Diff
Vendored Executable
+25223
View File
File diff suppressed because it is too large Load Diff
+582 -417
View File
File diff suppressed because it is too large Load Diff
+18
View File
@@ -0,0 +1,18 @@
These files are contributed to unbound, and are not part of the official
distribution but may be helpful.
* rc_d_unbound: FreeBSD compatible /etc/rc.d script.
* parseunbound.pl: perl script to run from cron that parses statistics from
the log file and stores them.
* unbound.spec and unbound.init: RPM specfile and Linux rc.d initfile.
* update-anchor.sh: shell script that uses unbound-host to update a set
of trust anchor files. Run from cron twice a month.
* update-itar.sh: shell script that updates from itar.iana.org. Run from cron.
* split-itar.sh: shell script to split anchors.mf from itar.iana.org into
multiple key files so it can be used with auto-trust-anchor-file.
* unbound_munin_ : plugin for munin statistics report
* unbound_cacti.tar.gz : setup files for cacti statistics report
* selinux: the .fc and .te files for SElinux protection of the unbound daemon
* unbound.plist: launchd configuration file for MacOSX.
* build-unbound-localzone-from-hosts.pl: perl script to turn /etc/hosts into
a local-zone and local-data include file for unbound.conf.
@@ -0,0 +1,67 @@
#!/usr/bin/perl -WT
use strict;
use warnings;
my $hostsfile = '/etc/hosts';
my $localzonefile = '/etc/unbound/localzone.conf.new';
my $localzone = 'example.com';
open( HOSTS,"<${hostsfile}" ) or die( "Could not open ${hostsfile}: $!" );
open( ZONE,">${localzonefile}" ) or die( "Could not open ${localzonefile}: $!" );
print ZONE "server:\n\n";
print ZONE "local-zone: \"${localzone}\" transparent\n\n";
my %ptrhash;
while ( my $hostline = <HOSTS> ) {
# Skip comments
if ( $hostline !~ "^#" and $hostline !~ '^\s+$' ) {
my @entries = split( /\s+/, $hostline );
my $ip;
my $count = 0;
foreach my $entry ( @entries ) {
if ( $count == 0 ) {
$ip = $entry;
} else {
if ( $count == 1) {
# Only return localhost for 127.0.0.1 and ::1
if ( ($ip ne '127.0.0.1' and $ip ne '::1') or $entry =~ 'localhost' ) {
if ( ! defined $ptrhash{$ip} ) {
$ptrhash{$ip} = $entry;
print ZONE "local-data-ptr: \"$ip $entry\"\n";
}
}
}
# Use AAAA for IPv6 addresses
my $a = 'A';
if ( $ip =~ ':' ) {
$a = 'AAAA';
}
print ZONE "local-data: \"$entry ${a} $ip\"\n";
}
$count++;
}
print ZONE "\n";
}
}
__END__
+140
View File
@@ -0,0 +1,140 @@
#!/usr/local/bin/perl -w
#
# Script to parse the output from the unbound namedaemon.
# Unbound supports a threading model, and outputs a multiline log-blob for
# every thread.
#
# This script should parse all threads of the once, and store it
# in a local cached file for speedy results when queried lots.
#
use strict;
use POSIX qw(SEEK_END);
use Storable;
use FileHandle;
use Carp qw(croak carp);
use constant UNBOUND_CACHE => "/var/tmp/unbound-cache.stor";
my $run_from_cron = @ARGV && $ARGV[0] eq "--cron" && shift;
my $DEBUG = -t STDERR;
# NB. VERY IMPORTANTES: set this when running this script.
my $numthreads = 4;
### if cache exists, read it in. and is newer than 3 minutes
if ( -r UNBOUND_CACHE ) {
my $result = retrieve(UNBOUND_CACHE);
if (-M _ < 3/24/60 && !$run_from_cron ) {
print STDERR "Cached results:\n" if $DEBUG;
print join("\n", @$result), "\n";
exit;
}
}
my $logfile = shift or die "Usage: parseunbound.pl --cron unboundlogfile";
my $in = new FileHandle $logfile or die "Cannot open $logfile: $!\n";
# there is a special key 'thread' that indicates the thread. its not used, but returned anyway.
my @records = ('thread', 'queries', 'cachehits', 'recursions', 'recursionavg',
'outstandingmax', 'outstandingavg', 'outstandingexc',
'median25', 'median50', 'median75',
'us_0', 'us_1', 'us_2', 'us_4', 'us_8', 'us_16', 'us_32',
'us_64', 'us_128', 'us_256', 'us_512', 'us_1024', 'us_2048',
'us_4096', 'us_8192', 'us_16384', 'us_32768', 'us_65536',
'us_131072', 'us_262144', 'us_524288', 's_1', 's_2', 's_4',
's_8', 's_16', 's_32', 's_64', 's_128', 's_256', 's_512');
# Stats hash containing one or more keys. for every thread, 1 key.
my %allstats = (); # key="$threadid", stats={key => value}
my %startstats = (); # when we got a queries entry for this thread
my %donestats = (); # same, but only when we got a histogram entry for it
# stats hash contains name/value pairs of the actual numbers for that thread.
my $offset = 0;
my $inthread=0;
my $inpid;
# We should continue looping untill we meet these conditions:
# a) more total queries than the previous run (which defaults to 0) AND
# b) parsed all $numthreads threads in the log.
my $numqueries = $previousresult ? $previousresult->[1] : 0;
# Main loop
while ( scalar keys %startstats < $numthreads || scalar keys %donestats < $numthreads) {
$offset += 10000;
if ( $offset > -s $logfile or $offset > 10_000_000 ) {
die "Cannot find stats in $logfile\n";
}
$in->seek(-$offset, SEEK_END) or croak "cannot seek $logfile: $!\n";
for my $line ( <$in> ) {
chomp($line);
#[1208777234] unbound[6705:0]
if ($line =~ m/^\[\d+\] unbound\[\d+:(\d+)\]/) {
$inthread = $1;
if ($inthread + 1 > $numthreads) {
die "Hey. lazy. change \$numthreads in this script to ($inthread)\n";
}
}
# this line doesn't contain a pid:thread. skip.
else {
next;
}
if ( $line =~ m/info: server stats for thread \d+: (\d+) queries, (\d+) answers from cache, (\d+) recursions/ ) {
$startstats{$inthread} = 1;
$allstats{$inthread}->{thread} = $inthread;
$allstats{$inthread}->{queries} = $1;
$allstats{$inthread}->{cachehits} = $2;
$allstats{$inthread}->{recursions} = $3;
}
elsif ( $line =~ m/info: server stats for thread (\d+): requestlist max (\d+) avg ([0-9\.]+) exceeded (\d+)/ ) {
$allstats{$inthread}->{outstandingmax} = $2;
$allstats{$inthread}->{outstandingavg} = int($3); # This is a float; rrdtool only handles ints.
$allstats{$inthread}->{outstandingexc} = $4;
}
elsif ( $line =~ m/info: average recursion processing time ([0-9\.]+) sec/ ) {
$allstats{$inthread}->{recursionavg} = int($1 * 1000); # change sec to milisec.
}
elsif ( $line =~ m/info: histogram of recursion processing times/ ) {
next;
}
elsif ( $line =~ m/info: \[25%\]=([0-9\.]+) median\[50%\]=([0-9\.]+) \[75%\]=([0-9\.]+)/ ) {
$allstats{$inthread}->{median25} = int($1 * 1000000); # change seconds to usec
$allstats{$inthread}->{median50} = int($2 * 1000000);
$allstats{$inthread}->{median75} = int($3 * 1000000);
}
elsif ( $line =~ m/info: lower\(secs\) upper\(secs\) recursions/ ) {
# since after this line we're unsure if we get these numbers
# at all, we sould consider this marker as the end of the
# block. Chances that we're parsing a file halfway written
# at this stage are small. Bold statement.
$donestats{$inthread} = 1;
next;
}
elsif ( $line =~ m/info:\s+(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)/ ) {
my ($froms, $fromus, $toms, $tous, $counter) = ($1, $2, $3, $4, $5);
my $prefix = '';
if ($froms > 0) {
$allstats{$inthread}->{'s_' . int($froms)} = $counter;
} else {
$allstats{$inthread}->{'us_' . int($fromus)} = $counter;
}
}
}
}
my @result;
# loop on the records we want to store
for my $key ( @records ) {
my $sum = 0;
# these are the different threads parsed
foreach my $thread ( 0 .. $numthreads - 1 ) {
$sum += ($allstats{$thread}->{$key} || 0);
}
print STDERR "$key = " . $sum . "\n" if $DEBUG;
push @result, $sum;
}
print join("\n", @result), "\n";
store \@result, UNBOUND_CACHE;
if ($DEBUG) {
print STDERR "Threads: " . (scalar keys %allstats) . "\n";
}
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
#
# unbound freebsd startup rc.d script, modified from the named script.
# uses the default unbound installation path and pidfile location.
# copy this to /etc/rc.d/unbound
# and put unbound_enable="YES" into rc.conf
#
# PROVIDE: unbound
# REQUIRE: SERVERS cleanvar
# KEYWORD: shutdown
. /etc/rc.subr
name="unbound"
rcvar=`set_rcvar`
load_rc_config $name
command="/usr/local/sbin/unbound"
pidfile=${unbound_pidfile:-"/usr/local/etc/unbound/unbound.pid"}
command_args=${unbound_flags:-"-c /usr/local/etc/unbound/unbound.conf"}
extra_commands="reload"
run_rc_command "$1"
+4
View File
@@ -0,0 +1,4 @@
/etc/unbound(/.*)? system_u:object_r:unbound_conf_t:s0
/etc/rc\.d/init\.d/unbound -- system_u:object_r:unbound_initrc_exec_t:s0
/usr/sbin/unbound -- system_u:object_r:unbound_exec_t:s0
/var/run/unbound(/.*)? system_u:object_r:unbound_var_run_t:s0
+42
View File
@@ -0,0 +1,42 @@
policy_module(unbound, 0.1.0)
type unbound_t;
type unbound_conf_t;
type unbound_exec_t;
type unbound_initrc_exec_t;
type unbound_var_run_t;
init_daemon_domain(unbound_t, unbound_exec_t)
init_script_file(unbound_initrc_exec_t)
role system_r types unbound_t;
# XXX
# unbound-{checkconf,control} are not protected. Do we need protect them?
# Unbound daemon
auth_use_nsswitch(unbound_t)
dev_read_urand(unbound_t)
corenet_all_recvfrom_unlabeled(unbound_t)
corenet_tcp_bind_all_nodes(unbound_t)
corenet_tcp_bind_dns_port(unbound_t)
corenet_tcp_bind_rndc_port(unbound_t)
corenet_udp_bind_all_nodes(unbound_t)
corenet_udp_bind_all_unreserved_ports(unbound_t)
corenet_udp_bind_dns_port(unbound_t)
files_read_etc_files(unbound_t)
files_pid_file(unbound_var_run_t)
files_type(unbound_conf_t)
libs_use_ld_so(unbound_t)
libs_use_shared_libs(unbound_t)
logging_send_syslog_msg(unbound_t)
manage_files_pattern(unbound_t, unbound_var_run_t, unbound_var_run_t)
miscfiles_read_localization(unbound_t)
read_files_pattern(unbound_t, unbound_conf_t, unbound_conf_t)
allow unbound_t self:capability { setuid chown net_bind_service setgid dac_override };
allow unbound_t self:tcp_socket create_stream_socket_perms;
allow unbound_t self:udp_socket create_socket_perms;
###################################################
+46
View File
@@ -0,0 +1,46 @@
#/usr/bin/env bash
# Contributed by Tom Hendrikx <tom@whyscream.net>
PROGNAME=$(basename $0)
usage() {
echo "$PROGNAME: split the anchors.mf file from IANA into separate files." >&2
echo "" >&2
echo "$PROGNAME uses 2 arguments:" >&2
echo " - the path to the anchors.mf, available at: https://itar.iana.org/" >&2
echo " - the directory to leave the files, defaults to '.' (current working dir)" >&2
exit 1
}
if [ -n "$1" ] && [ -r "$1" ]; then
itar="$1"
echo "Reading from: $itar"
else
echo "Error: no anchors file given" >&2
usage
fi
if [ -n "$2" ]; then
dir="$2"
else
dir=$(pwd)
fi
if [ ! -d "$dir" ]; then
echo "Error: $dir is not a directory" >&2
usage
fi
while read cn line; do
if [ $(expr match "$cn" '[a-zA-Z0-9-]*\.') -gt 0 ]; then
# first line of key
out="$dir/$cn"anchor
echo "writing key for $cn to: $out"
echo "$cn $line" > $out
elif [ "$cn" == "DS" ]; then
# second or later line of earlier defined key
echo " $cn $line" >> $out
fi
done < "$itar"
echo "Done."
+139
View File
@@ -0,0 +1,139 @@
#!/bin/sh
#
# unbound This shell script takes care of starting and stopping
# unbound (DNS server).
#
# chkconfig: - 14 86
# description: unbound is a Domain Name Server (DNS) \
# that is used to resolve host names to IP addresses.
### BEGIN INIT INFO
# Provides: $named unbound
# Required-Start: $network $local_fs
# Required-Stop: $network $local_fs
# Should-Start: $syslog
# Should-Stop: $syslog
# Short-Description: unbound recursive Domain Name Server.
# Description: unbound is a Domain Name Server (DNS)
# that is used to resolve host names to IP addresses.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/unbound"
prog="unbound"
config="/var/unbound/unbound.conf"
pidfile="/var/unbound/unbound.pid"
rootdir="/var/unbound"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
# setup root jail
if [ -s /etc/localtime ]; then
[ -d ${rootdir}/etc ] || mkdir -p ${rootdir}/etc ;
if [ ! -e ${rootdir}/etc/localtime ] || /usr/bin/cmp -s /etc/localtime ${rootdir}/etc/localtime; then
cp -fp /etc/localtime ${rootdir}/etc/localtime
fi;
fi;
if [ -s /etc/resolv.conf ]; then
[ -d ${rootdir}/etc ] || mkdir -p ${rootdir}/etc ;
if [ ! -e ${rootdir}/etc/resolv.conf ] || /usr/bin/cmp -s /etc/resolv.conf ${rootdir}/etc/resolv.conf; then
cp -fp /etc/resolv.conf ${rootdir}/etc/resolv.conf
fi;
fi;
if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/log' /proc/mounts; then
[ -d ${rootdir}/dev ] || mkdir -p ${rootdir}/dev ;
[ -e ${rootdir}/dev/log ] || touch ${rootdir}/dev/log
mount --bind -n /dev/log ${rootdir}/dev/log >/dev/null 2>&1;
fi;
if ! egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/random' /proc/mounts; then
[ -d ${rootdir}/dev ] || mkdir -p ${rootdir}/dev ;
[ -e ${rootdir}/dev/random ] || touch ${rootdir}/dev/random
mount --bind -n /dev/random ${rootdir}/dev/random >/dev/null 2>&1;
fi;
# if not running, start it up here
daemon $exec
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
# stop it here, often "killproc $prog"
killproc -p $pidfile $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/log' /proc/mounts; then
umount ${rootdir}/dev/log >/dev/null 2>&1
fi;
if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}'/dev/random' /proc/mounts; then
umount ${rootdir}/dev/random >/dev/null 2>&1
fi;
return $retval
}
restart() {
stop
start
}
reload() {
kill -HUP `cat $pidfile`
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $pidfile $prog
}
rh_status_q() {
rh_status -p $pidfile >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?
+119
View File
@@ -0,0 +1,119 @@
#!/bin/sh
#
# unbound This shell script takes care of starting and stopping
# unbound (DNS server).
#
# chkconfig: - 14 86
# description: unbound is a Domain Name Server (DNS) \
# that is used to resolve host names to IP addresses.
### BEGIN INIT INFO
# Provides: unbound
# Required-Start: $network $local_fs
# Required-Stop: $network $local_fs
# Should-Start: $syslog
# Should-Stop: $syslog
# Short-Description: unbound recursive Domain Name Server.
# Description: unbound is a Domain Name Server (DNS)
# that is used to resolve host names to IP addresses.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/unbound"
config="/var/lib/unbound/unbound.conf"
rootdir="/var/lib/unbound"
pidfile="/var/run/unbound/unbound.pid"
[ -e /etc/sysconfig/unbound ] && . /etc/sysconfig/unbound
lockfile=/var/lock/subsys/unbound
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting unbound: "
if [ ! -e ${rootdir}/etc/resolv.conf ] || /usr/bin/cmp -s /etc/resolv.conf ${rootdir}/etc/resolv.conf; then
cp -fp /etc/resolv.conf ${rootdir}/etc/resolv.conf
fi;
if [ ! -e ${rootdir}/etc/localtime ] || /usr/bin/cmp -s /etc/localtime ${rootdir}/etc/localtime; then
cp -fp /etc/localtime ${rootdir}/etc/localtime
fi;
mount --bind -n /dev/log ${rootdir}/dev/log >/dev/null 2>&1;
mount --bind -n /dev/random ${rootdir}/dev/random >/dev/null 2>&1;
mount --bind -n /var/run/unbound ${rootdir}/var/run/unbound >/dev/null 2>&1;
# if not running, start it up here
daemon $exec
retval=$?
[ $retval -eq 0 ] && touch $lockfile
echo
}
stop() {
echo -n $"Stopping unbound: "
# stop it here, often "killproc unbound"
killproc -p $pidfile unbound
retval=$?
[ $retval -eq 0 ] && rm -f $lockfile
for mountfile in /dev/log /dev/random /etc/localtime /etc/resolv.conf /var/run/unbound
do
if egrep -q '^/[^[:space:]]+[[:space:]]+'${rootdir}''${mountfile}'' /proc/mounts; then
umount ${rootdir}$mountfile >/dev/null 2>&1
fi;
done
echo
}
restart() {
stop
start
}
reload() {
kill -HUP `cat $pidfile`
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $pidfile unbound
}
rh_status_q() {
rh_status -p $pidfile >/dev/null 2>&1
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<!--
Unbound plist file for use by MacOSX launchd(8) using launchctl(1).
Copy this file to /Library/LaunchDaemons. Launchd keeps unbound running.
Setup your unbound.conf with the following additional settings.
server:
do-daemonize: no
username: ""
chroot: ""
directory: ""
These actions are performed by launchd (for the option values, see below).
-->
<dict>
<key>Label</key>
<string>unbound</string>
<key>ProgramArguments</key>
<array>
<string>unbound</string>
</array>
<key>UserName</key>
<string>unbound</string>
<key>RootDirectory</key>
<string>/usr/local/etc/unbound</string>
<key>WorkingDirectory</key>
<string>/usr/local/etc/unbound</string>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
+103
View File
@@ -0,0 +1,103 @@
Summary: Validating, recursive, and caching DNS resolver
Name: unbound
Version: 1.0.1
Release: 1%{?dist}
License: BSD
Url: http://www.nlnetlabs.nl/unbound/
Source: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
#Source1: unbound.init
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: flex, openssl-devel
%description
Unbound is a validating, recursive, and caching DNS resolver.
The C implementation of Unbound is developed and maintained by NLnet
Labs. It is based on ideas and algorithms taken from a java prototype
developed by Verisign labs, Nominet, Kirei and ep.net.
Unbound is designed as a set of modular components, so that also
DNSSEC (secure DNS) validation and stub-resolvers (that do not run
as a server, but are linked into an application) are easily possible.
The source code is under a BSD License.
%prep
%setup -q
# configure with /var/unbound/unbound.conf so that all default chroot,
# pidfile and config file are in /var/unbound, ready for chroot jail set up.
#
# This is a build using libldns builtin version, the resulting binaries
# do not require libldns and this package does not have version dependencies.
# Could be smaller using a dependency on libldns (use --with-ldns=).
%configure --with-conf-file=%{_localstatedir}/%{name}/unbound.conf --disable-rpath
%build
#%{__make} %{?_smp_mflags}
make
%install
rm -rf %{buildroot}
%{__make} DESTDIR=%{buildroot} install
install -d 0700 %{buildroot}%{_localstatedir}/%{name}
install -d 0755 %{buildroot}%{_initrddir}
install -m 0755 contrib/unbound.init %{buildroot}%{_initrddir}/unbound
# add symbolic link from /etc/unbound.conf -> /var/unbound/unbound.conf
ln -s %{_localstatedir}/unbound/unbound.conf %{buildroot}%{_sysconfdir}/unbound.conf
# remove static library from install (fedora packaging guidelines)
rm -f %{buildroot}%{_libdir}/libunbound.a %{buildroot}%{_libdir}/libunbound.la
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root,-)
%doc doc/README doc/CREDITS doc/LICENSE doc/FEATURES
%attr(0755,root,root) %{_initrddir}/%{name}
%attr(0700,%{name},%{name}) %dir %{_localstatedir}/%{name}
%attr(0644,%{name},%{name}) %config(noreplace) %{_localstatedir}/%{name}/unbound.conf
%attr(0644,%{name},%{name}) %config(noreplace) %{_sysconfdir}/unbound.conf
%{_sbindir}/*
%{_mandir}/*/*
%{_includedir}/*
%{_libdir}/libunbound*
%pre
getent group unbound >/dev/null || groupadd -r unbound
getent passwd unbound >/dev/null || \
useradd -r -g unbound -d /var/unbound -s /sbin/nologin \
-c "unbound name daemon" unbound
exit 0
%post
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add %{name}
%preun
if [ $1 -eq 0 ]; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
# remove root jail
rm -f /var/unbound/dev/log /var/unbound/dev/random /var/unbound/etc/localtime /var/unbound/etc/resolv.conf >/dev/null 2>&1
rmdir /var/unbound/dev >/dev/null 2>&1 || :
rmdir /var/unbound/etc >/dev/null 2>&1 || :
rmdir /var/unbound >/dev/null 2>&1 || :
fi
%postun
if [ "$1" -ge "1" ]; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%changelog
* Thu May 22 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 1.0.0
- contrib changes from Patrick Vande Walle.
* Thu Apr 25 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.12
- Using parts from ports collection entry by Jaap Akkerhuis.
- Using Fedoraproject wiki guidelines.
* Wed Apr 23 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.11
- Initial version.
+322
View File
@@ -0,0 +1,322 @@
# initial python set up
%{?!with_python: %define with_python 0}
%if %{with_python}
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
Summary: Validating, recursive, and caching DNS(SEC) resolver
Name: unbound
Version: 1.3.1rc2
Release: 1%{?dist}
License: BSD
Url: http://www.nlnetlabs.nl/unbound/
Source: http://www.unbound.net/downloads/%{name}-%{version}.tar.gz
Source1: unbound.init
Source2: unbound.conf
Source3: unbound.munin
# See the unbound svn repository for further documentation on these
Patch0: unbound-1.2-glob.patch
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: flex, openssl-devel , ldns-devel >= 1.5.0,
BuildRequires: libevent-devel
%if %{with_python}
BuildRequires: python-devel
%endif
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts
Requires: ldns >= 1.5.0, dnssec-conf >= 1.19
Requires(pre): shadow-utils
%description
Unbound is a validating, recursive, and caching DNS(SEC) resolver.
The C implementation of Unbound is developed and maintained by NLnet
Labs. It is based on ideas and algorithms taken from a java prototype
developed by Verisign labs, Nominet, Kirei and ep.net.
Unbound is designed as a set of modular components, so that also
DNSSEC (secure DNS) validation and stub-resolvers (that do not run
as a server, but are linked into an application) are easily possible.
%package munin
Summary: Plugin for the munin / munin-node monitoring package
Group: System Environment/Daemons
Requires: munin-node
Requires: %{name} = %{version}-%{release}, bc
%description munin
Plugin for the munin / munin-node monitoring package
%package devel
Summary: Development package that includes the unbound header files
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}, openssl-devel, ldns-devel
%description devel
The devel package contains the unbound library and the include files
%package libs
Summary: Libraries used by the unbound server and client applications
Group: Applications/System
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires: openssl >= 0.9.8g-12
%description libs
Contains libraries used by the unbound server and client applications
%if %{with_python}
%package python
Summary: Python modules and extensions for unbound
Group: Applications/System
Requires: %{name}-libs = %{version}-%{release}
%description python
Python modules and extensions for unbound
%endif
%prep
%setup -q
%patch0 -p1
%build
%configure --with-ldns= --with-libevent --with-pthreads --with-ssl \
--disable-rpath --enable-debug --disable-static \
--with-conf-file=%{_sysconfdir}/%{name}/unbound.conf \
--with-pidfile=%{_localstatedir}/run/%{name}/%{name}.pid \
%if %{with_python}
--with-pythonmodule --with-pyunbound \
%endif
--enable-sha2
%{__make} CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" QUIET=no %{?_smp_mflags}
%install
rm -rf %{buildroot}
%{__make} DESTDIR=%{buildroot} install
install -d 0755 %{buildroot}%{_initrddir}
install -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/unbound
install -m 0755 %{SOURCE2} %{buildroot}%{_sysconfdir}/unbound
# Install munin plugin and its softlinks
install -d 0755 %{buildroot}%{_sysconfdir}/munin/plugin-conf.d
install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/munin/plugin-conf.d/unbound
install -d 0755 %{buildroot}%{_datadir}/munin/plugins/
install -m 0755 contrib/unbound_munin_ %{buildroot}%{_datadir}/munin/plugins/unbound
for plugin in unbound_munin_hits unbound_munin_queue unbound_munin_memory unbound_munin_by_type unbound_munin_by_class unbound_munin_by_opcode unbound_munin_by_rcode unbound_munin_by_flags unbound_munin_histogram; do
ln -s unbound %{buildroot}%{_datadir}/munin/plugins/$plugin
done
# remove static library from install (fedora packaging guidelines)
rm -rf %{buildroot}%{_libdir}/*.la
mkdir -p %{buildroot}%{_localstatedir}/run/unbound
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root,-)
%doc doc/README doc/CREDITS doc/LICENSE doc/FEATURES
%attr(0755,root,root) %{_initrddir}/%{name}
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}
%attr(0755,unbound,unbound) %dir %{_localstatedir}/run/%{name}
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/unbound.conf
%{_sbindir}/*
%{_mandir}/*/*
%if %{with_python}
%files python
%{python_sitelib}/*
%endif
%files munin
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/unbound
%{_datadir}/munin/plugins/unbound*
%files devel
%defattr(-,root,root,-)
%{_libdir}/libunbound.so
%{_includedir}/unbound.h
%doc README
%files libs
%defattr(-,root,root,-)
%{_libdir}/libunbound.so.*
%doc doc/README doc/LICENSE
%pre
getent group unbound >/dev/null || groupadd -r unbound
getent passwd unbound >/dev/null || \
useradd -r -g unbound -d %{_sysconfdir}/unbound -s /sbin/nologin \
-c "Unbound DNS resolver" unbound
exit 0
%post
/sbin/chkconfig --add %{name}
# Check DNSSEC settings if this is a fresh install
if [ "$1" -eq 1 ]; then
if [ -r /etc/sysconfig/dnssec ]; then
. /etc/sysconfig/dnssec
[ -x /usr/sbin/dnssec-configure ] && \
dnssec-configure -u --norestart --nocheck --dnssec="$DNSSEC" --dlv="$DLV" > \
/dev/null 2>&1
fi;
fi
%post libs -p /sbin/ldconfig
%preun
if [ "$1" -eq 0 ]; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
%postun
if [ "$1" -ge "1" ]; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%postun libs -p /sbin/ldconfig
%changelog
* Sat Jun 20 2009 Paul Wouters <paul@xelerance.com> - 1.3.0-2
- Added missing glob patch to cvs
- Place python macros within the %%with_python check
* Sat Jun 20 2009 Paul Wouters <paul@xelerance.com> - 1.3.0-1
- Updated to 1.3.0
- Added unbound-python sub package. disabled for now
- Patch from svn to fix DLV lookups
- Patches from svn to detect wrong truncated response from BIND 9.6.1 with
minimal-responses)
- Added Default-Start and Default-Stop to unbound.init
- Re-enabled --enable-sha2
- Re-enabled glob.patch
* Wed May 20 2009 Paul Wouters <paul@xelerance.com> - 1.2.1-7
- unbound-iterator.patch was not commited
* Wed May 20 2009 Paul Wouters <paul@xelerance.com> - 1.2.1-6
- Fix for https://bugzilla.redhat.com/show_bug.cgi?id=499793
* Tue Mar 17 2009 Paul Wouters <paul@xelerance.com> - 1.2.1-5
- Use --nocheck to avoid giving an error on missing unbound-remote certs/keys
* Tue Mar 10 2009 Adam Tkac <atkac redhat com> - 1.2.1-4
- enable DNSSEC only if it is enabled in sysconfig/dnssec
* Mon Mar 09 2009 Adam Tkac <atkac redhat com> - 1.2.1-3
- add DNSSEC support to initscript and enabled it per default
- add requires dnssec-conf
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Tue Feb 10 2009 Paul Wouters <paul@xelerance.com - 1.2.1-1
- updated to 1.2.1
* Sun Jan 18 2009 Tomas Mraz <tmraz@redhat.com> - 1.2.0-2
- rebuild with new openssl
* Wed Jan 14 2009 Paul Wouters <paul@xelerance.com - 1.2.0-1
- Updated to 1.2.0
- Added dependancy on minimum SSL for CVE-2008-5077
- Added dependancy on bc for unbound-munin
- Added minimum requirement of libevent 1.4.5. Crashes with older versions
(note: libevent is stale in EL-4 and not in EL-5, needs fixing there)
- Removed dependancy on selinux-policy (will get used when available)
- Enable options as per draft-wijngaards-dnsext-resolver-side-mitigation-00.txt
- Enable unwanted-reply-threshold to mitigate against a Kaminsky attack
- Enable val-clean-additional to drop addition unsigned data from signed
response.
- Removed patches (got merged into upstream)
* Mon Jan 5 2009 Paul Wouters <paul@xelerance.com> - 1.1.1-7
- Modified scandir patch to silently fail when wildcard matches nothing
- Patch to allow unbound-checkconf to find empty wildcard matches
* Mon Jan 5 2009 Paul Wouters <paul@xelerance.com> - 1.1.1-6
- Added scandir patch for trusted-keys-file: option, which
is used to load multiple dnssec keys in bind file format
* Mon Dec 8 2008 Paul Wouters <paul@xelerance.com> - 1.1.1-4
- Added Requires: for selinux-policy >= 3.5.13-33 for proper SElinux rules.
* Mon Dec 1 2008 Paul Wouters <paul@xelerance.com> - 1.1.1-3
- We did not own the /etc/unbound directory (#474020)
- Fixed cvs anomalies
* Fri Nov 28 2008 Adam Tkac <atkac redhat com> - 1.1.1-2
- removed all obsolete chroot related stuff
- label control certs after generation correctly
* Thu Nov 20 2008 Paul Wouters <paul@xelerance.com> - 1.1.1-1
- Updated to unbound 1.1.1 which fixes a crasher and
addresses nlnetlabs bug #219
* Wed Nov 19 2008 Paul Wouters <paul@xelerance.com> - 1.1.0-3
- Remove the chroot, obsoleted by SElinux
- Add additional munin plugin links supported by unbound plugin
- Move configuration directory from /var/lib/unbound to /etc/unbound
- Modified unbound.init and unbound.conf to account for chroot changes
- Updated unbound.conf with new available options
- Enabled dns-0x20 protection per default
* Wed Nov 19 2008 Adam Tkac <atkac redhat com> - 1.1.0-2
- unbound-1.1.0-log_open.patch
- make sure log is opened before chroot call
- tracked as http://www.nlnetlabs.nl/bugs/show_bug.cgi?id=219
- removed /dev/log and /var/run/unbound and /etc/resolv.conf from
chroot, not needed
- don't mount files in chroot, it causes problems during updates
- fixed typo in default config file
* Fri Nov 14 2008 Paul Wouters <paul@xelerance.com> - 1.1.0-1
- Updated to version 1.1.0
- Updated unbound.conf's statistics options and remote-control
to work properly for munin
- Added unbound-munin package
- Generate unbound remote-control key/certs on first startup
- Required ldns is now 1.4.0
* Wed Oct 22 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-5
- Only call ldconfig in -libs package
- Move configure into build section
- devel subpackage should only depend on libs subpackage
* Tue Oct 21 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-4
- Fix CFLAGS getting lost in build
- Don't enable interface-automatic:yes because that
causes unbound to listen on 0.0.0.0 instead of 127.0.0.1
* Sun Oct 19 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-3
- Split off unbound-libs, make build verbose
* Thu Oct 9 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-2
- FSB compliance, chroot fixes, initscript fixes
* Thu Sep 11 2008 Paul Wouters <paul@xelerance.com> - 1.0.2-1
- Upgraded to 1.0.2
* Wed Jul 16 2008 Paul Wouters <paul@xelerance.com> - 1.0.1-1
- upgraded to new release
* Wed May 21 2008 Paul Wouters <paul@xelerance.com> - 1.0.0-2
- Build against ldns-1.3.0
* Wed May 21 2008 Paul Wouters <paul@xelerance.com> - 1.0.0-1
- Split of -devel package, fixed dependancies, make rpmlint happy
* Thu Apr 25 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.12
- Using parts from ports collection entry by Jaap Akkerhuis.
- Using Fedoraproject wiki guidelines.
* Wed Apr 23 2008 Wouter Wijngaards <wouter@nlnetlabs.nl> - 0.11
- Initial version.
Binary file not shown.
+552
View File
@@ -0,0 +1,552 @@
#!/bin/sh
#
# plugin for munin to monitor usage of unbound servers.
#
# (C) 2008 W.C.A. Wijngaards. BSD Licensed.
#
# To install; enable statistics and unbound-control in unbound.conf
# server: extended-statistics: yes
# statistics-cumulative: no
# statistics-interval: 0
# remote-control: control-enable: yes
# Run the command unbound-control-setup to generate the key files.
#
# Environment variables for this script
# statefile - where to put temporary statefile.
# unbound_conf - where the unbound.conf file is located.
# unbound_control - where to find unbound-control executable.
# spoof_warn - what level to warn about spoofing
# spoof_crit - what level to crit about spoofing
#
# You can set them in your munin/plugin-conf.d/plugins.conf file
# with:
# [unbound*]
# user root
# env.statefile /usr/local/var/munin/plugin-state/unbound-state
# env.unbound_conf /usr/local/etc/unbound/unbound.conf
# env.unbound_control /usr/local/sbin/unbound-control
# env.spoof_warn 1000
# env.spoof_crit 100000
#
# This plugin can create different graphs depending on what name
# you link it as (with ln -s) into the plugins directory
# You can link it multiple times.
# If you are only a casual user, the _hits and _by_type are most interesting,
# possibly followed by _by_rcode.
#
# unbound_munin_hits - base volume, cache hits, unwanted traffic
# unbound_munin_queue - to monitor the internal requestlist
# unbound_munin_memory - memory usage
# unbound_munin_by_type - incoming queries by type
# unbound_munin_by_class - incoming queries by class
# unbound_munin_by_opcode - incoming queries by opcode
# unbound_munin_by_rcode - answers by rcode, validation status
# unbound_munin_by_flags - incoming queries by flags
# unbound_munin_histogram - histogram of query resolving times
#
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=contrib
#%# capabilities=autoconf suggest
# POD documentation
: <<=cut
=head1 NAME
unbound_munin_ - Munin plugin to monitor the Unbound DNS resolver.
=head1 APPLICABLE SYSTEMS
System with unbound daemon.
=head1 CONFIGURATION
[unbound*]
user root
env.statefile /usr/local/var/munin/plugin-state/unbound-state
env.unbound_conf /usr/local/etc/unbound/unbound.conf
env.unbound_control /usr/local/sbin/unbound-control
env.spoof_warn 1000
env.spoof_crit 100000
Use the .env settings to override the defaults.
=head1 USAGE
Can be used to present different graphs. Use ln -s for that name in
the plugins directory to enable the graph.
unbound_munin_hits - base volume, cache hits, unwanted traffic
unbound_munin_queue - to monitor the internal requestlist
unbound_munin_memory - memory usage
unbound_munin_by_type - incoming queries by type
unbound_munin_by_class - incoming queries by class
unbound_munin_by_opcode - incoming queries by opcode
unbound_munin_by_rcode - answers by rcode, validation status
unbound_munin_by_flags - incoming queries by flags
unbound_munin_histogram - histogram of query resolving times
=head1 AUTHOR
Copyright 2008 W.C.A. Wijngaards
=head1 LICENSE
BSD
=cut
state=${statefile:-/usr/local/var/munin/plugin-state/unbound-state}
conf=${unbound_conf:-/usr/local/etc/unbound/unbound.conf}
ctrl=${unbound_control:-/usr/local/sbin/unbound-control}
warn=${spoof_warn:-1000}
crit=${spoof_crit:-100000}
lock=$state.lock
# number of seconds between polling attempts.
# makes the statefile hang around for at least this many seconds,
# so that multiple links of this script can share the results.
lee=55
# to keep things within 19 characters
ABBREV="-e s/total/t/ -e s/thread/t/ -e s/num/n/ -e s/query/q/ -e s/answer/a/ -e s/unwanted/u/ -e s/requestlist/ql/ -e s/type/t/ -e s/class/c/ -e s/opcode/o/ -e s/rcode/r/ -e s/edns/e/ -e s/mem/m/ -e s/cache/c/ -e s/mod/m/"
# get value from $1 into return variable $value
get_value ( ) {
value="`grep '^'$1'=' $state | sed -e 's/^.*=//'`"
if test "$value"x = ""x; then
value="0"
fi
}
# download the state from the unbound server.
get_state ( ) {
# obtain lock for fetching the state
# because there is a race condition in fetching and writing to file
# see if the lock is stale, if so, take it
if test -f $lock ; then
pid="`cat $lock 2>&1`"
kill -0 "$pid" >/dev/null 2>&1
if test $? -ne 0 -a "$pid" != $$ ; then
echo $$ >$lock
fi
fi
i=0
while test ! -f $lock || test "`cat $lock 2>&1`" != $$; do
while test -f $lock; do
# wait
i=`expr $i + 1`
if test $i -gt 1000; then
sleep 1;
fi
if test $i -gt 1500; then
echo "error locking $lock" "=" `cat $lock`
rm -f $lock
exit 1
fi
done
# try to get it
echo $$ >$lock
done
# do not refetch if the file exists and only LEE seconds old
if test -f $state; then
now=`date +%s`
get_value "time.now"
value="`echo $value | sed -e 's/\..*$//'`"
if test $now -lt `expr $value + $lee`; then
rm -f $lock
return
fi
fi
$ctrl -c $conf stats > $state
if test $? -ne 0; then
echo "error retrieving data from unbound server"
rm -f $lock
exit 1
fi
rm -f $lock
}
if test "$1" = "autoconf" ; then
if test ! -f $conf; then
echo no "($conf does not exist)"
exit 1
fi
if test ! -d `dirname $state`; then
echo no "($state directory does not exist)"
exit 1
fi
echo yes
exit 0
fi
if test "$1" = "suggest" ; then
echo "hits"
echo "queue"
echo "memory"
echo "by_type"
echo "by_class"
echo "by_opcode"
echo "by_rcode"
echo "by_flags"
echo "histogram"
exit 0
fi
# determine my type, by name
id=`echo $0 | sed -e 's/^.*unbound_munin_//'`
if test "$id"x = ""x; then
# some default to keep people sane.
id="hits"
fi
# if $1 exists in statefile, config is echoed with label $2
exist_config ( ) {
mn=`echo $1 | sed $ABBREV | tr . _`
if grep '^'$1'=' $state >/dev/null 2>&1; then
echo "$mn.label $2"
echo "$mn.min 0"
fi
}
# print label and min 0 for a name $1 in unbound format
p_config ( ) {
mn=`echo $1 | sed $ABBREV | tr . _`
echo $mn.label "$2"
echo $mn.min 0
}
if test "$1" = "config" ; then
if test ! -f $state; then
get_state
fi
case $id in
hits)
echo "graph_title Unbound DNS traffic and cache hits"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel queries / second"
echo "graph_category DNS"
for x in thread0.num.queries thread1.num.queries \
thread2.num.queries thread3.num.queries thread4.num.queries \
thread5.num.queries thread6.num.queries thread7.num.queries; do
exist_config $x "queries handled by `basename $x .num.queries`"
done
p_config "total.num.queries" "total queries from clients"
p_config "total.num.cachehits" "cache hits"
p_config "num.query.tcp" "TCP queries"
p_config "num.query.ipv6" "IPv6 queries"
p_config "unwanted.queries" "queries that failed acl"
p_config "unwanted.replies" "unwanted or unsolicited replies"
echo "u_replies.warning $warn"
echo "u_replies.critical $crit"
echo "graph_info DNS queries to the recursive resolver. The unwanted replies could be innocent duplicate packets, late replies, or spoof threats."
;;
queue)
echo "graph_title Unbound requestlist size"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel number of queries"
echo "graph_category DNS"
p_config "total.requestlist.avg" "Average size of queue on insert"
p_config "total.requestlist.max" "Max size of queue (in 5 min)"
p_config "total.requestlist.overwritten" "Number of queries replaced by new ones"
p_config "total.requestlist.exceeded" "Number of queries dropped due to lack of space"
echo "graph_info The queries that did not hit the cache and need recursion service take up space in the requestlist. If there are too many queries, first queries get overwritten, and at last resort dropped."
;;
memory)
echo "graph_title Unbound memory usage"
echo "graph_args --base 1024 -l 0"
echo "graph_vlabel memory used in bytes"
echo "graph_category DNS"
p_config "mem.total.sbrk" "Total memory"
p_config "mem.cache.rrset" "RRset cache memory"
p_config "mem.cache.message" "Message cache memory"
p_config "mem.mod.iterator" "Iterator module memory"
p_config "mem.mod.validator" "Validator module and key cache memory"
echo "graph_info The memory used by unbound."
;;
by_type)
echo "graph_title Unbound DNS queries by type"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel queries / second"
echo "graph_category DNS"
for x in `grep "^num.query.type" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.query.type.//`
p_config "$nm" "$tp"
done
echo "graph_info queries by DNS RR type queried for"
;;
by_class)
echo "graph_title Unbound DNS queries by class"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel queries / second"
echo "graph_category DNS"
for x in `grep "^num.query.class" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.query.class.//`
p_config "$nm" "$tp"
done
echo "graph_info queries by DNS RR class queried for."
;;
by_opcode)
echo "graph_title Unbound DNS queries by opcode"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel queries / second"
echo "graph_category DNS"
for x in `grep "^num.query.opcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.query.opcode.//`
p_config "$nm" "$tp"
done
echo "graph_info queries by opcode in the query packet."
;;
by_rcode)
echo "graph_title Unbound DNS answers by return code"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel answer packets / second"
echo "graph_category DNS"
for x in `grep "^num.answer.rcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
tp=`echo $nm | sed -e s/num.answer.rcode.//`
p_config "$nm" "$tp"
done
p_config "num.answer.secure" "answer secure"
p_config "num.answer.bogus" "answer bogus"
p_config "num.rrset.bogus" "num rrsets marked bogus"
echo "graph_info answers sorted by return value. rrsets bogus is the number of rrsets marked bogus per second by the validator"
;;
by_flags)
echo "graph_title Unbound DNS incoming queries by flags"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel queries / second"
echo "graph_category DNS"
p_config "num.query.flags.QR" "QR (query reply) flag"
p_config "num.query.flags.AA" "AA (auth answer) flag"
p_config "num.query.flags.TC" "TC (truncated) flag"
p_config "num.query.flags.RD" "RD (recursion desired) flag"
p_config "num.query.flags.RA" "RA (rec avail) flag"
p_config "num.query.flags.Z" "Z (zero) flag"
p_config "num.query.flags.AD" "AD (auth data) flag"
p_config "num.query.flags.CD" "CD (check disabled) flag"
p_config "num.query.edns.present" "EDNS OPT present"
p_config "num.query.edns.DO" "DO (DNSSEC OK) flag"
echo "graph_info This graphs plots the flags inside incoming queries. For example, if QR, AA, TC, RA, Z flags are set, the query can be rejected. RD, AD, CD and DO are legitimately set by some software."
;;
histogram)
echo "graph_title Unbound DNS histogram of reply time"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel queries / second"
echo "graph_category DNS"
echo hcache.label "cache hits"
echo hcache.min 0
echo hcache.draw AREA
echo hcache.colour 999999
echo h64ms.label "0 msec - 66 msec"
echo h64ms.min 0
echo h64ms.draw STACK
echo h64ms.colour 0000FF
echo h128ms.label "66 msec - 131 msec"
echo h128ms.min 0
echo h128ms.colour 1F00DF
echo h128ms.draw STACK
echo h256ms.label "131 msec - 262 msec"
echo h256ms.min 0
echo h256ms.draw STACK
echo h256ms.colour 3F00BF
echo h512ms.label "262 msec - 524 msec"
echo h512ms.min 0
echo h512ms.draw STACK
echo h512ms.colour 5F009F
echo h1s.label "524 msec - 1 sec"
echo h1s.min 0
echo h1s.draw STACK
echo h1s.colour 7F007F
echo h2s.label "1 sec - 2 sec"
echo h2s.min 0
echo h2s.draw STACK
echo h2s.colour 9F005F
echo h4s.label "2 sec - 4 sec"
echo h4s.min 0
echo h4s.draw STACK
echo h4s.colour BF003F
echo h8s.label "4 sec - 8 sec"
echo h8s.min 0
echo h8s.draw STACK
echo h8s.colour DF001F
echo h16s.label "8 sec - ..."
echo h16s.min 0
echo h16s.draw STACK
echo h16s.colour FF0000
echo "graph_info Histogram of the reply times for queries."
;;
esac
exit 0
fi
# do the stats itself
get_state
# get the time elapsed
get_value "time.elapsed"
if test $value = 0 || test $value = "0.000000"; then
echo "error: time elapsed 0 or could not retrieve data"
exit 1
fi
elapsed="$value"
# print value for $1 / elapsed
print_qps ( ) {
mn=`echo $1 | sed $ABBREV | tr . _`
get_value $1
echo "$mn.value" `echo scale=6';' $value / $elapsed | bc `
}
# print qps if line already found in $2
print_qps_line ( ) {
mn=`echo $1 | sed $ABBREV | tr . _`
value="`echo $2 | sed -e 's/^.*=//'`"
echo "$mn.value" `echo scale=6';' $value / $elapsed | bc `
}
# print value for $1
print_value ( ) {
mn=`echo $1 | sed $ABBREV | tr . _`
get_value $1
echo "$mn.value" $value
}
case $id in
hits)
for x in thread0.num.queries thread1.num.queries thread2.num.queries \
thread3.num.queries thread4.num.queries thread5.num.queries \
thread6.num.queries thread7.num.queries total.num.queries \
total.num.cachehits num.query.tcp num.query.ipv6 \
unwanted.queries unwanted.replies; do
if grep "^"$x"=" $state >/dev/null 2>&1; then
print_qps $x
fi
done
;;
queue)
for x in total.requestlist.avg total.requestlist.max \
total.requestlist.overwritten total.requestlist.exceeded; do
print_value $x
done
;;
memory)
mn=`echo mem.total.sbrk | sed $ABBREV | tr . _`
get_value 'mem.total.sbrk'
if test $value -eq 0; then
chk=`echo $ctrl | sed -e 's/-control$/-checkconf/'`
pidf=`$chk -o pidfile $conf 2>&1`
pid=`cat $pidf 2>&1`
value=`ps -p "$pid" -o rss= 2>&1`
if test "`expr $value + 1 - 1 2>&1`" -eq "$value" 2>&1; then
value=`expr $value \* 1024`
else
value=0
fi
fi
echo "$mn.value" $value
for x in mem.cache.rrset mem.cache.message \
mem.mod.iterator mem.mod.validator; do
print_value $x
done
;;
by_type)
for x in `grep "^num.query.type" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
print_qps_line $nm $x
done
;;
by_class)
for x in `grep "^num.query.class" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
print_qps_line $nm $x
done
;;
by_opcode)
for x in `grep "^num.query.opcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
print_qps_line $nm $x
done
;;
by_rcode)
for x in `grep "^num.answer.rcode" $state`; do
nm=`echo $x | sed -e 's/=.*$//'`
print_qps_line $nm $x
done
print_qps "num.answer.secure"
print_qps "num.answer.bogus"
print_qps "num.rrset.bogus"
;;
by_flags)
for x in num.query.flags.QR num.query.flags.AA num.query.flags.TC num.query.flags.RD num.query.flags.RA num.query.flags.Z num.query.flags.AD num.query.flags.CD num.query.edns.present num.query.edns.DO; do
print_qps $x
done
;;
histogram)
get_value total.num.cachehits
echo hcache.value `echo scale=6';' $value / $elapsed | bc `
r=0
for x in histogram.000000.000000.to.000000.000001 \
histogram.000000.000001.to.000000.000002 \
histogram.000000.000002.to.000000.000004 \
histogram.000000.000004.to.000000.000008 \
histogram.000000.000008.to.000000.000016 \
histogram.000000.000016.to.000000.000032 \
histogram.000000.000032.to.000000.000064 \
histogram.000000.000064.to.000000.000128 \
histogram.000000.000128.to.000000.000256 \
histogram.000000.000256.to.000000.000512 \
histogram.000000.000512.to.000000.001024 \
histogram.000000.001024.to.000000.002048 \
histogram.000000.002048.to.000000.004096 \
histogram.000000.004096.to.000000.008192 \
histogram.000000.008192.to.000000.016384 \
histogram.000000.016384.to.000000.032768 \
histogram.000000.032768.to.000000.065536; do
get_value $x
r=`expr $r + $value`
done
echo h64ms.value `echo scale=6';' $r / $elapsed | bc `
get_value histogram.000000.065536.to.000000.131072
echo h128ms.value `echo scale=6';' $value / $elapsed | bc `
get_value histogram.000000.131072.to.000000.262144
echo h256ms.value `echo scale=6';' $value / $elapsed | bc `
get_value histogram.000000.262144.to.000000.524288
echo h512ms.value `echo scale=6';' $value / $elapsed | bc `
get_value histogram.000000.524288.to.000001.000000
echo h1s.value `echo scale=6';' $value / $elapsed | bc `
get_value histogram.000001.000000.to.000002.000000
echo h2s.value `echo scale=6';' $value / $elapsed | bc `
get_value histogram.000002.000000.to.000004.000000
echo h4s.value `echo scale=6';' $value / $elapsed | bc `
get_value histogram.000004.000000.to.000008.000000
echo h8s.value `echo scale=6';' $value / $elapsed | bc `
r=0
for x in histogram.000008.000000.to.000016.000000 \
histogram.000016.000000.to.000032.000000 \
histogram.000032.000000.to.000064.000000 \
histogram.000064.000000.to.000128.000000 \
histogram.000128.000000.to.000256.000000 \
histogram.000256.000000.to.000512.000000 \
histogram.000512.000000.to.001024.000000 \
histogram.001024.000000.to.002048.000000 \
histogram.002048.000000.to.004096.000000 \
histogram.004096.000000.to.008192.000000 \
histogram.008192.000000.to.016384.000000 \
histogram.016384.000000.to.032768.000000 \
histogram.032768.000000.to.065536.000000 \
histogram.065536.000000.to.131072.000000 \
histogram.131072.000000.to.262144.000000 \
histogram.262144.000000.to.524288.000000; do
get_value $x
r=`expr $r + $value`
done
echo h16s.value `echo scale=6';' $r / $elapsed | bc `
;;
esac
+158
View File
@@ -0,0 +1,158 @@
#!/bin/sh
# update-anchor.sh, update a trust anchor.
# Copyright 2008, W.C.A. Wijngaards
# This file is BSD licensed, see doc/LICENSE.
# which validating lookup to use.
ubhost=unbound-host
usage ( )
{
echo "usage: update-anchor [-r hs] [-b] <zone name> <trust anchor file>"
echo " performs an update of trust anchor file"
echo " the trust anchor file is overwritten with the latest keys"
echo " the trust anchor file should contain only keys for one zone"
echo " -b causes keyfile to be made in bind format."
echo " without -b the file is made in unbound format."
echo " "
echo "alternate:"
echo " update-anchor [-r hints] [-b] -d directory"
echo " update all <zone>.anchor files in the directory."
echo " "
echo " name the files br.anchor se.anchor ..., and include them in"
echo " the validating resolver config file."
echo " put keys for the root in a file with the name root.anchor."
echo ""
echo "-r root.hints use different root hints. Strict option order."
echo ""
echo "Exit code 0 means anchors updated, 1 no changes, others are errors."
exit 2
}
if test $# -eq 0; then
usage
fi
bindformat="no"
filearg='-f'
roothints=""
if test X"$1" = "X-r"; then
shift
roothints="$1"
shift
fi
if test X"$1" = "X-b"; then
shift
bindformat="yes"
filearg='-F'
fi
if test $# -ne 2; then
echo "arguments wrong."
usage
fi
do_update ( ) {
# arguments: <zonename> <keyfile>
zonename="$1"
keyfile="$2"
tmpfile="/tmp/update-anchor.$$"
tmp2=$tmpfile.2
tmp3=$tmpfile.3
rh=""
if test -n "$roothints"; then
echo "server: root-hints: '$roothints'" > $tmp3
rh="-C $tmp3"
fi
$ubhost -v $rh $filearg "$keyfile" -t DNSKEY "$zonename" >$tmpfile
if test $? -ne 0; then
rm -f $tmpfile
echo "Error: Could not update zone $zonename anchor file $keyfile"
echo "Cause: $ubhost lookup failed"
echo " (Is the domain decommissioned? Is connectivity lost?)"
return 2
fi
# has the lookup been DNSSEC validated?
if grep '(secure)$' $tmpfile >/dev/null 2>&1; then
:
else
rm -f $tmpfile
echo "Error: Could not update zone $zonename anchor file $keyfile"
echo "Cause: result of lookup was not secure"
echo " (keys too far out of date? domain changed ownership? need root hints?)"
return 3
fi
if test $bindformat = "yes"; then
# are there any KSK keys on board?
echo 'trusted-keys {' > "$tmp2"
if grep ' has DNSKEY record 257' $tmpfile >/dev/null 2>&1; then
# store KSK keys in anchor file
grep '(secure)$' $tmpfile | \
grep ' has DNSKEY record 257' | \
sed -e 's/ (secure)$/";/' | \
sed -e 's/ has DNSKEY record \([0-9]*\) \([0-9]*\) \([0-9]*\) /. \1 \2 \3 "/' | \
sed -e 's/^\.\././' | sort >> "$tmp2"
else
# store all keys in the anchor file
grep '(secure)$' $tmpfile | \
sed -e 's/ (secure)$/";/' | \
sed -e 's/ has DNSKEY record \([0-9]*\) \([0-9]*\) \([0-9]*\) /. \1 \2 \3 "/' | \
sed -e 's/^\.\././' | sort >> "$tmp2"
fi
echo '};' >> "$tmp2"
else #not bindformat
# are there any KSK keys on board?
if grep ' has DNSKEY record 257' $tmpfile >/dev/null 2>&1; then
# store KSK keys in anchor file
grep '(secure)$' $tmpfile | \
grep ' has DNSKEY record 257' | \
sed -e 's/ (secure)$//' | \
sed -e 's/ has DNSKEY record /. IN DNSKEY /' | \
sed -e 's/^\.\././' | sort > "$tmp2"
else
# store all keys in the anchor file
grep '(secure)$' $tmpfile | \
sed -e 's/ (secure)$//' | \
sed -e 's/ has DNSKEY record /. IN DNSKEY /' | \
sed -e 's/^\.\././' | sort > "$tmp2"
fi
fi # endif-bindformat
# copy over if changed
diff $tmp2 $keyfile >/dev/null 2>&1
if test $? -eq 1; then # 0 means no change, 2 means trouble.
cat $tmp2 > $keyfile
no_updated=0
echo "$zonename key file $keyfile updated."
else
echo "$zonename key file $keyfile unchanged."
fi
rm -f $tmpfile $tmp2 $tmp3
}
no_updated=1
if test X"$1" = "X-d"; then
tdir="$2"
echo "start updating in $2"
for x in $tdir/*.anchor; do
if test `basename "$x"` = "root.anchor"; then
zname="."
else
zname=`basename "$x" .anchor`
fi
do_update "$zname" "$x"
done
echo "done updating in $2"
else
# regular invocation
if test X"$1" = "X."; then
zname="$1"
else
# strip trailing dot from zone name
zname="`echo $1 | sed -e 's/\.$//'`"
fi
kfile="$2"
do_update $zname $kfile
fi
exit $no_updated
+128
View File
@@ -0,0 +1,128 @@
#!/bin/sh
# update-itar.sh - update from the interim trust anchor repository
# Copyright 2009, W.C.A. Wijngaards
# This file is BSD licensed, see doc/LICENSE.
# --- Some settings
# directory where unbound works
thedir="."
# where is the file that unbound is going to read
ub_ta_file="$thedir/anchors.mf"
# where is the itar master file format
itar_url="ftp://iana.org/itar/anchors.mf"
# where is the itar PGP signature
itar_sig="ftp://iana.org/itar/anchors.mf.sig"
# which command to fetch urls, cmd $dest $url. "wget -O" "curl -o"
fetch_cmd="wget -O"
# file with pgp public key
pgp_pub_key_file="$thedir/update-itar.key"
# our pgp keyring (goes into .gnupg directory)
pgp_keyring_file="update-itar.ring"
# pgp command to use
pgp_cmd="gpg"
# --- The script is below
usage ( )
{
echo "usage: update-itar"
echo " Updates the trust anchors from the interim trust"
echo " anchor repository, https://itar.iana.org, and checks PGP sig."
echo
echo " Updates $ub_ta_file with the latest keys."
echo " Read that file from the unbound config with"
echo " trust-anchor-file: "'"'"$ub_ta_file"'"'
echo
echo " Exit code 0 means anchors updated, 1 no changes, "
echo " others are errors. So, in a cronjob you can do:"
echo " cd /usr/local/etc/unbound # your unbound work dir"
echo " ./update-itar.sh && unbound-control reload"
exit 2
}
if test $# -ne 0; then
usage
fi
tmpf="/tmp/update-itar.$$"
# one argument: explanation string
error_exit ( )
{
if test -f $tmpf.log; then cat $tmpf.log; fi
rm -f $tmpf $tmpf.sig $tmpf.log
echo "Error updating trust anchors: $1"
exit 2
}
if test ! -f $pgp_pub_key_file || test ! -f $HOME/.gnupg/$pgp_keyring_file || \
test "$pgp_pub_key_file" -nt $HOME/.gnupg/$pgp_keyring_file; then
# default key contents right here
if test ! -f $pgp_pub_key_file; then
echo "creating default IANA ITAR pgp key file"
cat >$pgp_pub_key_file <<EOF
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5
mQGiBElr2DcRBAC+6YK6eSP7rzstvnMPQXMrpvVfuIR5FeTpGuwae9JP78V/iOXr
N0yW8Dn6kdAztCMuRizL1Ij9IgaD7pjn8h09VgR4cN4LDv75rcQeWLzNxKy4UNRF
aStL77RcIoTblBeCgHAK9FLzd0XfTGZCNaLNy9BYVSLyADOVDIqgBcrvBwCglz03
QhOMIgaSx/XuRh6kYtynZ6kD/2GXx6pFs57b7rww8yOpdurCSOMB1wuEXiIXznTI
06ARiib0G5VDvOdpy0LDU2526Q9f/WAERlhcExTgnTFigG4mRksUiDrrai4GIr+6
JaivcGFVYdZZ4mZ088jcwujS/UY3C0ryGR9ufYUDAnfx6frhSl6o6j5is+jeGndF
JYRAA/9B/1OXNVwFSiIxnP2aPUwsT1li1vaW8dhA/5PcuPLOVvEjPc1Pc16HGLhE
8CRmMn66LqB1ccInE5hLKGGvV3pctjan+IOhaq3OHt/a+buDtTPgykchMZ2k1AzT
RYk+gksxpIl6yTZsBH4hoRt8auxEJW8AiYbNtXXkNuWcoQL40bQsSUFOQSBUcnVz
dCBBbmNob3IgUmVwb3NpdG9yeSA8aXRhckBpYW5hLm9yZz6IYAQTEQIAIAUCSWvY
NwIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEPR9+zCB1GT0GUAAn29/TacF
Teh87dls8pmkjxS4pKf1AKCJS/MvzR54AblO4DNMyc9q0G4frrkCDQRJa9g3EAgA
ywoLxF4HVb9o926UIXw8JxNIzDPkt8galAcKRUmHQMNa/QA80WMl9Ia6DIxavGlV
I5O1fvms297RV2KSSBjKWn6G+0me80A7aw0eHNg7habM5VtzDz5DhJbQFdJV9aYV
DoTSnY6uR6iSSRrdZNaYdlCwDS8lBCnOKoGMArHzVCa2EdCBeCUY/eObOXtu8Gm3
nDkuWeLPv08/0lvtr6d6VoDUEVPEsJAPONEYtpz/D+EZddUraF+3JscWqfRApBOz
/8WHaeTNdzIH+h1ntktiizA6eH40EM6coQQxtIRsxg1DPTxofdovreMkcMI0EUUP
awDn8gDtgG3g6Ud5zCdknwAEDQf/W3rxrEN6OZxJvWti8Iu6KOgxtuINiAsimPPX
qy9KHowyEE9EMPzgADjWC9Reyusr4CwcootjWw7ryUwU0fXvVULKhg32NzLsx/Ci
WtgCPSR58WZ1KKhnoB05+PTrwzhU+u64Cd/vJtFqGxSrANl2FAkPswHJMr8dMwAz
uni7zzLJ+homW1T5AaixwmN3jeDHWshJH9E9JIhr5Y/8AzMl1V10r2u1c2ej0lBJ
Y4GegI5cYAEBerS9d+mrbPlvbJ8AfuAuEf0y/PWJh0z1+Kck5qIbXMn/rpMBYvLJ
Uj5CfqWlh8+hxqSYJDXtLm8hBiQFiMEew0jOc2Tw4F91OZ+jyYhJBBgRAgAJBQJJ
a9g3AhsMAAoJEPR9+zCB1GT0AUwAn2ZtBwAyVxppdeTqilXufUvAkvjbAJ9dUpR1
9a17/5BvDDJcIxSEKTJmDw==
=zCNZ
-----END PGP PUBLIC KEY BLOCK-----
EOF
fi
# import the new key
$pgp_cmd --no-default-keyring --keyring $pgp_keyring_file \
--primary-keyring $pgp_keyring_file \
--import $pgp_pub_key_file >$tmpf.log 2>&1 \
|| error_exit "could not import pgp public key into keyring"
fi
$fetch_cmd $tmpf $itar_url >$tmpf.log 2>&1 \
|| error_exit "fetching $itar_url failed"
tail -2 $tmpf | grep "; End of file" >/dev/null 2>&1 || \
error_exit "The file fetched from $itar_url was partial"
$fetch_cmd $tmpf.sig $itar_sig >$tmpf.log 2>&1 \
|| error_exit "fetching $itar_sig failed"
# check the file with pgp
$pgp_cmd --no-default-keyring --keyring $pgp_keyring_file \
--verify $tmpf.sig $tmpf >$tmpf.log 2>&1 \
|| error_exit "the PGP signature failed!"
# check for differences
val=1
if diff "$ub_ta_file" $tmpf 2>/dev/null ; then
# echo "The interim trust anchor repository did not change."
:
else
echo "Updating $ub_ta_file"
cp $tmpf $ub_ta_file
val=0
fi
rm -f $tmpf $tmpf.sig $tmpf.log
exit $val
+176
View File
@@ -0,0 +1,176 @@
/*
* daemon/acl_list.h - client access control storage for the server.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file helps the server keep out queries from outside sources, that
* should not be answered.
*/
#include "config.h"
#include "daemon/acl_list.h"
#include "util/regional.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/net_help.h"
struct acl_list*
acl_list_create()
{
struct acl_list* acl = (struct acl_list*)calloc(1,
sizeof(struct acl_list));
if(!acl)
return NULL;
acl->region = regional_create();
if(!acl->region) {
acl_list_delete(acl);
return NULL;
}
return acl;
}
void
acl_list_delete(struct acl_list* acl)
{
if(!acl)
return;
regional_destroy(acl->region);
free(acl);
}
/** insert new address into acl_list structure */
static int
acl_list_insert(struct acl_list* acl, struct sockaddr_storage* addr,
socklen_t addrlen, int net, enum acl_access control,
int complain_duplicates)
{
struct acl_addr* node = regional_alloc(acl->region,
sizeof(struct acl_addr));
if(!node)
return 0;
node->control = control;
if(!addr_tree_insert(&acl->tree, &node->node, addr, addrlen, net)) {
if(complain_duplicates)
verbose(VERB_QUERY, "duplicate acl address ignored.");
}
return 1;
}
/** apply acl_list string */
static int
acl_list_str_cfg(struct acl_list* acl, const char* str, const char* s2,
int complain_duplicates)
{
struct sockaddr_storage addr;
int net;
socklen_t addrlen;
enum acl_access control;
if(strcmp(s2, "allow") == 0)
control = acl_allow;
else if(strcmp(s2, "deny") == 0)
control = acl_deny;
else if(strcmp(s2, "refuse") == 0)
control = acl_refuse;
else if(strcmp(s2, "allow_snoop") == 0)
control = acl_allow_snoop;
else {
log_err("access control type %s unknown", str);
return 0;
}
if(!netblockstrtoaddr(str, UNBOUND_DNS_PORT, &addr, &addrlen, &net)) {
log_err("cannot parse access control: %s %s", str, s2);
return 0;
}
if(!acl_list_insert(acl, &addr, addrlen, net, control,
complain_duplicates)) {
log_err("out of memory");
return 0;
}
return 1;
}
/** read acl_list config */
static int
read_acl_list(struct acl_list* acl, struct config_file* cfg)
{
struct config_str2list* p;
for(p = cfg->acls; p; p = p->next) {
log_assert(p->str && p->str2);
if(!acl_list_str_cfg(acl, p->str, p->str2, 1))
return 0;
}
return 1;
}
int
acl_list_apply_cfg(struct acl_list* acl, struct config_file* cfg)
{
regional_free_all(acl->region);
addr_tree_init(&acl->tree);
if(!read_acl_list(acl, cfg))
return 0;
/* insert defaults, with '0' to ignore them if they are duplicates */
if(!acl_list_str_cfg(acl, "0.0.0.0/0", "refuse", 0))
return 0;
if(!acl_list_str_cfg(acl, "127.0.0.0/8", "allow", 0))
return 0;
if(cfg->do_ip6) {
if(!acl_list_str_cfg(acl, "::0/0", "refuse", 0))
return 0;
if(!acl_list_str_cfg(acl, "::1", "allow", 0))
return 0;
if(!acl_list_str_cfg(acl, "::ffff:127.0.0.1", "allow", 0))
return 0;
}
addr_tree_init_parents(&acl->tree);
return 1;
}
enum acl_access
acl_list_lookup(struct acl_list* acl, struct sockaddr_storage* addr,
socklen_t addrlen)
{
struct acl_addr* r = (struct acl_addr*)addr_tree_lookup(&acl->tree,
addr, addrlen);
if(r) return r->control;
return acl_deny;
}
size_t
acl_list_get_mem(struct acl_list* acl)
{
if(!acl) return 0;
return sizeof(*acl) + regional_get_mem(acl->region);
}
+125
View File
@@ -0,0 +1,125 @@
/*
* daemon/acl_list.h - client access control storage for the server.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file keeps track of the list of clients that are allowed to
* access the server.
*/
#ifndef DAEMON_ACL_LIST_H
#define DAEMON_ACL_LIST_H
#include "util/storage/dnstree.h"
struct config_file;
struct regional;
/**
* Enumeration of access control options for an address range.
* Allow or deny access.
*/
enum acl_access {
/** disallow any access whatsoever, drop it */
acl_deny = 0,
/** disallow access, send a polite 'REFUSED' reply */
acl_refuse,
/** allow full access for recursion (+RD) queries */
acl_allow,
/** allow full access for all queries, recursion and cache snooping */
acl_allow_snoop
};
/**
* Access control storage structure
*/
struct acl_list {
/** regional for allocation */
struct regional* region;
/**
* Tree of the addresses that are allowed/blocked.
* contents of type acl_addr.
*/
rbtree_t tree;
};
/**
*
* An address span with access control information
*/
struct acl_addr {
/** node in address tree */
struct addr_tree_node node;
/** access control on this netblock */
enum acl_access control;
};
/**
* Create acl structure
* @return new structure or NULL on error.
*/
struct acl_list* acl_list_create();
/**
* Delete acl structure.
* @param acl: to delete.
*/
void acl_list_delete(struct acl_list* acl);
/**
* Process access control config.
* @param acl: where to store.
* @param cfg: config options.
* @return 0 on error.
*/
int acl_list_apply_cfg(struct acl_list* acl, struct config_file* cfg);
/**
* Lookup address to see its access control status.
* @param acl: structure for address storage.
* @param addr: address to check
* @param addrlen: length of addr.
* @return: what to do with message from this address.
*/
enum acl_access acl_list_lookup(struct acl_list* acl,
struct sockaddr_storage* addr, socklen_t addrlen);
/**
* Get memory used by acl structure.
* @param acl: structure for address storage.
* @return bytes in use.
*/
size_t acl_list_get_mem(struct acl_list* acl);
#endif /* DAEMON_ACL_LIST_H */
+957
View File
@@ -0,0 +1,957 @@
/*
* daemon/cachedump.c - dump the cache to text format.
*
* Copyright (c) 2008, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to read and write the cache(s)
* to text format.
*/
#include "config.h"
#include "daemon/cachedump.h"
#include "daemon/remote.h"
#include "daemon/worker.h"
#include "daemon/daemon.h"
#include "services/cache/rrset.h"
#include "services/cache/dns.h"
#include "services/cache/infra.h"
#include "services/modstack.h"
#include "util/data/msgreply.h"
#include "util/regional.h"
#include "util/net_help.h"
#include "util/data/dname.h"
#include "iterator/iterator.h"
#include "iterator/iter_delegpt.h"
#include "iterator/iter_utils.h"
#include "iterator/iter_fwd.h"
#include "iterator/iter_hints.h"
/** convert to ldns rr */
static ldns_rr*
to_rr(struct ub_packed_rrset_key* k, struct packed_rrset_data* d,
uint32_t now, size_t i, uint16_t type)
{
ldns_rr* rr = ldns_rr_new();
ldns_rdf* rdf;
ldns_status status;
size_t pos;
log_assert(i < d->count + d->rrsig_count);
if(!rr) {
return NULL;
}
ldns_rr_set_type(rr, type);
ldns_rr_set_class(rr, ntohs(k->rk.rrset_class));
if(d->rr_ttl[i] < now)
ldns_rr_set_ttl(rr, 0);
else ldns_rr_set_ttl(rr, d->rr_ttl[i] - now);
pos = 0;
status = ldns_wire2dname(&rdf, k->rk.dname, k->rk.dname_len, &pos);
if(status != LDNS_STATUS_OK) {
/* we drop detailed error in status */
ldns_rr_free(rr);
return NULL;
}
ldns_rr_set_owner(rr, rdf);
pos = 0;
status = ldns_wire2rdf(rr, d->rr_data[i], d->rr_len[i], &pos);
if(status != LDNS_STATUS_OK) {
/* we drop detailed error in status */
ldns_rr_free(rr);
return NULL;
}
return rr;
}
/** dump one rrset zonefile line */
static int
dump_rrset_line(SSL* ssl, struct ub_packed_rrset_key* k,
struct packed_rrset_data* d, uint32_t now, size_t i, uint16_t type)
{
char* s;
ldns_rr* rr = to_rr(k, d, now, i, type);
if(!rr) {
return ssl_printf(ssl, "BADRR\n");
}
s = ldns_rr2str(rr);
ldns_rr_free(rr);
if(!s) {
return ssl_printf(ssl, "BADRR\n");
}
if(!ssl_printf(ssl, "%s", s)) {
free(s);
return 0;
}
free(s);
return 1;
}
/** dump rrset key and data info */
static int
dump_rrset(SSL* ssl, struct ub_packed_rrset_key* k,
struct packed_rrset_data* d, uint32_t now)
{
size_t i;
/* rd lock held by caller */
if(!k || !d) return 1;
if(d->ttl < now) return 1; /* expired */
/* meta line */
if(!ssl_printf(ssl, ";rrset%s %u %u %u %d %d\n",
(k->rk.flags & PACKED_RRSET_NSEC_AT_APEX)?" nsec_apex":"",
(unsigned)(d->ttl - now),
(unsigned)d->count, (unsigned)d->rrsig_count,
(int)d->trust, (int)d->security
))
return 0;
for(i=0; i<d->count; i++) {
if(!dump_rrset_line(ssl, k, d, now, i, ntohs(k->rk.type)))
return 0;
}
for(i=0; i<d->rrsig_count; i++) {
if(!dump_rrset_line(ssl, k, d, now, i+d->count,
LDNS_RR_TYPE_RRSIG))
return 0;
}
return 1;
}
/** dump lruhash rrset cache */
static int
dump_rrset_lruhash(SSL* ssl, struct lruhash* h, uint32_t now)
{
struct lruhash_entry* e;
/* lruhash already locked by caller */
/* walk in order of lru; best first */
for(e=h->lru_start; e; e = e->lru_next) {
lock_rw_rdlock(&e->lock);
if(!dump_rrset(ssl, (struct ub_packed_rrset_key*)e->key,
(struct packed_rrset_data*)e->data, now)) {
lock_rw_unlock(&e->lock);
return 0;
}
lock_rw_unlock(&e->lock);
}
return 1;
}
/** dump rrset cache */
static int
dump_rrset_cache(SSL* ssl, struct worker* worker)
{
struct rrset_cache* r = worker->env.rrset_cache;
size_t slab;
if(!ssl_printf(ssl, "START_RRSET_CACHE\n")) return 0;
for(slab=0; slab<r->table.size; slab++) {
lock_quick_lock(&r->table.array[slab]->lock);
if(!dump_rrset_lruhash(ssl, r->table.array[slab],
*worker->env.now)) {
lock_quick_unlock(&r->table.array[slab]->lock);
return 0;
}
lock_quick_unlock(&r->table.array[slab]->lock);
}
return ssl_printf(ssl, "END_RRSET_CACHE\n");
}
/** dump message to rrset reference */
static int
dump_msg_ref(SSL* ssl, struct ub_packed_rrset_key* k)
{
ldns_rdf* rdf;
ldns_status status;
size_t pos;
char* nm, *tp, *cl;
pos = 0;
status = ldns_wire2dname(&rdf, k->rk.dname, k->rk.dname_len, &pos);
if(status != LDNS_STATUS_OK) {
return ssl_printf(ssl, "BADREF\n");
}
nm = ldns_rdf2str(rdf);
ldns_rdf_deep_free(rdf);
tp = ldns_rr_type2str(ntohs(k->rk.type));
cl = ldns_rr_class2str(ntohs(k->rk.rrset_class));
if(!nm || !cl || !tp) {
free(nm);
free(tp);
free(cl);
return ssl_printf(ssl, "BADREF\n");
}
if(!ssl_printf(ssl, "%s %s %s %d\n", nm, cl, tp, (int)k->rk.flags)) {
free(nm);
free(tp);
free(cl);
return 0;
}
free(nm);
free(tp);
free(cl);
return 1;
}
/** dump message entry */
static int
dump_msg(SSL* ssl, struct query_info* k, struct reply_info* d,
uint32_t now)
{
size_t i;
char* nm, *tp, *cl;
ldns_rdf* rdf;
ldns_status status;
size_t pos;
if(!k || !d) return 1;
if(d->ttl < now) return 1; /* expired */
pos = 0;
status = ldns_wire2dname(&rdf, k->qname, k->qname_len, &pos);
if(status != LDNS_STATUS_OK) {
return 1; /* skip this entry */
}
nm = ldns_rdf2str(rdf);
ldns_rdf_deep_free(rdf);
tp = ldns_rr_type2str(k->qtype);
cl = ldns_rr_class2str(k->qclass);
if(!nm || !tp || !cl) {
free(nm);
free(tp);
free(cl);
return 1; /* skip this entry */
}
if(!rrset_array_lock(d->ref, d->rrset_count, now)) {
/* rrsets have timed out or do not exist */
free(nm);
free(tp);
free(cl);
return 1; /* skip this entry */
}
/* meta line */
if(!ssl_printf(ssl, "msg %s %s %s %d %d %u %d %u %u %u\n",
nm, cl, tp,
(int)d->flags, (int)d->qdcount,
(unsigned)(d->ttl-now), (int)d->security,
(unsigned)d->an_numrrsets,
(unsigned)d->ns_numrrsets,
(unsigned)d->ar_numrrsets)) {
free(nm);
free(tp);
free(cl);
rrset_array_unlock(d->ref, d->rrset_count);
return 0;
}
free(nm);
free(tp);
free(cl);
for(i=0; i<d->rrset_count; i++) {
if(!dump_msg_ref(ssl, d->rrsets[i])) {
rrset_array_unlock(d->ref, d->rrset_count);
return 0;
}
}
rrset_array_unlock(d->ref, d->rrset_count);
return 1;
}
/** copy msg to worker pad */
static int
copy_msg(struct regional* region, struct lruhash_entry* e,
struct query_info** k, struct reply_info** d)
{
struct reply_info* rep = (struct reply_info*)e->data;
*d = (struct reply_info*)regional_alloc_init(region, e->data,
sizeof(struct reply_info) +
sizeof(struct rrset_ref) * (rep->rrset_count-1) +
sizeof(struct ub_packed_rrset_key*) * rep->rrset_count);
if(!*d)
return 0;
(*d)->rrsets = (struct ub_packed_rrset_key**)(
(uint8_t*)(&((*d)->ref[0])) +
sizeof(struct rrset_ref) * rep->rrset_count);
*k = (struct query_info*)regional_alloc_init(region,
e->key, sizeof(struct query_info));
if(!*k)
return 0;
(*k)->qname = regional_alloc_init(region,
(*k)->qname, (*k)->qname_len);
return (*k)->qname != NULL;
}
/** dump lruhash msg cache */
static int
dump_msg_lruhash(SSL* ssl, struct worker* worker, struct lruhash* h)
{
struct lruhash_entry* e;
struct query_info* k;
struct reply_info* d;
/* lruhash already locked by caller */
/* walk in order of lru; best first */
for(e=h->lru_start; e; e = e->lru_next) {
regional_free_all(worker->scratchpad);
lock_rw_rdlock(&e->lock);
/* make copy of rrset in worker buffer */
if(!copy_msg(worker->scratchpad, e, &k, &d)) {
lock_rw_unlock(&e->lock);
return 0;
}
lock_rw_unlock(&e->lock);
/* release lock so we can lookup the rrset references
* in the rrset cache */
if(!dump_msg(ssl, k, d, *worker->env.now)) {
return 0;
}
}
return 1;
}
/** dump msg cache */
static int
dump_msg_cache(SSL* ssl, struct worker* worker)
{
struct slabhash* sh = worker->env.msg_cache;
size_t slab;
if(!ssl_printf(ssl, "START_MSG_CACHE\n")) return 0;
for(slab=0; slab<sh->size; slab++) {
lock_quick_lock(&sh->array[slab]->lock);
if(!dump_msg_lruhash(ssl, worker, sh->array[slab])) {
lock_quick_unlock(&sh->array[slab]->lock);
return 0;
}
lock_quick_unlock(&sh->array[slab]->lock);
}
return ssl_printf(ssl, "END_MSG_CACHE\n");
}
int
dump_cache(SSL* ssl, struct worker* worker)
{
if(!dump_rrset_cache(ssl, worker))
return 0;
if(!dump_msg_cache(ssl, worker))
return 0;
return ssl_printf(ssl, "EOF\n");
}
/** read a line from ssl into buffer */
static int
ssl_read_buf(SSL* ssl, ldns_buffer* buf)
{
return ssl_read_line(ssl, (char*)ldns_buffer_begin(buf),
ldns_buffer_capacity(buf));
}
/** check fixed text on line */
static int
read_fixed(SSL* ssl, ldns_buffer* buf, const char* str)
{
if(!ssl_read_buf(ssl, buf)) return 0;
return (strcmp((char*)ldns_buffer_begin(buf), str) == 0);
}
/** load an RR into rrset */
static int
load_rr(SSL* ssl, ldns_buffer* buf, struct regional* region,
struct ub_packed_rrset_key* rk, struct packed_rrset_data* d,
unsigned int i, int is_rrsig, int* go_on, uint32_t now)
{
ldns_rr* rr;
ldns_status status;
/* read the line */
if(!ssl_read_buf(ssl, buf))
return 0;
if(strncmp((char*)ldns_buffer_begin(buf), "BADRR\n", 6) == 0) {
*go_on = 0;
return 1;
}
status = ldns_rr_new_frm_str(&rr, (char*)ldns_buffer_begin(buf),
LDNS_DEFAULT_TTL, NULL, NULL);
if(status != LDNS_STATUS_OK) {
log_warn("error cannot parse rr :%s: %s",
ldns_get_errorstr_by_id(status),
(char*)ldns_buffer_begin(buf));
return 0;
}
if(is_rrsig && ldns_rr_get_type(rr) != LDNS_RR_TYPE_RRSIG) {
log_warn("error expected rrsig but got %s",
(char*)ldns_buffer_begin(buf));
return 0;
}
/* convert ldns rr into packed_rr */
d->rr_ttl[i] = ldns_rr_ttl(rr) + now;
ldns_buffer_clear(buf);
ldns_buffer_skip(buf, 2);
status = ldns_rr_rdata2buffer_wire(buf, rr);
if(status != LDNS_STATUS_OK) {
log_warn("error cannot rr2wire :%s",
ldns_get_errorstr_by_id(status));
ldns_rr_free(rr);
return 0;
}
ldns_buffer_flip(buf);
ldns_buffer_write_u16_at(buf, 0, ldns_buffer_limit(buf) - 2);
d->rr_len[i] = ldns_buffer_limit(buf);
d->rr_data[i] = (uint8_t*)regional_alloc_init(region,
ldns_buffer_begin(buf), ldns_buffer_limit(buf));
if(!d->rr_data[i]) {
ldns_rr_free(rr);
log_warn("error out of memory");
return 0;
}
/* if first entry, fill the key structure */
if(i==0) {
rk->rk.type = htons(ldns_rr_get_type(rr));
rk->rk.rrset_class = htons(ldns_rr_get_class(rr));
ldns_buffer_clear(buf);
status = ldns_dname2buffer_wire(buf, ldns_rr_owner(rr));
ldns_buffer_flip(buf);
rk->rk.dname_len = ldns_buffer_limit(buf);
rk->rk.dname = regional_alloc_init(region,
ldns_buffer_begin(buf), ldns_buffer_limit(buf));
if(!rk->rk.dname) {
log_warn("error out of memory");
ldns_rr_free(rr);
return 0;
}
}
ldns_rr_free(rr);
return 1;
}
/** move entry into cache */
static int
move_into_cache(struct ub_packed_rrset_key* k,
struct packed_rrset_data* d, struct worker* worker)
{
struct ub_packed_rrset_key* ak;
struct packed_rrset_data* ad;
size_t s, i, num = d->count + d->rrsig_count;
struct rrset_ref ref;
uint8_t* p;
ak = alloc_special_obtain(&worker->alloc);
if(!ak) {
log_warn("error out of memory");
return 0;
}
ak->entry.data = NULL;
ak->rk = k->rk;
ak->entry.hash = rrset_key_hash(&k->rk);
ak->rk.dname = (uint8_t*)memdup(k->rk.dname, k->rk.dname_len);
if(!ak->rk.dname) {
log_warn("error out of memory");
ub_packed_rrset_parsedelete(ak, &worker->alloc);
return 0;
}
s = sizeof(*ad) + (sizeof(size_t) + sizeof(uint8_t*) +
sizeof(uint32_t))* num;
for(i=0; i<num; i++)
s += d->rr_len[i];
ad = (struct packed_rrset_data*)malloc(s);
if(!ad) {
log_warn("error out of memory");
ub_packed_rrset_parsedelete(ak, &worker->alloc);
return 0;
}
p = (uint8_t*)ad;
memmove(p, d, sizeof(*ad));
p += sizeof(*ad);
memmove(p, &d->rr_len[0], sizeof(size_t)*num);
p += sizeof(size_t)*num;
memmove(p, &d->rr_data[0], sizeof(uint8_t*)*num);
p += sizeof(uint8_t*)*num;
memmove(p, &d->rr_ttl[0], sizeof(uint32_t)*num);
p += sizeof(uint32_t)*num;
for(i=0; i<num; i++) {
memmove(p, d->rr_data[i], d->rr_len[i]);
p += d->rr_len[i];
}
packed_rrset_ptr_fixup(ad);
ak->entry.data = ad;
ref.key = ak;
ref.id = ak->id;
(void)rrset_cache_update(worker->env.rrset_cache, &ref,
&worker->alloc, *worker->env.now);
return 1;
}
/** load an rrset entry */
static int
load_rrset(SSL* ssl, ldns_buffer* buf, struct worker* worker)
{
char* s = (char*)ldns_buffer_begin(buf);
struct regional* region = worker->scratchpad;
struct ub_packed_rrset_key* rk;
struct packed_rrset_data* d;
unsigned int ttl, rr_count, rrsig_count, trust, security;
unsigned int i;
int go_on = 1;
regional_free_all(region);
rk = (struct ub_packed_rrset_key*)regional_alloc_zero(region,
sizeof(*rk));
d = (struct packed_rrset_data*)regional_alloc_zero(region, sizeof(*d));
if(!rk || !d) {
log_warn("error out of memory");
return 0;
}
if(strncmp(s, ";rrset", 6) != 0) {
log_warn("error expected ';rrset' but got %s", s);
return 0;
}
s += 6;
if(strncmp(s, " nsec_apex", 10) == 0) {
s += 10;
rk->rk.flags |= PACKED_RRSET_NSEC_AT_APEX;
}
if(sscanf(s, " %u %u %u %u %u", &ttl, &rr_count, &rrsig_count,
&trust, &security) != 5) {
log_warn("error bad rrset spec %s", s);
return 0;
}
if(rr_count == 0 && rrsig_count == 0) {
log_warn("bad rrset without contents");
return 0;
}
d->count = (size_t)rr_count;
d->rrsig_count = (size_t)rrsig_count;
d->security = (enum sec_status)security;
d->trust = (enum rrset_trust)trust;
d->ttl = (uint32_t)ttl + *worker->env.now;
d->rr_len = regional_alloc_zero(region,
sizeof(size_t)*(d->count+d->rrsig_count));
d->rr_ttl = regional_alloc_zero(region,
sizeof(uint32_t)*(d->count+d->rrsig_count));
d->rr_data = regional_alloc_zero(region,
sizeof(uint8_t*)*(d->count+d->rrsig_count));
if(!d->rr_len || !d->rr_ttl || !d->rr_data) {
log_warn("error out of memory");
return 0;
}
/* read the rr's themselves */
for(i=0; i<rr_count; i++) {
if(!load_rr(ssl, buf, region, rk, d, i, 0,
&go_on, *worker->env.now)) {
log_warn("could not read rr %u", i);
return 0;
}
}
for(i=0; i<rrsig_count; i++) {
if(!load_rr(ssl, buf, region, rk, d, i+rr_count, 1,
&go_on, *worker->env.now)) {
log_warn("could not read rrsig %u", i);
return 0;
}
}
if(!go_on) {
/* skip this entry */
return 1;
}
return move_into_cache(rk, d, worker);
}
/** load rrset cache */
static int
load_rrset_cache(SSL* ssl, struct worker* worker)
{
ldns_buffer* buf = worker->env.scratch_buffer;
if(!read_fixed(ssl, buf, "START_RRSET_CACHE")) return 0;
while(ssl_read_buf(ssl, buf) &&
strcmp((char*)ldns_buffer_begin(buf), "END_RRSET_CACHE")!=0) {
if(!load_rrset(ssl, buf, worker))
return 0;
}
return 1;
}
/** read qinfo from next three words */
static char*
load_qinfo(char* str, struct query_info* qinfo, ldns_buffer* buf,
struct regional* region)
{
/* s is part of the buf */
char* s = str;
ldns_rr* rr;
ldns_status status;
/* skip three words */
s = strchr(str, ' ');
if(s) s = strchr(s+1, ' ');
if(s) s = strchr(s+1, ' ');
if(!s) {
log_warn("error line too short, %s", str);
return NULL;
}
s[0] = 0;
s++;
/* parse them */
status = ldns_rr_new_question_frm_str(&rr, str, NULL, NULL);
if(status != LDNS_STATUS_OK) {
log_warn("error cannot parse: %s %s",
ldns_get_errorstr_by_id(status), str);
return NULL;
}
qinfo->qtype = ldns_rr_get_type(rr);
qinfo->qclass = ldns_rr_get_class(rr);
ldns_buffer_clear(buf);
status = ldns_dname2buffer_wire(buf, ldns_rr_owner(rr));
ldns_rr_free(rr);
if(status != LDNS_STATUS_OK) {
log_warn("error cannot dname2wire: %s",
ldns_get_errorstr_by_id(status));
return NULL;
}
ldns_buffer_flip(buf);
qinfo->qname_len = ldns_buffer_limit(buf);
qinfo->qname = (uint8_t*)regional_alloc_init(region,
ldns_buffer_begin(buf), ldns_buffer_limit(buf));
if(!qinfo->qname) {
log_warn("error out of memory");
return NULL;
}
return s;
}
/** load a msg rrset reference */
static int
load_ref(SSL* ssl, ldns_buffer* buf, struct worker* worker,
struct regional *region, struct ub_packed_rrset_key** rrset,
int* go_on)
{
char* s = (char*)ldns_buffer_begin(buf);
struct query_info qinfo;
unsigned int flags;
struct ub_packed_rrset_key* k;
/* read line */
if(!ssl_read_buf(ssl, buf))
return 0;
if(strncmp(s, "BADREF", 6) == 0) {
*go_on = 0; /* its bad, skip it and skip message */
return 1;
}
s = load_qinfo(s, &qinfo, buf, region);
if(!s) {
return 0;
}
if(sscanf(s, " %u", &flags) != 1) {
log_warn("error cannot parse flags: %s", s);
return 0;
}
/* lookup in cache */
k = rrset_cache_lookup(worker->env.rrset_cache, qinfo.qname,
qinfo.qname_len, qinfo.qtype, qinfo.qclass,
(uint32_t)flags, *worker->env.now, 0);
if(!k) {
/* not found or expired */
*go_on = 0;
return 1;
}
/* store in result */
*rrset = packed_rrset_copy_region(k, region, *worker->env.now);
lock_rw_unlock(&k->entry.lock);
return (*rrset != NULL);
}
/** load a msg entry */
static int
load_msg(SSL* ssl, ldns_buffer* buf, struct worker* worker)
{
struct regional* region = worker->scratchpad;
struct query_info qinf;
struct reply_info rep;
char* s = (char*)ldns_buffer_begin(buf);
unsigned int flags, qdcount, ttl, security, an, ns, ar;
size_t i;
int go_on = 1;
regional_free_all(region);
if(strncmp(s, "msg ", 4) != 0) {
log_warn("error expected msg but got %s", s);
return 0;
}
s += 4;
s = load_qinfo(s, &qinf, buf, region);
if(!s) {
return 0;
}
/* read remainder of line */
if(sscanf(s, " %u %u %u %u %u %u %u", &flags, &qdcount, &ttl,
&security, &an, &ns, &ar) != 7) {
log_warn("error cannot parse numbers: %s", s);
return 0;
}
rep.flags = (uint16_t)flags;
rep.qdcount = (uint16_t)qdcount;
rep.ttl = (uint32_t)ttl;
rep.security = (enum sec_status)security;
rep.an_numrrsets = (size_t)an;
rep.ns_numrrsets = (size_t)ns;
rep.ar_numrrsets = (size_t)ar;
rep.rrset_count = (size_t)an+(size_t)ns+(size_t)ar;
rep.rrsets = (struct ub_packed_rrset_key**)regional_alloc_zero(
region, sizeof(struct ub_packed_rrset_key*)*rep.rrset_count);
/* fill repinfo with references */
for(i=0; i<rep.rrset_count; i++) {
if(!load_ref(ssl, buf, worker, region, &rep.rrsets[i],
&go_on)) {
return 0;
}
}
if(!go_on)
return 1; /* skip this one, not all references satisfied */
if(!dns_cache_store(&worker->env, &qinf, &rep, 0)) {
log_warn("error out of memory");
return 0;
}
return 1;
}
/** load msg cache */
static int
load_msg_cache(SSL* ssl, struct worker* worker)
{
ldns_buffer* buf = worker->env.scratch_buffer;
if(!read_fixed(ssl, buf, "START_MSG_CACHE")) return 0;
while(ssl_read_buf(ssl, buf) &&
strcmp((char*)ldns_buffer_begin(buf), "END_MSG_CACHE")!=0) {
if(!load_msg(ssl, buf, worker))
return 0;
}
return 1;
}
int
load_cache(SSL* ssl, struct worker* worker)
{
if(!load_rrset_cache(ssl, worker))
return 0;
if(!load_msg_cache(ssl, worker))
return 0;
return read_fixed(ssl, worker->env.scratch_buffer, "EOF");
}
/** print details on a delegation point */
static void
print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp)
{
char buf[257];
struct delegpt_addr* a;
int lame, dlame, rlame, rtt, edns_vs, to, lost;
uint8_t edns_lame_known;
for(a = dp->target_list; a; a = a->next_target) {
addr_to_str(&a->addr, a->addrlen, buf, sizeof(buf));
if(!ssl_printf(ssl, "%-16s\t", buf))
return;
if(a->bogus) {
if(!ssl_printf(ssl, "Address is BOGUS. "))
return;
}
/* lookup in infra cache */
/* uses type_A because most often looked up, but other
* lameness won't be reported then */
if(!infra_get_lame_rtt(worker->env.infra_cache,
&a->addr, a->addrlen, dp->name, dp->namelen,
LDNS_RR_TYPE_A, &lame, &dlame, &rlame, &rtt, &lost,
*worker->env.now)) {
if(!ssl_printf(ssl, "not in infra cache.\n"))
return;
continue; /* skip stuff not in infra cache */
}
if(!ssl_printf(ssl, "%s%s%srtt %d msec, %d lost. ",
lame?"LAME ":"", dlame?"NoDNSSEC ":"",
rlame?"NoAuthButRecursive ":"", rtt, lost))
return;
if(infra_host(worker->env.infra_cache, &a->addr, a->addrlen,
*worker->env.now, &edns_vs, &edns_lame_known, &to)) {
if(edns_vs == -1) {
if(!ssl_printf(ssl, "noEDNS%s.",
edns_lame_known?" probed":""))
return;
} else {
if(!ssl_printf(ssl, "EDNS %d%s.",
edns_vs, edns_lame_known?" probed":""))
return;
}
}
if(!ssl_printf(ssl, "\n"))
return;
}
}
/** print main dp info */
static void
print_dp_main(SSL* ssl, struct delegpt* dp, struct dns_msg* msg)
{
size_t i, n_ns, n_miss, n_addr, n_res, n_avail;
/* print the dp */
if(msg)
for(i=0; i<msg->rep->rrset_count; i++) {
struct ub_packed_rrset_key* k = msg->rep->rrsets[i];
struct packed_rrset_data* d =
(struct packed_rrset_data*)k->entry.data;
if(d->security == sec_status_bogus) {
if(!ssl_printf(ssl, "Address is BOGUS:\n"))
return;
}
if(!dump_rrset(ssl, k, d, 0))
return;
}
delegpt_count_ns(dp, &n_ns, &n_miss);
delegpt_count_addr(dp, &n_addr, &n_res, &n_avail);
/* since dp has not been used by iterator, all are available*/
if(!ssl_printf(ssl, "Delegation with %d names, of which %d "
"can be examined to query further addresses.\n"
"%sIt provides %d IP addresses.\n",
(int)n_ns, (int)n_miss, (dp->bogus?"It is BOGUS. ":""),
(int)n_addr))
return;
}
int print_deleg_lookup(SSL* ssl, struct worker* worker, uint8_t* nm,
size_t nmlen, int ATTR_UNUSED(nmlabs))
{
/* deep links into the iterator module */
struct delegpt* dp;
struct dns_msg* msg;
struct regional* region = worker->scratchpad;
char b[260];
struct query_info qinfo;
struct iter_hints_stub* stub;
struct iter_env* ie;
regional_free_all(region);
qinfo.qname = nm;
qinfo.qname_len = nmlen;
qinfo.qtype = LDNS_RR_TYPE_A;
qinfo.qclass = LDNS_RR_CLASS_IN;
if(modstack_find(&worker->daemon->mods, "iterator") == -1) {
return ssl_printf(ssl, "error: no iterator module\n");
}
ie = (struct iter_env*)worker->env.modinfo[modstack_find(&worker->
daemon->mods, "iterator")];
dname_str(nm, b);
if(!ssl_printf(ssl, "The following name servers are used for lookup "
"of %s\n", b))
return 0;
dp = forwards_lookup(worker->env.fwds, nm, qinfo.qclass);
if(dp) {
if(!ssl_printf(ssl, "forwarding request:\n"))
return 0;
print_dp_main(ssl, dp, NULL);
print_dp_details(ssl, worker, dp);
return 1;
}
while(1) {
dp = dns_cache_find_delegation(&worker->env, nm, nmlen,
qinfo.qtype, qinfo.qclass, region, &msg,
*worker->env.now);
if(!dp) {
return ssl_printf(ssl, "no delegation from "
"cache; goes to configured roots\n");
}
/* go up? */
if(iter_dp_is_useless(&qinfo, BIT_RD, dp)) {
print_dp_main(ssl, dp, msg);
print_dp_details(ssl, worker, dp);
if(!ssl_printf(ssl, "cache delegation was "
"useless (no IP addresses)\n"))
return 0;
if(dname_is_root(nm)) {
/* goes to root config */
return ssl_printf(ssl, "no delegation from "
"cache; goes to configured roots\n");
} else {
/* useless, goes up */
nm = dp->name;
nmlen = dp->namelen;
dname_remove_label(&nm, &nmlen);
dname_str(nm, b);
if(!ssl_printf(ssl, "going up, lookup %s\n", b))
return 0;
continue;
}
}
stub = hints_lookup_stub(ie->hints, nm, qinfo.qclass, dp);
if(stub) {
if(stub->noprime) {
if(!ssl_printf(ssl, "The noprime stub servers "
"are used:\n"))
return 0;
} else {
if(!ssl_printf(ssl, "The stub is primed "
"with servers:\n"))
return 0;
}
print_dp_main(ssl, stub->dp, NULL);
print_dp_details(ssl, worker, stub->dp);
} else {
print_dp_main(ssl, dp, msg);
print_dp_details(ssl, worker, dp);
}
break;
}
return 1;
}
+107
View File
@@ -0,0 +1,107 @@
/*
* daemon/cachedump.h - dump the cache to text format.
*
* Copyright (c) 2008, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to read and write the cache(s)
* to text format.
*
* The format of the file is as follows:
* [RRset cache]
* [Message cache]
* EOF -- fixed string "EOF" before end of the file.
*
* The RRset cache is:
* START_RRSET_CACHE
* [rrset]*
* END_RRSET_CACHE
*
* rrset is:
* ;rrset [nsec_apex] TTL rr_count rrsig_count trust security
* resource records, one per line, in zonefile format
* rrsig records, one per line, in zonefile format
* If the text conversion fails, BADRR is printed on the line.
*
* The Message cache is:
* START_MSG_CACHE
* [msg]*
* END_MSG_CACHE
*
* msg is:
* msg name class type flags qdcount ttl security an ns ar
* list of rrset references, one per line. If conversion fails, BADREF
* reference is:
* name class type flags
*
* Expired cache entries are not printed.
*/
#ifndef DAEMON_DUMPCACHE_H
#define DAEMON_DUMPCACHE_H
struct worker;
/**
* Dump cache(s) to text
* @param ssl: to print to
* @param worker: worker that is available (buffers, etc) and has
* ptrs to the caches.
* @return false on ssl print error.
*/
int dump_cache(SSL* ssl, struct worker* worker);
/**
* Load cache(s) from text
* @param ssl: to read from
* @param worker: worker that is available (buffers, etc) and has
* ptrs to the caches.
* @return false on ssl error.
*/
int load_cache(SSL* ssl, struct worker* worker);
/**
* Print the delegation used to lookup for this name.
* @param ssl: to read from
* @param worker: worker that is available (buffers, etc) and has
* ptrs to the caches.
* @param nm: name to lookup
* @param nmlen: length of name.
* @param nmlabs: labels in name.
* @return false on ssl error.
*/
int print_deleg_lookup(SSL* ssl, struct worker* worker, uint8_t* nm,
size_t nmlen, int nmlabs);
#endif /* DAEMON_DUMPCACHE_H */
+289 -48
View File
@@ -39,17 +39,23 @@
* The daemon consists of global settings and a number of workers.
*/
/** buffer size for network connections */
#define BUFSZ 65552
#include "config.h"
#include "daemon/daemon.h"
#include "daemon/worker.h"
#include "daemon/remote.h"
#include "daemon/acl_list.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/data/msgreply.h"
#include "util/storage/slabhash.h"
#include "services/listen_dnsport.h"
#include "services/cache/rrset.h"
#include "services/cache/infra.h"
#include "services/localzone.h"
#include "services/modstack.h"
#include "util/module.h"
#include "util/random.h"
#include "util/tube.h"
#include <signal.h>
/** How many quit requests happened. */
@@ -57,23 +63,48 @@ static int sig_record_quit = 0;
/** How many reload requests happened. */
static int sig_record_reload = 0;
#if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
/** cleaner ssl memory freeup */
static void* comp_meth = NULL;
#endif
#ifdef LEX_HAS_YYLEX_DESTROY
/** remove buffers for parsing and init */
void ub_c_lex_destroy(void);
#endif
/** used when no other sighandling happens, so we don't die
* when multiple signals in quick succession are sent to us. */
* when multiple signals in quick succession are sent to us.
* @param sig: signal number.
* @return signal handler return type (void or int).
*/
static RETSIGTYPE record_sigh(int sig)
{
#ifdef LIBEVENT_SIGNAL_PROBLEM
verbose(VERB_OPS, "quit on signal, no cleanup and statistics, "
"because installed libevent version is not threadsafe");
exit(0);
#endif
switch(sig)
{
case SIGTERM:
#ifdef SIGQUIT
case SIGQUIT:
#endif
#ifdef SIGBREAK
case SIGBREAK:
#endif
case SIGINT:
sig_record_quit++;
break;
#ifdef SIGHUP
case SIGHUP:
sig_record_reload++;
break;
#endif
#ifdef SIGPIPE
case SIGPIPE:
break;
#endif
default:
log_err("ignoring signal %d", sig);
}
@@ -87,9 +118,20 @@ static void
signal_handling_record()
{
if( signal(SIGTERM, record_sigh) == SIG_ERR ||
#ifdef SIGQUIT
signal(SIGQUIT, record_sigh) == SIG_ERR ||
signal(SIGINT, record_sigh) == SIG_ERR ||
signal(SIGHUP, record_sigh) == SIG_ERR)
#endif
#ifdef SIGBREAK
signal(SIGBREAK, record_sigh) == SIG_ERR ||
#endif
#ifdef SIGHUP
signal(SIGHUP, record_sigh) == SIG_ERR ||
#endif
#ifdef SIGPIPE
signal(SIGPIPE, SIG_IGN) == SIG_ERR ||
#endif
signal(SIGINT, record_sigh) == SIG_ERR
)
log_err("install sighandler: %s", strerror(errno));
}
@@ -100,10 +142,12 @@ signal_handling_record()
static void
signal_handling_playback(struct worker* wrk)
{
if(sig_record_quit)
worker_sighandler(SIGTERM, wrk);
#ifdef SIGHUP
if(sig_record_reload)
worker_sighandler(SIGHUP, wrk);
#endif
if(sig_record_quit)
worker_sighandler(SIGTERM, wrk);
sig_record_quit = 0;
sig_record_reload = 0;
}
@@ -113,20 +157,58 @@ daemon_init()
{
struct daemon* daemon = (struct daemon*)calloc(1,
sizeof(struct daemon));
#ifdef USE_WINSOCK
int r;
WSADATA wsa_data;
#endif
if(!daemon)
return NULL;
#ifdef USE_WINSOCK
r = WSAStartup(MAKEWORD(2,2), &wsa_data);
if(r != 0) {
fatal_exit("could not init winsock. WSAStartup: %s",
wsa_strerror(r));
}
#endif /* USE_WINSOCK */
signal_handling_record();
checklock_start();
ERR_load_crypto_strings();
ERR_load_SSL_strings();
#ifdef HAVE_OPENSSL_CONFIG
OPENSSL_config("unbound");
#endif
#ifdef USE_GOST
(void)ldns_key_EVP_load_gost_id();
#endif
OpenSSL_add_all_algorithms();
#if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
/* grab the COMP method ptr because openssl leaks it */
comp_meth = (void*)SSL_COMP_get_compression_methods();
#endif
(void)SSL_library_init();
#ifdef HAVE_TZSET
/* init timezone info while we are not chrooted yet */
tzset();
#endif
/* open /dev/random if needed */
ub_systemseed((unsigned)time(NULL)^(unsigned)getpid()^0xe67);
daemon->need_to_exit = 0;
daemon->msg_cache = slabhash_create(HASH_DEFAULT_SLABS,
HASH_DEFAULT_STARTARRAY, HASH_DEFAULT_MAXMEM,
msgreply_sizefunc, query_info_compare,
query_entry_delete, reply_info_delete, NULL);
if(!daemon->msg_cache) {
modstack_init(&daemon->mods);
if(!(daemon->env = (struct module_env*)calloc(1,
sizeof(*daemon->env)))) {
free(daemon);
return NULL;
}
alloc_init(&daemon->superalloc, NULL);
alloc_init(&daemon->superalloc, NULL, 0);
daemon->acl = acl_list_create();
if(!daemon->acl) {
free(daemon->env);
free(daemon);
return NULL;
}
if(gettimeofday(&daemon->time_boot, NULL) < 0)
log_err("gettimeofday: %s", strerror(errno));
daemon->time_last_stat = daemon->time_boot;
return daemon;
}
@@ -134,32 +216,111 @@ int
daemon_open_shared_ports(struct daemon* daemon)
{
log_assert(daemon);
if(daemon->cfg->port == daemon->listening_port)
return 1;
listening_ports_free(daemon->ports);
if(!(daemon->ports=listening_ports_open(daemon->cfg)))
return 0;
daemon->listening_port = daemon->cfg->port;
if(daemon->cfg->port != daemon->listening_port) {
listening_ports_free(daemon->ports);
if(!(daemon->ports=listening_ports_open(daemon->cfg)))
return 0;
daemon->listening_port = daemon->cfg->port;
}
if(!daemon->cfg->remote_control_enable && daemon->rc_port) {
listening_ports_free(daemon->rc_ports);
daemon->rc_ports = NULL;
daemon->rc_port = 0;
}
if(daemon->cfg->remote_control_enable &&
daemon->cfg->control_port != daemon->rc_port) {
listening_ports_free(daemon->rc_ports);
if(!(daemon->rc_ports=daemon_remote_open_ports(daemon->cfg)))
return 0;
daemon->rc_port = daemon->cfg->control_port;
}
return 1;
}
/**
* Setup modules. setup module stack.
* @param daemon: the daemon
*/
static void daemon_setup_modules(struct daemon* daemon)
{
daemon->env->cfg = daemon->cfg;
daemon->env->alloc = &daemon->superalloc;
daemon->env->worker = NULL;
daemon->env->need_to_validate = 0; /* set by module init below */
if(!modstack_setup(&daemon->mods, daemon->cfg->module_conf,
daemon->env)) {
fatal_exit("failed to setup modules");
}
}
/**
* Obtain allowed port numbers, concatenate the list, and shuffle them
* (ready to be handed out to threads).
* @param daemon: the daemon. Uses rand and cfg.
* @param shufport: the portlist output.
* @return number of ports available.
*/
int daemon_get_shufport(struct daemon* daemon, int* shufport)
{
int i, n, k, temp;
int avail = 0;
for(i=0; i<65536; i++) {
if(daemon->cfg->outgoing_avail_ports[i]) {
shufport[avail++] = daemon->cfg->
outgoing_avail_ports[i];
}
}
if(avail == 0)
fatal_exit("no ports are permitted for UDP, add "
"with outgoing-port-permit");
/* Knuth shuffle */
n = avail;
while(--n > 0) {
k = ub_random(daemon->rand) % (n+1); /* 0<= k<= n */
temp = shufport[k];
shufport[k] = shufport[n];
shufport[n] = temp;
}
return avail;
}
/**
* Allocate empty worker structures. With backptr and thread-number,
* from 0..numthread initialised. Used as user arguments to new threads.
* Creates the daemon random generator if it does not exist yet.
* The random generator stays existing between reloads with a unique state.
* @param daemon: the daemon with (new) config settings.
*/
static void
daemon_create_workers(struct daemon* daemon)
{
int i;
int i, numport;
int* shufport;
log_assert(daemon && daemon->cfg);
if(!daemon->rand) {
unsigned int seed = (unsigned int)time(NULL) ^
(unsigned int)getpid() ^ 0x438;
daemon->rand = ub_initstate(seed, NULL);
if(!daemon->rand)
fatal_exit("could not init random generator");
}
shufport = (int*)calloc(65536, sizeof(int));
if(!shufport)
fatal_exit("out of memory during daemon init");
numport = daemon_get_shufport(daemon, shufport);
verbose(VERB_ALGO, "total of %d outgoing ports available", numport);
daemon->num = daemon->cfg->num_threads;
daemon->workers = (struct worker**)calloc((size_t)daemon->num,
sizeof(struct worker*));
for(i=0; i<daemon->num; i++) {
if(!(daemon->workers[i] = worker_create(daemon, i)))
if(!(daemon->workers[i] = worker_create(daemon, i,
shufport+numport*i/daemon->num,
numport*(i+1)/daemon->num - numport*i/daemon->num)))
/* the above is not ports/numthr, due to rounding */
fatal_exit("could not create worker");
}
free(shufport);
}
/**
@@ -172,13 +333,13 @@ void close_other_pipes(struct daemon* daemon, int thr)
int i;
for(i=0; i<daemon->num; i++)
if(i!=thr) {
if(daemon->workers[i]->cmd_send_fd != -1) {
close(daemon->workers[i]->cmd_send_fd);
daemon->workers[i]->cmd_send_fd = -1;
}
if(daemon->workers[i]->cmd_recv_fd != -1) {
close(daemon->workers[i]->cmd_recv_fd);
daemon->workers[i]->cmd_recv_fd = -1;
if(i==0) {
/* only close read part, need to write stats */
tube_close_read(daemon->workers[i]->cmd);
} else {
/* complete close channel to others */
tube_delete(daemon->workers[i]->cmd);
daemon->workers[i]->cmd = NULL;
}
}
}
@@ -194,14 +355,12 @@ thread_start(void* arg)
struct worker* worker = (struct worker*)arg;
log_thread_set(&worker->thread_num);
ub_thread_blocksigs();
#if !defined(HAVE_PTHREAD) && !defined(HAVE_SOLARIS_THREADS)
#ifdef THREADS_DISABLED
/* close pipe ends used by main */
close(worker->cmd_send_fd);
worker->cmd_send_fd = -1;
tube_close_write(worker->cmd);
close_other_pipes(worker->daemon, worker->thread_num);
#endif
if(!worker_init(worker, worker->daemon->cfg, worker->daemon->ports,
BUFSZ, 0))
if(!worker_init(worker, worker->daemon->cfg, worker->daemon->ports, 0))
fatal_exit("Could not initialize thread");
worker_work(worker);
@@ -222,10 +381,9 @@ daemon_start_others(struct daemon* daemon)
for(i=1; i<daemon->num; i++) {
ub_thread_create(&daemon->workers[i]->thr_id,
thread_start, daemon->workers[i]);
#if !defined(HAVE_PTHREAD) && !defined(HAVE_SOLARIS_THREADS)
#ifdef THREADS_DISABLED
/* close pipe end of child */
close(daemon->workers[i]->cmd_recv_fd);
daemon->workers[i]->cmd_recv_fd = -1;
tube_close_read(daemon->workers[i]->cmd);
#endif /* no threads */
}
}
@@ -243,10 +401,9 @@ daemon_stop_others(struct daemon* daemon)
/* skip i=0, is this thread */
/* use i=0 buffer for sending cmds; because we are #0 */
for(i=1; i<daemon->num; i++) {
worker_send_cmd(daemon->workers[i],
daemon->workers[0]->front->udp_buff, worker_cmd_quit);
worker_send_cmd(daemon->workers[i], worker_cmd_quit);
}
/** wait for them to quit */
/* wait for them to quit */
for(i=1; i<daemon->num; i++) {
/* join it to make sure its dead */
verbose(VERB_ALGO, "join %d", i);
@@ -259,10 +416,26 @@ void
daemon_fork(struct daemon* daemon)
{
log_assert(daemon);
if(!acl_list_apply_cfg(daemon->acl, daemon->cfg))
fatal_exit("Could not setup access control list");
if(!(daemon->local_zones = local_zones_create()))
fatal_exit("Could not create local zones: out of memory");
if(!local_zones_apply_cfg(daemon->local_zones, daemon->cfg))
fatal_exit("Could not set up local zones");
/* setup modules */
daemon_setup_modules(daemon);
/* first create all the worker structures, so we can pass
* them to the newly created threads.
*/
daemon_create_workers(daemon);
#ifdef HAVE_EV_LOOP
/* in libev the first inited base gets signals */
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports, 1))
fatal_exit("Could not initialize main thread");
#endif
/* Now create the threads and init the workers.
* By the way, this is thread #0 (the main thread).
@@ -270,23 +443,24 @@ daemon_fork(struct daemon* daemon)
daemon_start_others(daemon);
/* Special handling for the main thread. This is the thread
* that handles signals.
* that handles signals and remote control.
*/
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports,
BUFSZ, 1))
#ifndef HAVE_EV_LOOP
/* libevent has the last inited base get signals (or any base) */
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports, 1))
fatal_exit("Could not initialize main thread");
#endif
signal_handling_playback(daemon->workers[0]);
/* Start resolver service on main thread. */
log_info("start of service (%s).", PACKAGE_STRING);
worker_work(daemon->workers[0]);
log_info("service stopped (%s).", PACKAGE_STRING);
/* we exited! a signal happened! Stop other threads */
daemon_stop_others(daemon);
if(daemon->workers[0]->need_to_restart)
daemon->need_to_exit = 0;
else daemon->need_to_exit = 1;
daemon->need_to_exit = daemon->workers[0]->need_to_exit;
}
void
@@ -298,6 +472,16 @@ daemon_cleanup(struct daemon* daemon)
don't die on multiple reload signals for example. */
signal_handling_record();
log_thread_set(NULL);
/* clean up caches because
* a) RRset IDs will be recycled after a reload, causing collisions
* b) validation config can change, thus rrset, msg, keycache clear
* The infra cache is kept, the timing and edns info is still valid */
slabhash_clear(&daemon->env->rrset_cache->table);
slabhash_clear(daemon->env->msg_cache);
local_zones_delete(daemon->local_zones);
daemon->local_zones = NULL;
/* key cache is cleared by module desetup during next daemon_init() */
daemon_remote_clear(daemon->rc);
for(i=0; i<daemon->num; i++)
worker_delete(daemon->workers[i]);
free(daemon->workers);
@@ -311,11 +495,68 @@ daemon_delete(struct daemon* daemon)
{
if(!daemon)
return;
modstack_desetup(&daemon->mods, daemon->env);
daemon_remote_delete(daemon->rc);
listening_ports_free(daemon->ports);
slabhash_delete(daemon->msg_cache);
listening_ports_free(daemon->rc_ports);
if(daemon->env) {
slabhash_delete(daemon->env->msg_cache);
rrset_cache_delete(daemon->env->rrset_cache);
infra_delete(daemon->env->infra_cache);
}
ub_randfree(daemon->rand);
alloc_clear(&daemon->superalloc);
free(daemon->cwd);
acl_list_delete(daemon->acl);
free(daemon->chroot);
free(daemon->pidfile);
free(daemon->env);
free(daemon);
#ifdef LEX_HAS_YYLEX_DESTROY
/* lex cleanup */
ub_c_lex_destroy();
#endif
/* libcrypto cleanup */
#if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
sk_SSL_COMP_free(comp_meth);
#endif
#ifdef HAVE_OPENSSL_CONFIG
EVP_cleanup();
ENGINE_cleanup();
CONF_modules_free();
#endif
CRYPTO_cleanup_all_ex_data(); /* safe, no more threads right now */
ERR_remove_state(0);
ERR_free_strings();
RAND_cleanup();
checklock_stop();
#ifdef USE_WINSOCK
if(WSACleanup() != 0) {
log_err("Could not WSACleanup: %s",
wsa_strerror(WSAGetLastError()));
}
#endif
}
void daemon_apply_cfg(struct daemon* daemon, struct config_file* cfg)
{
daemon->cfg = cfg;
config_apply(cfg);
if(!daemon->env->msg_cache ||
cfg->msg_cache_size != slabhash_get_size(daemon->env->msg_cache) ||
cfg->msg_cache_slabs != daemon->env->msg_cache->size) {
slabhash_delete(daemon->env->msg_cache);
daemon->env->msg_cache = slabhash_create(cfg->msg_cache_slabs,
HASH_DEFAULT_STARTARRAY, cfg->msg_cache_size,
msgreply_sizefunc, query_info_compare,
query_entry_delete, reply_info_delete, NULL);
if(!daemon->env->msg_cache) {
fatal_exit("malloc failure updating config settings");
}
}
if((daemon->env->rrset_cache = rrset_cache_adjust(
daemon->env->rrset_cache, cfg, &daemon->superalloc)) == 0)
fatal_exit("malloc failure updating config settings");
if((daemon->env->infra_cache = infra_adjust(daemon->env->infra_cache,
cfg))==0)
fatal_exit("malloc failure updating config settings");
}
+39 -4
View File
@@ -44,10 +44,20 @@
#include "util/locks.h"
#include "util/alloc.h"
#include "services/modstack.h"
#ifdef UB_ON_WINDOWS
# include "util/winsock_event.h"
#endif
struct config_file;
struct worker;
struct listen_port;
struct slabhash;
struct module_env;
struct rrset_cache;
struct acl_list;
struct local_zones;
struct ub_randstate;
struct daemon_remote;
/**
* Structure holding worker list.
@@ -56,24 +66,42 @@ struct slabhash;
struct daemon {
/** The config settings */
struct config_file* cfg;
/** current working directory */
char* cwd;
/** the chroot dir in use, NULL if none */
char* chroot;
/** pidfile that is used */
char* pidfile;
/** port number that has ports opened. */
int listening_port;
/** listening ports, opened, to be shared by threads */
struct listen_port* ports;
/** port number for remote that has ports opened. */
int rc_port;
/** listening ports for remote control */
struct listen_port* rc_ports;
/** remote control connections management (for first worker) */
struct daemon_remote* rc;
/** num threads allocated */
int num;
/** the worker entries */
struct worker** workers;
/** do we need to exit unbound (or is it only a reload?) */
int need_to_exit;
/** master random table ; used for port div between threads on reload*/
struct ub_randstate* rand;
/** master allocation cache */
struct alloc_cache superalloc;
/** the message cache, content is struct msgreply_entry* */
struct slabhash* msg_cache;
/** the module environment master value, copied and changed by threads*/
struct module_env* env;
/** stack of module callbacks */
struct module_stack mods;
/** access control, which client IPs are allowed to connect */
struct acl_list* acl;
/** local authority zones */
struct local_zones* local_zones;
/** last time of statistics printout */
struct timeval time_last_stat;
/** time when daemon started */
struct timeval time_boot;
};
/**
@@ -110,4 +138,11 @@ void daemon_cleanup(struct daemon* daemon);
*/
void daemon_delete(struct daemon* daemon);
/**
* Apply config settings.
* @param daemon: the daemon.
* @param cfg: new config settings.
*/
void daemon_apply_cfg(struct daemon* daemon, struct config_file* cfg);
#endif /* DAEMON_H */
+1676
View File
File diff suppressed because it is too large Load Diff
+174
View File
@@ -0,0 +1,174 @@
/*
* daemon/remote.h - remote control for the unbound daemon.
*
* Copyright (c) 2008, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains the remote control functionality for the daemon.
* The remote control can be performed using either the commandline
* unbound-control tool, or a SSLv3/TLS capable web browser.
* The channel is secured using SSLv3 or TLSv1, and certificates.
* Both the server and the client(control tool) have their own keys.
*/
#ifndef DAEMON_REMOTE_H
#define DAEMON_REMOTE_H
struct config_file;
struct listen_list;
struct listen_port;
struct worker;
struct comm_reply;
struct comm_point;
struct daemon_remote;
/** number of seconds timeout on incoming remote control handshake */
#define REMOTE_CONTROL_TCP_TIMEOUT 120
/**
* a busy control command connection, SSL state
*/
struct rc_state {
/** the next item in list */
struct rc_state* next;
/** the commpoint */
struct comm_point* c;
/** in the handshake part */
enum { rc_none, rc_hs_read, rc_hs_write } shake_state;
/** the ssl state */
SSL* ssl;
/** the rc this is part of */
struct daemon_remote* rc;
};
/**
* The remote control tool state.
* The state is only created for the first thread, other threads
* are called from this thread. Only the first threads listens to
* the control port. The other threads do not, but are called on the
* command channel(pipe) from the first thread.
*/
struct daemon_remote {
/** the worker for this remote control */
struct worker* worker;
/** commpoints for accepting remote control connections */
struct listen_list* accept_list;
/** number of active commpoints that are handling remote control */
int active;
/** max active commpoints */
int max_active;
/** current commpoints busy; should be a short list, malloced */
struct rc_state* busy_list;
/** the SSL context for creating new SSL streams */
SSL_CTX* ctx;
};
/**
* Create new remote control state for the daemon.
* @param cfg: config file with key file settings.
* @return new state, or NULL on failure.
*/
struct daemon_remote* daemon_remote_create(struct config_file* cfg);
/**
* remote control state to delete.
* @param rc: state to delete.
*/
void daemon_remote_delete(struct daemon_remote* rc);
/**
* remote control state to clear up. Busy and accept points are closed.
* Does not delete the rc itself, or the ssl context (with its keys).
* @param rc: state to clear.
*/
void daemon_remote_clear(struct daemon_remote* rc);
/**
* Open and create listening ports for remote control.
* @param cfg: config options.
* @return list of ports or NULL on failure.
* can be freed with listening_ports_free().
*/
struct listen_port* daemon_remote_open_ports(struct config_file* cfg);
/**
* Setup comm points for accepting remote control connections.
* @param rc: state
* @param ports: already opened ports.
* @param worker: worker with communication base. and links to command channels.
* @return false on error.
*/
int daemon_remote_open_accept(struct daemon_remote* rc,
struct listen_port* ports, struct worker* worker);
/**
* Handle nonthreaded remote cmd execution.
* @param worker: this worker (the remote worker).
*/
void daemon_remote_exec(struct worker* worker);
/** handle remote control accept callbacks */
int remote_accept_callback(struct comm_point*, void*, int, struct comm_reply*);
/** handle remote control data callbacks */
int remote_control_callback(struct comm_point*, void*, int, struct comm_reply*);
/**
* Print fixed line of text over ssl connection in blocking mode
* @param ssl: print to
* @param text: the text.
* @return false on connection failure.
*/
int ssl_print_text(SSL* ssl, const char* text);
/**
* printf style printing to the ssl connection
* @param ssl: the SSL connection to print to. Blocking.
* @param format: printf style format string.
* @return success or false on a network failure.
*/
int ssl_printf(SSL* ssl, const char* format, ...)
ATTR_FORMAT(printf, 2, 3);
/**
* Read until \n is encountered
* If SSL signals EOF, the string up to then is returned (without \n).
* @param ssl: the SSL connection to read from. blocking.
* @param buf: buffer to read to.
* @param max: size of buffer.
* @return false on connection failure.
*/
int ssl_read_line(SSL* ssl, char* buf, size_t max);
#endif /* DAEMON_REMOTE_H */
+288
View File
@@ -0,0 +1,288 @@
/*
* daemon/stats.c - collect runtime performance indicators.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file describes the data structure used to collect runtime performance
* numbers. These 'statistics' may be of interest to the operator.
*/
#include "config.h"
#include "daemon/stats.h"
#include "daemon/worker.h"
#include "daemon/daemon.h"
#include "services/mesh.h"
#include "services/outside_network.h"
#include "util/config_file.h"
#include "util/tube.h"
#include "util/timehist.h"
#include "util/net_help.h"
#include "validator/validator.h"
/** add timers and the values do not overflow or become negative */
static void
timeval_add(struct timeval* d, const struct timeval* add)
{
#ifndef S_SPLINT_S
d->tv_sec += add->tv_sec;
d->tv_usec += add->tv_usec;
if(d->tv_usec > 1000000) {
d->tv_usec -= 1000000;
d->tv_sec++;
}
#endif
}
void server_stats_init(struct server_stats* stats, struct config_file* cfg)
{
memset(stats, 0, sizeof(*stats));
stats->extended = cfg->stat_extended;
}
void server_stats_querymiss(struct server_stats* stats, struct worker* worker)
{
stats->num_queries_missed_cache++;
stats->sum_query_list_size += worker->env.mesh->all.count;
if(worker->env.mesh->all.count > stats->max_query_list_size)
stats->max_query_list_size = worker->env.mesh->all.count;
}
void server_stats_log(struct server_stats* stats, struct worker* worker,
int threadnum)
{
log_info("server stats for thread %d: %u queries, "
"%u answers from cache, %u recursions",
threadnum, (unsigned)stats->num_queries,
(unsigned)(stats->num_queries -
stats->num_queries_missed_cache),
(unsigned)stats->num_queries_missed_cache);
log_info("server stats for thread %d: requestlist max %u avg %g "
"exceeded %u", threadnum, (unsigned)stats->max_query_list_size,
stats->num_queries_missed_cache?
(double)stats->sum_query_list_size/
stats->num_queries_missed_cache : 0.0,
(unsigned)worker->env.mesh->stats_dropped);
}
/** get rrsets bogus number from validator */
static size_t
get_rrset_bogus(struct worker* worker)
{
int m = modstack_find(&worker->env.mesh->mods, "validator");
struct val_env* ve;
size_t r;
if(m == -1)
return 0;
ve = (struct val_env*)worker->env.modinfo[m];
lock_basic_lock(&ve->bogus_lock);
r = ve->num_rrset_bogus;
if(!worker->env.cfg->stat_cumulative)
ve->num_rrset_bogus = 0;
lock_basic_unlock(&ve->bogus_lock);
return r;
}
void
server_stats_compile(struct worker* worker, struct stats_info* s, int reset)
{
int i;
s->svr = worker->stats;
s->mesh_num_states = worker->env.mesh->all.count;
s->mesh_num_reply_states = worker->env.mesh->num_reply_states;
s->mesh_jostled = worker->env.mesh->stats_jostled;
s->mesh_dropped = worker->env.mesh->stats_dropped;
s->mesh_replies_sent = worker->env.mesh->replies_sent;
s->mesh_replies_sum_wait = worker->env.mesh->replies_sum_wait;
s->mesh_time_median = timehist_quartile(worker->env.mesh->histogram,
0.50);
/* add in the values from the mesh */
s->svr.ans_secure += worker->env.mesh->ans_secure;
s->svr.ans_bogus += worker->env.mesh->ans_bogus;
s->svr.ans_rcode_nodata += worker->env.mesh->ans_nodata;
for(i=0; i<16; i++)
s->svr.ans_rcode[i] += worker->env.mesh->ans_rcode[i];
timehist_export(worker->env.mesh->histogram, s->svr.hist,
NUM_BUCKETS_HIST);
/* values from outside network */
s->svr.unwanted_replies = worker->back->unwanted_replies;
/* get and reset validator rrset bogus number */
s->svr.rrset_bogus = get_rrset_bogus(worker);
if(reset && !worker->env.cfg->stat_cumulative) {
worker_stats_clear(worker);
}
}
void server_stats_obtain(struct worker* worker, struct worker* who,
struct stats_info* s, int reset)
{
uint8_t *reply = NULL;
uint32_t len = 0;
if(worker == who) {
/* just fill it in */
server_stats_compile(worker, s, reset);
return;
}
/* communicate over tube */
verbose(VERB_ALGO, "write stats cmd");
if(reset)
worker_send_cmd(who, worker_cmd_stats);
else worker_send_cmd(who, worker_cmd_stats_noreset);
verbose(VERB_ALGO, "wait for stats reply");
if(!tube_read_msg(worker->cmd, &reply, &len, 0))
fatal_exit("failed to read stats over cmd channel");
if(len != (uint32_t)sizeof(*s))
fatal_exit("stats on cmd channel wrong length %d %d",
(int)len, (int)sizeof(*s));
memcpy(s, reply, (size_t)len);
free(reply);
}
void server_stats_reply(struct worker* worker, int reset)
{
struct stats_info s;
server_stats_compile(worker, &s, reset);
verbose(VERB_ALGO, "write stats replymsg");
if(!tube_write_msg(worker->daemon->workers[0]->cmd,
(uint8_t*)&s, sizeof(s), 0))
fatal_exit("could not write stat values over cmd channel");
}
void server_stats_add(struct stats_info* total, struct stats_info* a)
{
total->svr.num_queries += a->svr.num_queries;
total->svr.num_queries_missed_cache += a->svr.num_queries_missed_cache;
total->svr.sum_query_list_size += a->svr.sum_query_list_size;
/* the max size reached is upped to higher of both */
if(a->svr.max_query_list_size > total->svr.max_query_list_size)
total->svr.max_query_list_size = a->svr.max_query_list_size;
if(a->svr.extended) {
int i;
total->svr.qtype_big += a->svr.qtype_big;
total->svr.qclass_big += a->svr.qclass_big;
total->svr.qtcp += a->svr.qtcp;
total->svr.qipv6 += a->svr.qipv6;
total->svr.qbit_QR += a->svr.qbit_QR;
total->svr.qbit_AA += a->svr.qbit_AA;
total->svr.qbit_TC += a->svr.qbit_TC;
total->svr.qbit_RD += a->svr.qbit_RD;
total->svr.qbit_RA += a->svr.qbit_RA;
total->svr.qbit_Z += a->svr.qbit_Z;
total->svr.qbit_AD += a->svr.qbit_AD;
total->svr.qbit_CD += a->svr.qbit_CD;
total->svr.qEDNS += a->svr.qEDNS;
total->svr.qEDNS_DO += a->svr.qEDNS_DO;
total->svr.ans_rcode_nodata += a->svr.ans_rcode_nodata;
total->svr.ans_secure += a->svr.ans_secure;
total->svr.ans_bogus += a->svr.ans_bogus;
total->svr.rrset_bogus += a->svr.rrset_bogus;
total->svr.unwanted_replies += a->svr.unwanted_replies;
total->svr.unwanted_queries += a->svr.unwanted_queries;
for(i=0; i<STATS_QTYPE_NUM; i++)
total->svr.qtype[i] += a->svr.qtype[i];
for(i=0; i<STATS_QCLASS_NUM; i++)
total->svr.qclass[i] += a->svr.qclass[i];
for(i=0; i<STATS_OPCODE_NUM; i++)
total->svr.qopcode[i] += a->svr.qopcode[i];
for(i=0; i<STATS_RCODE_NUM; i++)
total->svr.ans_rcode[i] += a->svr.ans_rcode[i];
for(i=0; i<NUM_BUCKETS_HIST; i++)
total->svr.hist[i] += a->svr.hist[i];
}
total->mesh_num_states += a->mesh_num_states;
total->mesh_num_reply_states += a->mesh_num_reply_states;
total->mesh_jostled += a->mesh_jostled;
total->mesh_dropped += a->mesh_dropped;
total->mesh_replies_sent += a->mesh_replies_sent;
timeval_add(&total->mesh_replies_sum_wait, &a->mesh_replies_sum_wait);
/* the medians are averaged together, this is not as accurate as
* taking the median over all of the data, but is good and fast
* added up here, division later*/
total->mesh_time_median += a->mesh_time_median;
}
void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
uint16_t qtype, uint16_t qclass, struct edns_data* edns,
struct comm_reply* repinfo)
{
uint16_t flags = ldns_buffer_read_u16_at(c->buffer, 2);
if(qtype < STATS_QTYPE_NUM)
stats->qtype[qtype]++;
else stats->qtype_big++;
if(qclass < STATS_QCLASS_NUM)
stats->qclass[qclass]++;
else stats->qclass_big++;
stats->qopcode[ LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) ]++;
if(c->type != comm_udp)
stats->qtcp++;
if(repinfo && addr_is_ip6(&repinfo->addr, repinfo->addrlen))
stats->qipv6++;
if( (flags&BIT_QR) )
stats->qbit_QR++;
if( (flags&BIT_AA) )
stats->qbit_AA++;
if( (flags&BIT_TC) )
stats->qbit_TC++;
if( (flags&BIT_RD) )
stats->qbit_RD++;
if( (flags&BIT_RA) )
stats->qbit_RA++;
if( (flags&BIT_Z) )
stats->qbit_Z++;
if( (flags&BIT_AD) )
stats->qbit_AD++;
if( (flags&BIT_CD) )
stats->qbit_CD++;
if(edns->edns_present) {
stats->qEDNS++;
if( (edns->bits & EDNS_DO) )
stats->qEDNS_DO++;
}
}
void server_stats_insrcode(struct server_stats* stats, ldns_buffer* buf)
{
if(stats->extended && ldns_buffer_limit(buf) != 0) {
int r = (int)LDNS_RCODE_WIRE( ldns_buffer_begin(buf) );
stats->ans_rcode[r] ++;
if(r == 0 && LDNS_ANCOUNT( ldns_buffer_begin(buf) ) == 0)
stats->ans_rcode_nodata ++;
}
}
+229
View File
@@ -0,0 +1,229 @@
/*
* daemon/stats.h - collect runtime performance indicators.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file describes the data structure used to collect runtime performance
* numbers. These 'statistics' may be of interest to the operator.
*/
#ifndef DAEMON_STATS_H
#define DAEMON_STATS_H
#include "util/timehist.h"
struct worker;
struct config_file;
struct comm_point;
struct comm_reply;
struct edns_data;
/** number of qtype that is stored for in array */
#define STATS_QTYPE_NUM 256
/** number of qclass that is stored for in array */
#define STATS_QCLASS_NUM 256
/** number of rcodes in stats */
#define STATS_RCODE_NUM 16
/** number of opcodes in stats */
#define STATS_OPCODE_NUM 16
/** per worker statistics */
struct server_stats {
/** number of queries from clients received. */
size_t num_queries;
/** number of queries that had a cache-miss. */
size_t num_queries_missed_cache;
/**
* Sum of the querylistsize of the worker for
* every query that missed cache. To calculate average.
*/
size_t sum_query_list_size;
/** max value of query list size reached. */
size_t max_query_list_size;
/** Extended stats below (bool) */
int extended;
/** qtype stats */
size_t qtype[STATS_QTYPE_NUM];
/** bigger qtype values not in array */
size_t qtype_big;
/** qclass stats */
size_t qclass[STATS_QCLASS_NUM];
/** bigger qclass values not in array */
size_t qclass_big;
/** query opcodes */
size_t qopcode[STATS_OPCODE_NUM];
/** number of queries over TCP */
size_t qtcp;
/** number of queries over IPv6 */
size_t qipv6;
/** number of queries with QR bit */
size_t qbit_QR;
/** number of queries with AA bit */
size_t qbit_AA;
/** number of queries with TC bit */
size_t qbit_TC;
/** number of queries with RD bit */
size_t qbit_RD;
/** number of queries with RA bit */
size_t qbit_RA;
/** number of queries with Z bit */
size_t qbit_Z;
/** number of queries with AD bit */
size_t qbit_AD;
/** number of queries with CD bit */
size_t qbit_CD;
/** number of queries with EDNS OPT record */
size_t qEDNS;
/** number of queries with EDNS with DO flag */
size_t qEDNS_DO;
/** answer rcodes */
size_t ans_rcode[STATS_RCODE_NUM];
/** answers with pseudo rcode 'nodata' */
size_t ans_rcode_nodata;
/** answers that were secure (AD) */
size_t ans_secure;
/** answers that were bogus (withheld as SERVFAIL) */
size_t ans_bogus;
/** rrsets marked bogus by validator */
size_t rrset_bogus;
/** unwanted traffic received on server-facing ports */
size_t unwanted_replies;
/** unwanted traffic received on client-facing ports */
size_t unwanted_queries;
/** histogram data exported to array
* if the array is the same size, no data is lost, and
* if all histograms are same size (is so by default) then
* adding up works well. */
size_t hist[NUM_BUCKETS_HIST];
};
/**
* Statistics to send over the control pipe when asked
* This struct is made to be memcpied, sent in binary.
*/
struct stats_info {
/** the thread stats */
struct server_stats svr;
/** mesh stats: current number of states */
size_t mesh_num_states;
/** mesh stats: current number of reply (user) states */
size_t mesh_num_reply_states;
/** mesh stats: number of reply states overwritten with a new one */
size_t mesh_jostled;
/** mesh stats: number of incoming queries dropped */
size_t mesh_dropped;
/** mesh stats: replies sent */
size_t mesh_replies_sent;
/** mesh stats: sum of waiting times for the replies */
struct timeval mesh_replies_sum_wait;
/** mesh stats: median of waiting times for replies (in sec) */
double mesh_time_median;
};
/**
* Initialize server stats to 0.
* @param stats: what to init (this is alloced by the caller).
* @param cfg: with extended statistics option.
*/
void server_stats_init(struct server_stats* stats, struct config_file* cfg);
/** add query if it missed the cache */
void server_stats_querymiss(struct server_stats* stats, struct worker* worker);
/** display the stats to the log */
void server_stats_log(struct server_stats* stats, struct worker* worker,
int threadnum);
/**
* Obtain the stats info for a given thread. Uses pipe to communicate.
* @param worker: the worker that is executing (the first worker).
* @param who: on who to get the statistics info.
* @param s: the stats block to fill in.
* @param reset: if stats can be reset.
*/
void server_stats_obtain(struct worker* worker, struct worker* who,
struct stats_info* s, int reset);
/**
* Compile stats into structure for this thread worker.
* Also clears the statistics counters (if that is set by config file).
* @param worker: the worker to compile stats for, also the executing worker.
* @param s: stats block.
* @param reset: if true, depending on config stats are reset.
* if false, statistics are not reset.
*/
void server_stats_compile(struct worker* worker, struct stats_info* s,
int reset);
/**
* Send stats over comm tube in reply to query cmd
* @param worker: this worker.
* @param reset: if true, depending on config stats are reset.
* if false, statistics are not reset.
*/
void server_stats_reply(struct worker* worker, int reset);
/**
* Addup stat blocks.
* @param total: sum of the two entries.
* @param a: to add to it.
*/
void server_stats_add(struct stats_info* total, struct stats_info* a);
/**
* Add stats for this query
* @param stats: the stats
* @param c: commpoint with type and buffer.
* @param qtype: query type
* @param qclass: query class
* @param edns: edns record
* @param repinfo: reply info with remote address
*/
void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
uint16_t qtype, uint16_t qclass, struct edns_data* edns,
struct comm_reply* repinfo);
/**
* Add rcode for this query.
* @param stats: the stats
* @param buf: buffer with rcode. If buffer is length0: not counted.
*/
void server_stats_insrcode(struct server_stats* stats, ldns_buffer* buf);
#endif /* DAEMON_STATS_H */
+395 -71
View File
@@ -43,59 +43,184 @@
#include "config.h"
#include "util/log.h"
#include "daemon/daemon.h"
#include "daemon/remote.h"
#include "util/config_file.h"
#include "util/storage/slabhash.h"
#include "services/listen_dnsport.h"
#include "services/cache/rrset.h"
#include "services/cache/infra.h"
#include "util/data/msgreply.h"
#include "util/module.h"
#include <signal.h>
#include <fcntl.h>
#include <openssl/crypto.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef HAVE_GRP_H
#include <grp.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#ifdef HAVE_LOGIN_CAP_H
#include <login_cap.h>
#endif
#ifdef USE_MINI_EVENT
# ifdef USE_WINSOCK
# include "util/winsock_event.h"
# else
# include "util/mini_event.h"
# endif
#else
# include <event.h>
#endif
#ifdef UB_ON_WINDOWS
# include "winrc/win_svc.h"
#endif
/** global debug value to keep track of heap memory allocation */
void* unbound_start_brk = 0;
/** print usage. */
static void usage()
{
printf("usage: unbound [options]\n");
const char** m;
printf("usage: unbound [options]\n");
printf(" start unbound daemon DNS resolver.\n");
printf("-h this help\n");
printf("-c file config file to read, unbound.conf(5).\n");
printf("-c file config file to read instead of %s\n", CONFIGFILE);
printf(" file format is described in unbound.conf(5).\n");
printf("-d do not fork into the background.\n");
printf("-v verbose (multiple times increase verbosity)\n");
printf("-v verbose (more times to increase verbosity)\n");
#ifdef UB_ON_WINDOWS
printf("-w opt windows option: \n");
printf(" install, remove - manage the services entry\n");
printf(" service - used to start from services control panel\n");
#endif
printf("Version %s\n", PACKAGE_VERSION);
printf("linked libs: event %s, ldns %s, %s\n",
#ifdef USE_WINSOCK
"winsock",
#elif defined(USE_MINI_EVENT)
"internal",
#else
event_get_version(),
#endif
ldns_version(),
SSLeay_version(SSLEAY_VERSION));
printf("linked modules:");
for(m = module_list_avail(); *m; m++)
printf(" %s", *m);
printf("\n");
printf("BSD licensed, see LICENSE in source package for details.\n");
printf("Report bugs to %s\n", PACKAGE_BUGREPORT);
}
/** to changedir, logfile */
static void
apply_dir(struct daemon* daemon, struct config_file* cfg, int cmdline_verbose)
#ifndef unbound_testbound
int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
{
/* apply if they have changed */
daemon->cfg = cfg;
verbosity = cmdline_verbose + cfg->verbosity;
if(cfg->directory && cfg->directory[0]) {
if(!daemon->cwd || strcmp(daemon->cwd, cfg->directory) != 0) {
if(chdir(cfg->directory)) {
log_err("Could not chdir to %s: %s",
cfg->directory, strerror(errno));
}
free(daemon->cwd);
if(!(daemon->cwd = strdup(cfg->directory)))
log_err("cwd: malloc failed");
}
log_assert(0);
return 0;
}
#endif
/** check file descriptor count */
static void
checkrlimits(struct config_file* cfg)
{
#ifdef HAVE_GETRLIMIT
/* list has number of ports to listen to, ifs number addresses */
int list = ((cfg->do_udp?1:0) + (cfg->do_tcp?1 +
(int)cfg->incoming_num_tcp:0));
size_t listen_ifs = (size_t)(cfg->num_ifs==0?
((cfg->do_ip4 && !cfg->if_automatic?1:0) +
(cfg->do_ip6?1:0)):cfg->num_ifs);
size_t listen_num = list*listen_ifs;
size_t outudpnum = (size_t)cfg->outgoing_num_ports;
size_t outtcpnum = cfg->outgoing_num_tcp;
size_t misc = 4; /* logfile, pidfile, stdout... */
size_t perthread_noudp = listen_num + outtcpnum +
2/*cmdpipe*/ + 2/*libevent*/ + misc;
size_t perthread = perthread_noudp + outudpnum;
#if !defined(HAVE_PTHREAD) && !defined(HAVE_SOLARIS_THREADS)
int numthread = 1; /* it forks */
#else
int numthread = cfg->num_threads;
#endif
size_t total = numthread * perthread + misc;
size_t avail;
struct rlimit rlim;
if(getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
log_warn("getrlimit: %s", strerror(errno));
return;
}
if(cfg->msg_cache_size != slabhash_get_size(daemon->msg_cache) ||
cfg->msg_cache_slabs != daemon->msg_cache->size) {
slabhash_delete(daemon->msg_cache);
daemon->msg_cache = slabhash_create(cfg->msg_cache_slabs,
HASH_DEFAULT_STARTARRAY, cfg->msg_cache_size,
msgreply_sizefunc, query_info_compare,
query_entry_delete, reply_info_delete, NULL);
if(!daemon->msg_cache) {
fatal_exit("malloc failure updating config settings");
if(rlim.rlim_cur == (rlim_t)RLIM_INFINITY)
return;
if((size_t)rlim.rlim_cur < total) {
avail = (size_t)rlim.rlim_cur;
rlim.rlim_cur = (rlim_t)(total + 10);
rlim.rlim_max = (rlim_t)(total + 10);
if(setrlimit(RLIMIT_NOFILE, &rlim) < 0) {
log_warn("setrlimit: %s", strerror(errno));
log_warn("cannot increase max open fds from %u to %u",
(unsigned)avail, (unsigned)total+10);
/* check that calculation below does not underflow,
* with 15 as margin */
if(numthread*perthread_noudp+15 > avail)
fatal_exit("too much tcp. not enough fds.");
cfg->outgoing_num_ports = (int)((avail
- numthread*perthread_noudp
- 10 /* safety margin */) /numthread);
log_warn("continuing with less udp ports: %u",
cfg->outgoing_num_ports);
log_warn("increase ulimit or decrease threads, ports in config to remove this warning");
return;
}
log_warn("increased limit(open files) from %u to %u",
(unsigned)avail, (unsigned)total+10);
}
if(total > 1024 &&
strncmp(event_get_version(), "mini-event", 10) == 0) {
log_err("too many file descriptors requested. The builtin"
"mini-event cannot handle more than 1024. Config "
"for less fds or compile with libevent");
fatal_exit("configuration needs too many file descriptors");
}
if(perthread > 64 &&
strncmp(event_get_version(), "winsock-event", 13) == 0) {
log_err("too many file descriptors requested. The winsock"
" event handler cannot handle more than 64 per "
" thread. Config for less fds or compile with "
" libevent");
fatal_exit("configuration needs too many file descriptors");
}
#else
(void)cfg;
#endif /* HAVE_GETRLIMIT */
}
/** Read existing pid from pidfile. */
/** set verbosity, check rlimits, cache settings */
static void
apply_settings(struct daemon* daemon, struct config_file* cfg,
int cmdline_verbose)
{
/* apply if they have changed */
verbosity = cmdline_verbose + cfg->verbosity;
daemon_apply_cfg(daemon, cfg);
checkrlimits(cfg);
}
#ifdef HAVE_KILL
/** Read existing pid from pidfile.
* @param file: file name of pid file.
* @return: the pid from the file or -1 if none.
*/
static pid_t
readpid (const char* file)
{
@@ -127,7 +252,8 @@ readpid (const char* file)
return -1;
}
pid = strtol(pidbuf, &t, 10);
pidbuf[sizeof(pidbuf)-1] = 0;
pid = (pid_t)strtol(pidbuf, &t, 10);
if (*t && *t != '\n') {
return -1;
@@ -135,7 +261,10 @@ readpid (const char* file)
return pid;
}
/** write pid to file. */
/** write pid to file.
* @param pidfile: file name of pid file.
* @param pid: pid to write to file.
*/
static void
writepid (const char* pidfile, pid_t pid)
{
@@ -155,41 +284,52 @@ writepid (const char* pidfile, pid_t pid)
/**
* check old pid file.
* @param cfg: the config settings
* @param pidfile: the file name of the pid file.
* @param inchroot: if pidfile is inchroot and we can thus expect to
* be able to delete it.
*/
static void
checkoldpid(struct config_file* cfg)
checkoldpid(char* pidfile, int inchroot)
{
pid_t old;
if((old = readpid(cfg->pidfile)) != -1) {
if((old = readpid(pidfile)) != -1) {
/* see if it is still alive */
if(kill(old, 0) == 0 || errno == EPERM)
log_warn("unbound is already running as pid %u.",
(unsigned)old);
else log_warn("did not exit gracefully last time (%u)",
else if(inchroot)
log_warn("did not exit gracefully last time (%u)",
(unsigned)old);
}
}
#endif /* HAVE_KILL */
/** detach from command line */
static void
detach(struct config_file* cfg)
detach(void)
{
#if defined(HAVE_DAEMON) && !defined(DEPRECATED_DAEMON)
/* use POSIX daemon(3) function */
if(daemon(1, 0) != 0)
fatal_exit("daemon failed: %s", strerror(errno));
#else /* no HAVE_DAEMON */
#ifdef HAVE_WORKING_FORK
int fd;
/* Take off... */
switch (fork()) {
case 0:
break;
case -1:
unlink(cfg->pidfile);
fatal_exit("fork failed: %s", strerror(errno));
default:
/* exit interactive session */
exit(0);
}
/* detach */
#ifdef HAVE_SETSID
if(setsid() == -1)
fatal_exit("setsid() failed: %s", strerror(errno));
#endif
if ((fd = open("/dev/null", O_RDWR, 0)) != -1) {
(void)dup2(fd, STDIN_FILENO);
(void)dup2(fd, STDOUT_FILENO);
@@ -197,43 +337,189 @@ detach(struct config_file* cfg)
if (fd > 2)
(void)close(fd);
}
#endif /* HAVE_WORKING_FORK */
#endif /* HAVE_DAEMON */
}
/** daemonize, drop user priviliges and chroot if needed */
static void
do_chroot(struct daemon* daemon, struct config_file* cfg, int debug_mode)
perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
const char** cfgfile)
{
#ifdef HAVE_GETPWNAM
struct passwd *pwd = NULL;
uid_t uid;
gid_t gid;
/* initialize, but not to 0 (root) */
memset(&uid, 112, sizeof(uid));
memset(&gid, 112, sizeof(gid));
log_assert(cfg);
/* daemonize last to be able to print error to user */
if(cfg->chrootdir && cfg->chrootdir[0])
if(chroot(cfg->chrootdir))
fatal_exit("unable to chroot: %s", strerror(errno));
if(cfg->username && cfg->username[0]) {
struct passwd *pwd;
if((pwd = getpwnam(cfg->username)) == NULL)
fatal_exit("user '%s' does not exist.", cfg->username);
if(setgid(pwd->pw_gid) != 0)
fatal_exit("unable to set group id: %s", strerror(errno));
if(setuid(pwd->pw_uid) != 0)
fatal_exit("unable to set user id: %s", strerror(errno));
endpwent();
uid = pwd->pw_uid;
gid = pwd->pw_gid;
/* endpwent below, in case we need pwd for setusercontext */
}
#endif
/* init syslog (as root) if needed, before daemonize, otherwise
* a fork error could not be printed since daemonize closed stderr.*/
if(cfg->use_syslog) {
log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
}
/* if using a logfile, we cannot open it because the logfile would
* be created with the wrong permissions, we cannot chown it because
* we cannot chown system logfiles, so we do not open at all.
* So, using a logfile, the user does not see errors unless -d is
* given to unbound on the commandline. */
/* read ssl keys while superuser and outside chroot */
if(!(daemon->rc = daemon_remote_create(cfg)))
fatal_exit("could not set up remote-control");
#ifdef HAVE_KILL
/* check old pid file before forking */
if(cfg->pidfile && cfg->pidfile[0]) {
checkoldpid(cfg);
/* calculate position of pidfile */
if(cfg->pidfile[0] == '/')
daemon->pidfile = strdup(cfg->pidfile);
else daemon->pidfile = fname_after_chroot(cfg->pidfile,
cfg, 1);
if(!daemon->pidfile)
fatal_exit("pidfile alloc: out of memory");
checkoldpid(daemon->pidfile,
/* true if pidfile is inside chrootdir, or nochroot */
!(cfg->chrootdir && cfg->chrootdir[0]) ||
(cfg->chrootdir && cfg->chrootdir[0] &&
strncmp(daemon->pidfile, cfg->chrootdir,
strlen(cfg->chrootdir))==0));
}
#endif
/* daemonize because pid is needed by the writepid func */
if(!debug_mode && cfg->do_daemonize) {
detach();
}
/* init logfile just before fork */
log_init(cfg->logfile);
if(!debug_mode && cfg->do_daemonize) {
detach(cfg);
}
/* write new pidfile (while still root, so can be outside chroot) */
#ifdef HAVE_KILL
if(cfg->pidfile && cfg->pidfile[0]) {
writepid(cfg->pidfile, getpid());
if(!(daemon->pidfile = strdup(cfg->pidfile)))
log_err("pidf: malloc failed");
writepid(daemon->pidfile, getpid());
if(!(cfg->chrootdir && cfg->chrootdir[0]) ||
(cfg->chrootdir && cfg->chrootdir[0] &&
strncmp(daemon->pidfile, cfg->chrootdir,
strlen(cfg->chrootdir))==0)) {
/* delete of pidfile could potentially work,
* chown to get permissions */
if(cfg->username && cfg->username[0]) {
if(chown(daemon->pidfile, uid, gid) == -1) {
fatal_exit("cannot chown %u.%u %s: %s",
(unsigned)uid, (unsigned)gid,
daemon->pidfile, strerror(errno));
}
}
}
}
#else
(void)daemon;
#endif
/* box into the chroot */
#ifdef HAVE_CHROOT
if(cfg->chrootdir && cfg->chrootdir[0]) {
if(chdir(cfg->chrootdir)) {
fatal_exit("unable to chdir to chroot %s: %s",
cfg->chrootdir, strerror(errno));
}
verbose(VERB_QUERY, "chdir to %s", cfg->chrootdir);
if(chroot(cfg->chrootdir))
fatal_exit("unable to chroot to %s: %s",
cfg->chrootdir, strerror(errno));
verbose(VERB_QUERY, "chroot to %s", cfg->chrootdir);
if(strncmp(*cfgfile, cfg->chrootdir,
strlen(cfg->chrootdir)) == 0)
(*cfgfile) += strlen(cfg->chrootdir);
/* adjust stored pidfile for chroot */
if(daemon->pidfile && daemon->pidfile[0] &&
strncmp(daemon->pidfile, cfg->chrootdir,
strlen(cfg->chrootdir))==0) {
char* old = daemon->pidfile;
daemon->pidfile = strdup(old+strlen(cfg->chrootdir));
free(old);
if(!daemon->pidfile)
log_err("out of memory in pidfile adjust");
}
daemon->chroot = strdup(cfg->chrootdir);
if(!daemon->chroot)
log_err("out of memory in daemon chroot dir storage");
}
#else
(void)cfgfile;
#endif
/* change to working directory inside chroot */
if(cfg->directory && cfg->directory[0]) {
char* dir = cfg->directory;
if(cfg->chrootdir && cfg->chrootdir[0] &&
strncmp(dir, cfg->chrootdir,
strlen(cfg->chrootdir)) == 0)
dir += strlen(cfg->chrootdir);
if(dir[0]) {
if(chdir(dir)) {
fatal_exit("Could not chdir to %s: %s",
dir, strerror(errno));
}
verbose(VERB_QUERY, "chdir to %s", dir);
}
}
/* drop permissions after chroot, getpwnam, pidfile, syslog done*/
#ifdef HAVE_GETPWNAM
if(cfg->username && cfg->username[0]) {
#ifdef HAVE_SETUSERCONTEXT
/* setusercontext does initgroups, setuid, setgid, and
* also resource limits from login config, but we
* still call setresuid, setresgid to be sure to set all uid*/
if(setusercontext(NULL, pwd, uid, LOGIN_SETALL) != 0)
log_warn("unable to setusercontext %s: %s",
cfg->username, strerror(errno));
#else /* !HAVE_SETUSERCONTEXT */
# ifdef HAVE_INITGROUPS
if(initgroups(cfg->username, gid) != 0)
log_warn("unable to initgroups %s: %s",
cfg->username, strerror(errno));
# endif /* HAVE_INITGROUPS */
#endif /* HAVE_SETUSERCONTEXT */
endpwent();
#ifdef HAVE_SETRESGID
if(setresgid(gid,gid,gid) != 0)
#elif defined(HAVE_SETREGID) && !defined(DARWIN_BROKEN_SETREUID)
if(setregid(gid,gid) != 0)
#else /* use setgid */
if(setgid(gid) != 0)
#endif /* HAVE_SETRESGID */
fatal_exit("unable to set group id of %s: %s",
cfg->username, strerror(errno));
#ifdef HAVE_SETRESUID
if(setresuid(uid,uid,uid) != 0)
#elif defined(HAVE_SETREUID) && !defined(DARWIN_BROKEN_SETREUID)
if(setreuid(uid,uid) != 0)
#else /* use setuid */
if(setuid(uid) != 0)
#endif /* HAVE_SETRESUID */
fatal_exit("unable to set user id of %s: %s",
cfg->username, strerror(errno));
verbose(VERB_QUERY, "drop user privileges, run as %s",
cfg->username);
}
#endif /* HAVE_GETPWNAM */
/* file logging inited after chroot,chdir,setuid is done so that
* it would succeed on SIGHUP as well */
if(!cfg->use_syslog)
log_init(cfg->logfile, cfg->use_syslog, cfg->chrootdir);
}
/**
@@ -248,28 +534,36 @@ run_daemon(const char* cfgfile, int cmdline_verbose, int debug_mode)
{
struct config_file* cfg = NULL;
struct daemon* daemon = NULL;
int done_chroot = 0;
int done_setup = 0;
if(!(daemon = daemon_init()))
fatal_exit("alloc failure");
while(!daemon->need_to_exit) {
if(done_chroot)
log_info("Restart of %s.", PACKAGE_STRING);
else log_info("Start of %s.", PACKAGE_STRING);
if(done_setup)
verbose(VERB_OPS, "Restart of %s.", PACKAGE_STRING);
else verbose(VERB_OPS, "Start of %s.", PACKAGE_STRING);
/* config stuff */
if(!(cfg = config_create()))
fatal_exit("Could not alloc config defaults");
if(!config_read(cfg, cfgfile))
fatal_exit("Could not read config file: %s", cfgfile);
apply_dir(daemon, cfg, cmdline_verbose);
if(!config_read(cfg, cfgfile, daemon->chroot)) {
if(errno != ENOENT)
fatal_exit("Could not read config file: %s",
cfgfile);
log_warn("Continuing with default config settings");
}
apply_settings(daemon, cfg, cmdline_verbose);
/* prepare */
if(!daemon_open_shared_ports(daemon))
fatal_exit("could not open ports");
if(!done_chroot) {
do_chroot(daemon, cfg, debug_mode);
done_chroot = 1;
if(!done_setup) {
perform_setup(daemon, cfg, debug_mode, &cfgfile);
done_setup = 1;
} else {
/* reopen log after HUP to facilitate log rotation */
if(!cfg->use_syslog)
log_init(cfg->logfile, 0, cfg->chrootdir);
}
/* work */
daemon_fork(daemon);
@@ -280,8 +574,17 @@ run_daemon(const char* cfgfile, int cmdline_verbose, int debug_mode)
config_delete(cfg);
}
verbose(VERB_ALGO, "Exit cleanup.");
if(daemon->pidfile)
/* this unlink may not work if the pidfile is located outside
* of the chroot/workdir or we no longer have permissions */
if(daemon->pidfile) {
int fd;
/* truncate pidfile */
fd = open(daemon->pidfile, O_WRONLY | O_TRUNC, 0644);
if(fd != -1)
close(fd);
/* delete pidfile */
unlink(daemon->pidfile);
}
daemon_delete(daemon);
}
@@ -300,16 +603,24 @@ int
main(int argc, char* argv[])
{
int c;
const char* cfgfile = NULL;
const char* cfgfile = CONFIGFILE;
const char* winopt = NULL;
int cmdline_verbose = 0;
int debug_mode = 0;
int cmdline_cfg = 0;
log_init(NULL);
#ifdef HAVE_SBRK
/* take debug snapshot of heap */
unbound_start_brk = sbrk(0);
#endif
log_init(NULL, 0, NULL);
/* parse the options */
while( (c=getopt(argc, argv, "c:dhv")) != -1) {
while( (c=getopt(argc, argv, "c:dhvw:")) != -1) {
switch(c) {
case 'c':
cfgfile = optarg;
cmdline_cfg = 1;
break;
case 'v':
cmdline_verbose ++;
@@ -318,6 +629,9 @@ main(int argc, char* argv[])
case 'd':
debug_mode = 1;
break;
case 'w':
winopt = optarg;
break;
case '?':
case 'h':
default:
@@ -328,11 +642,21 @@ main(int argc, char* argv[])
argc -= optind;
argv += optind;
if(winopt) {
#ifdef UB_ON_WINDOWS
wsvc_command_option(winopt, cfgfile, cmdline_verbose,
cmdline_cfg);
#else
fatal_exit("option not supported");
#endif
}
if(argc != 0) {
usage();
return 1;
}
run_daemon(cfgfile, cmdline_verbose, debug_mode);
log_init(NULL, 0, NULL); /* close logfile */
return 0;
}
+1037 -313
View File
File diff suppressed because it is too large Load Diff
+107 -57
View File
@@ -43,45 +43,33 @@
#ifndef DAEMON_WORKER_H
#define DAEMON_WORKER_H
#include "config.h"
#include "util/netevent.h"
#include "util/locks.h"
#include "util/alloc.h"
#include "util/data/msgreply.h"
#include "util/data/msgparse.h"
#include "daemon/stats.h"
#include "util/module.h"
struct listen_dnsport;
struct outside_network;
struct config_file;
struct daemon;
struct listen_port;
struct ub_randstate;
/** size of table used for random numbers. large to be more secure. */
#define RND_STATE_SIZE 256
struct regional;
struct tube;
struct daemon_remote;
/** worker commands */
enum worker_commands {
/** make the worker quit */
worker_cmd_quit
};
/** information per query that is in processing */
struct work_query {
/** next query in freelist */
struct work_query* next;
/** the worker for this query */
struct worker* worker;
/** the query reply destination, packet buffer and where to send. */
struct comm_reply query_reply;
/** the query_info structure from the query */
struct query_info qinfo;
/** hash value of the query qinfo */
hashvalue_t query_hash;
/** next query in all-list */
struct work_query* all_next;
/** id of query, in network byteorder. */
uint16_t query_id;
/** flags uint16 from query */
uint16_t query_flags;
worker_cmd_quit,
/** obtain statistics */
worker_cmd_stats,
/** obtain statistics without statsclear */
worker_cmd_stats_noreset,
/** execute remote control command */
worker_cmd_remote
};
/**
@@ -95,41 +83,41 @@ struct worker {
struct daemon* daemon;
/** thread id */
ub_thread_t thr_id;
/** fd 0 of socketpair, write commands for worker to this one */
int cmd_send_fd;
/** fd 1 of socketpair, worker listens on this one */
int cmd_recv_fd;
/** pipe, for commands for this worker */
struct tube* cmd;
/** the event base this worker works with */
struct comm_base* base;
/** the frontside listening interface where request events come in */
struct listen_dnsport* front;
/** the backside outside network interface to the auth servers */
struct outside_network* back;
/** ports to be used by this worker. */
int* ports;
/** number of ports for this worker */
int numports;
/** the signal handler */
struct comm_signal* comsig;
/** commpoint to listen to commands. */
struct comm_point* cmd_com;
/** timer for statistics */
struct comm_timer* stat_timer;
/** number of requests currently active */
size_t num_requests;
/** number of requests that can be handled by this worker */
size_t request_size;
/** the free working queries */
struct work_query* free_queries;
/** list of all working queries */
struct work_query* all_queries;
/** address to forward to */
struct sockaddr_storage fwd_addr;
/** length of fwd_addr */
socklen_t fwd_addrlen;
/** random() table for this worker. */
struct ub_randstate* rndstate;
/** do we need to restart (instead of exit) ? */
int need_to_restart;
/** do we need to restart or quit (on signal) */
int need_to_exit;
/** allocation cache for this thread */
struct alloc_cache alloc;
/** per thread statistics */
struct server_stats stats;
/** thread scratch regional */
struct regional* scratchpad;
/** module environment passed to modules, changed for this thread */
struct module_env env;
};
/**
@@ -137,9 +125,11 @@ struct worker {
* with backpointers only. Use worker_init on it later.
* @param daemon: the daemon that this worker thread is part of.
* @param id: the thread number from 0.. numthreads-1.
* @param ports: the ports it is allowed to use, array.
* @param n: the number of ports.
* @return: the new worker or NULL on alloc failure.
*/
struct worker* worker_create(struct daemon* daemon, int id);
struct worker* worker_create(struct daemon* daemon, int id, int* ports, int n);
/**
* Initialize worker.
@@ -147,12 +137,11 @@ struct worker* worker_create(struct daemon* daemon, int id);
* @param worker: worker to initialize, created with worker_create.
* @param cfg: configuration settings.
* @param ports: list of shared query ports.
* @param buffer_size: size of datagram buffer.
* @param do_sigs: if true, worker installs signal handlers.
* @return: false on error.
*/
int worker_init(struct worker* worker, struct config_file *cfg,
struct listen_port* ports, size_t buffer_size, int do_sigs);
struct listen_port* ports, int do_sigs);
/**
* Make worker work.
@@ -164,23 +153,12 @@ void worker_work(struct worker* worker);
*/
void worker_delete(struct worker* worker);
/**
* Set forwarder
* @param worker: the worker to modify.
* @param ip: the server name.
* @param port: port on server or NULL for default 53.
* @return: false on error.
*/
int worker_set_fwd(struct worker* worker, const char* ip, int port);
/**
* Send a command to a worker. Uses blocking writes.
* @param worker: worker to send command to.
* @param buffer: an empty buffer to use.
* @param cmd: command to send.
*/
void worker_send_cmd(struct worker* worker, ldns_buffer* buffer,
enum worker_commands cmd);
void worker_send_cmd(struct worker* worker, enum worker_commands cmd);
/**
* Worker signal handler function. User argument is the worker itself.
@@ -189,4 +167,76 @@ void worker_send_cmd(struct worker* worker, ldns_buffer* buffer,
*/
void worker_sighandler(int sig, void* arg);
/**
* Worker service routine to send udp messages for modules.
* @param pkt: packet to send.
* @param addr: where to.
* @param addrlen: length of addr.
* @param timeout: seconds to wait until timeout.
* @param q: wich query state to reactivate upon return.
* @param use_tcp: true to use TCP, false for UDP.
* @return: false on failure (memory or socket related). no query was
* sent.
*/
int worker_send_packet(ldns_buffer* pkt, struct sockaddr_storage* addr,
socklen_t addrlen, int timeout, struct module_qstate* q, int use_tcp);
/**
* Worker service routine to send serviced queries to authoritative servers.
* @param qname: query name. (host order)
* @param qnamelen: length in bytes of qname, including trailing 0.
* @param qtype: query type. (host order)
* @param qclass: query class. (host order)
* @param flags: host order flags word, with opcode and CD bit.
* @param dnssec: if set, EDNS record will have DO bit set.
* @param addr: where to.
* @param addrlen: length of addr.
* @param q: wich query state to reactivate upon return.
* @return: false on failure (memory or socket related). no query was
* sent.
*/
struct outbound_entry* worker_send_query(uint8_t* qname, size_t qnamelen,
uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
struct sockaddr_storage* addr, socklen_t addrlen,
struct module_qstate* q);
/**
* process control messages from the main thread. Frees the control
* command message.
* @param tube: tube control message came on.
* @param msg: message contents. Is freed.
* @param len: length of message.
* @param error: if error (NETEVENT_*) happened.
* @param arg: user argument
*/
void worker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len,
int error, void* arg);
/** handles callbacks from listening event interface */
int worker_handle_request(struct comm_point* c, void* arg, int error,
struct comm_reply* repinfo);
/** process incoming replies from the network */
int worker_handle_reply(struct comm_point* c, void* arg, int error,
struct comm_reply* reply_info);
/** process incoming serviced query replies from the network */
int worker_handle_service_reply(struct comm_point* c, void* arg, int error,
struct comm_reply* reply_info);
/** cleanup the cache to remove all rrset IDs from it, arg is worker */
void worker_alloc_cleanup(void* arg);
/**
* Init worker stats - includes server_stats_init, outside network and mesh.
* @param worker: the worker to init
*/
void worker_stats_clear(struct worker* worker);
/** statistics timer callback handler */
void worker_stat_timer_cb(void* arg);
/** probe timer callback handler */
void worker_probe_timer_cb(void* arg);
#endif /* DAEMON_WORKER_H */
+20
View File
@@ -0,0 +1,20 @@
Unbound was developed at NLnet Labs by Wouter Wijngaards.
Unbound was architected in January of 2004 by Jakob Schlyter of Kirei
and Roy Arends of Nominet. VeriSign and EP.Net funded development of
the prototype, which was built by David Blacka and Matt Larson of VeriSign.
Late in 2006, NLnet Labs joined the effort, writing an implementation in C
based on the existing prototype and using experience NLnet Labs gained
during the development of NSD, an authoritative DNS server.
At NLnet Labs, Jelte Jansen, Mark Santcroos and Matthijs Mekking
reviewed the unbound C sources.
Jakob Schlyter - for advice on secure settings, random numbers and blacklists.
Ondřej Surý - running coverity analysis tool on 0.9 dev version.
Alexander Gall - multihomed, anycast testing of unbound resolver server.
Zdenek Vasicek and Marek Vavrusa - python module.
cz.nic - sponsoring 'summer of code' development by Zdenek and Marek.
Brett Carr - windows beta testing.
Luca Bruno - patch for windows support in libunbound hosts and resolvconf().
Tom Hendrikx - contributed split-itar.sh a useful script to 5011-track ITAR.
+3150
View File
File diff suppressed because it is too large Load Diff
+91
View File
@@ -0,0 +1,91 @@
Unbound Features
(C) Copyright 2008, Wouter Wijngaards, NLnet Labs.
This document describes the features and RFCs that unbound
adheres to, and which ones are decided to be out of scope.
Big Features
------------
Recursive service.
Caching service.
Forwarding and stub zones.
No authoritative service.
DNSSEC Validation options.
EDNS0, NSEC3, Unknown-RR-types.
Details
-------
Processing support
RFC 1034-1035: as a recursive, caching server. Not authoritative.
including CNAMEs, referrals, wildcards, classes, ...
RFC 4033-4035: as a validating caching server (unbound daemon).
as a validating stub (libunbound).
RFC 1918.
RFC 2181: completely, including the trust model, keeping rrsets together.
RFC 2672: DNAME support.
RFC 3597: Unknown RR type support.
RFC 2671: EDNS0 support, default advertisement 4Kb size.
RFC 5155: NSEC3, NSEC3PARAM types
AAAA type. and IP6 dual stack support.
type ANY queries are supported.
RFC 2308: TTL directive, and the rest of the RFC too.
RFC 4592: wildcards.
RFC 1995, 1996, 2136: not authoritative, so no AXFR, IXFR, NOTIFY or
dynamic update services are appropriate.
chroot and drop-root-privileges support, default enabled in config file.
AD bit in query can be used to request AD bit in response (w/o using DO bit).
CD bit in query can be used to request bogus data.
UDP and TCP service is provided downstream.
UDP and TCP are used to request from upstream servers.
Multiple queries can be made over a TCP stream.
No TSIG support at this time.
No SIG0 support at this time.
No dTLS support at this time.
This is not a DNS statistics package, but some operationally useful
values are provided.
TXT RRs from the Chaos class (id.server, hostname.bind, ...) supported.
draft-forgery-resilience: all recommendations followed.
draft-0x20: experimental implementation (incomplete).
implements bitwise echo of the query to support downstream 0x20.
draft-ietf-dnsop-default-local-zones is fully supported (-04).
It is possible to block zones or return an address for localhost.
This is a very limited authoritative service. Defaults as in draft.
draft-ietf-dnsop-resolver-priming(-00): can prime and can fallback to
a safety belt list.
draft-ietf-dnsop-dnssec-trust-anchor(-01): DS records can be configured
as trust anchors. Also DNSKEYs are allowed, by the way.
draft-ietf-dnsop-reflectors-are-evil: access control list for recursive
service. In fact for all DNS service so cache snooping is halted.
Record type syntax support, extensive, from lib ldns.
For these types only syntax and parsing support is needed.
RFC 1034-1035: basic RR types.
RFC 1183: RP, AFSDB, X25, ISDN, RT
RFC 1706: NSAP
RFC 2535: KEY, SIG, NXT: treated as unknown data, syntax is parsed (obsolete).
2163: PX
AAAA type
1876: LOC type
2782: SRV type
2915: NAPTR type.
2230: KX type.
2538: CERT type.
2672: DNAME type.
OPT type
3123: APL
SSHFP type
4025: IPSECKEY
4033-4035: DS, RRSIG, NSEC, DNSKEY
4701: DHCID
5155: NSEC3, NSEC3PARAM
4408: SPF
+96 -10
View File
@@ -4,25 +4,111 @@ http://unbound.net
This software is under BSD license, see LICENSE for details.
* Needs the following libraries
* ldns http://www.nlnetlabs.nl/ldns/ (BSD license)
* libevent http://www.monkey.org/~provos/libevent/ (BSD license)
* Download the latest release version of this software from
http://unbound.net
or get a beta version from the svn repository at
http://unbound.net/svn/
* Make and install: ./configure; make
* Uses the following libraries;
* ldns http://www.nlnetlabs.nl/ldns/ (BSD license)
(required) can use tarball from source directory.
* libevent http://www.monkey.org/~provos/libevent/ (BSD license)
(optional) can use builtin alternative instead.
* Make and install: ./configure; make; make install
* Use GNU make; default on linux, often called 'gmake' on BSD and Solaris.
* --with-ldns=/path/to/ldns
If ldns is not detected on the system, a prepackaged tarball
of the ldns library is used to compile and statically link against.
If detected on the system, it will dynamically link against it.
* --with-libevent=/path/to/libevent
Can be set to either the system install or the build directory.
--with-libevent=no gives an alternative to libevent (based on select).
--with-libevent=no (default) gives a builtin alternative
implementation. libevent is useful when having many (thousands)
of outgoing ports. This improves randomization and spoof
resistance. For the default of 16 ports the builtin alternative
works well and is a little faster.
* --without-pthreads
This disables pthreads. Without this option the pthreads library
is detected automatically. Use this option to disable threading
altogether, or, on Solaris, also use --with(out)-solaris-threads.
* --enable-static-exe
This enables a debug option to statically link, against ldns and
libevent libraries.
* --enable-lock-checks
This enables a debug option to check lock and unlock calls. It needs
a recent pthreads library to work.
* --enable-alloc-checks
This enables a debug option to check malloc (calloc, realloc, free).
The server periodically checks if the amount of memory used fits with
the amount of memory it thinks it should be using, and reports
memory usage in detail.
* --with-conf-file=filename
Set default location of config file,
the default is /usr/local/etc/unbound/unbound.conf.
* --with-pidfile=filename
Set default location of pidfile,
the default is /usr/local/etc/unbound/unbound.pid.
* --with-run-dir=path
Set default working directory,
the default is /usr/local/etc/unbound.
* --with-chroot-dir=path
Set default chroot directory,
the default is /usr/local/etc/unbound.
* --with-username=user
Set default user name to change to,
the default is the "unbound" user.
* --with-pyunbound
Create libunbound wrapper usable from python.
Needs python-devel and swig development tools.
* --with-pythonmodule
Compile the python module that processes responses in the server.
* --disable-sha2
Disable support for RSASHA256 and RSASHA512 crypto.
* --enable-gost
Enable draft support for GOST crypto.
* Create build environment
* run libtoolize -c if config.sub is missing.
* autoreconf (autoheader && autoconf), if ./configure is missing.
* 'make test' attempts to run a series of tests, depending on the support
programs that are installed.
Known issues
------------
o If libevent is older (1.3 and before), unbound will exit instead of reload
o If there are no replies for a forward or stub zone, for a reverse zone,
you may need to add a local-zone: name transparent or nodefault to the
server: section of the config file to unblock the reverse zone.
Only happens for (sub)zones that are blocked by default; e.g. 10.in-addr.arpa
o If libevent is older (before 1.3c), unbound will exit instead of reload
on sighup. On a restart 'did not exit gracefully last time' warning is
printed. Perform ./configure --with-libevent=no or update libevent, rerun
configure and recompile unbound to make sighup work correctly.
It is strongly suggested to use a recent version of libevent.
o If you are not receiving the correct source IP address on replies (e.g.
you are running a multihomed, anycast server), the interface-automatic
option can be enabled to set socket options to achieve the correct
source IP address on UDP replies. Listing all IP addresses explicitly in
the config file is an alternative. The interface-automatic option uses
non portable socket options, Linux and FreeBSD should work fine.
o The warning 'openssl has no entropy, seeding with time', with chroot
enabled, may be solved with a symbolic link to /dev/random from <chrootdir>.
o On Solaris 5.10 some libtool packages from repositories do not work with
gcc, showing errors gcc: unrecognized option `-KPIC'
To solve this do ./configure libtool=./libtool [your options...].
o If unbound-control (or munin graphs) do not work, this can often be because
the unbound-control-setup script creates the keys with restricted
permissions, and the files need to be made readable or ownered by both the
unbound daemon and unbound-control.
o Crosscompile seems to hang. You tried to install unbound under wine.
wine regedit and remove all the unbound entries from the registry or
delete .wine/drive_c.
* mailto:wouter@nlnetlabs.nl
Acknowledgements
----------------
o Unbound was written in portable C by Wouter Wijngaards (NLnet Labs).
o Thanks to David Blacka and Matt Larson (Verisign) for the unbound-java
prototype. Design and code from that prototype has been used to create
this program. Such as the iterator state machine and the cache design.
o Other code origins are from the NSD (NLnet Labs) and LDNS (NLnet Labs)
projects. Such as buffer, region-allocator and red-black tree code.
o See Credits file for contributors.
* mailto:unbound-bugs@nlnetlabs.nl
+5 -3
View File
@@ -1,11 +1,13 @@
README.svn
For a svn checkout
* Create build environment - see README.
* possibly copy aclocal.m4 from your autoconf/libtool setup.
* configure script, aclocal.m4, as well as yacc/lex output files are
committed to the repository.
* use --enable-debug flag for configure to enable dependency tracking and
assertions, otherwise, use make clean; make after svn update.
* Note changes in the Changelog.
* Every checking a postcommit hook is run
* Every check-in a postcommit hook is run
(the postcommit hook is in the svn/unbound/hooks directory).
* generates commit email with your changes and comment.
* compiles and runs the tests (with testcode/do-tests.sh).
+16 -2
View File
@@ -1,6 +1,20 @@
README unbound tests
There is a test setup for unbound.
There is a test setup for unbound. Use
make test
To make and run the tests. The results are summarized at the end.
You need to have the following programs installed and in your PATH.
* dig - from the bind-tools package. Used to send DNS queries.
* splint (optional) - for lint test
* doxygen (optional) - for doc completeness test
* ldns-testns (optional) - from ldns examples. Used as DNS auth server.
* xxd and nc (optional) - for (malformed) packet transmission.
The optional programs are detected and can be omitted.
Without any support programs, unittest and testbound can still be used.
(cd testdata; ../testcode/mini_tpkg.sh exe 02-unittest.tpkg)
(cd testdata; ../testcode/mini_tpkg.sh exe 03-testbound.tpkg)
testdata/ contains the data for tests.
testcode/ contains scripts and c code for the tests.
@@ -8,4 +22,4 @@ testcode/ contains scripts and c code for the tests.
do-tests.sh : runs all the tests in the testdata directory.
testbed.sh : compiles on a set of (user specific) hosts and runs do-tests.
Tests are run using tpkg.
Tests are run using testcode/mini_tpkg.sh.
+71 -5
View File
@@ -1,5 +1,71 @@
TODO items.
o use real entropy to make random (ID, port) numbers more random.
o in production mode, do not free memory on exit. In debug mode, test leaks.
o profile memory allocation, and if performance issues, use special memory
allocator. For example, with caches per thread.
TODO items. These are interesting todo items.
o understand synthesized DNAMEs, so those TTL=0 packets are cached properly.
o NSEC/NSEC3 aggressive negative caching, so that updates to NSEC/NSEC3
will result in proper negative responses.
o (option) where port 53 is used for send and receive, no other ports are used.
o (option) to not send replies to clients after a timeout of (say 5 secs) has
passed, but keep task active for later retries by client.
o (option) private TTL feature (always report TTL x in answers).
o (option) pretend-dnssec-unaware, and pretend-edns-unaware modes for workshops.
o delegpt use rbtree for ns-list, to avoid slowdown for very large NS sets.
o (option) reprime and refresh oft used data before timeout.
o (option) retain prime results in a overlaid roothints file.
o (option) store primed key data in a overlaid keyhints file (sort of like drafttimers).
o windows version, auto update feature, a query to check for the version.
o command the server with TSIG inband. get-config, clearcache,
get stats, get memstats, get ..., reload, clear one zone from cache
o NSID rfc 5001 support.
o timers rfc 5011 support.
o Treat YXDOMAIN from a DNAME properly, in iterator (not throwaway), validator.
o make timeout backoffs randomized (a couple percent random) to spread traffic.
o inspect date on executable, then warn user in log if its more than 1 year.
o (option) proactively prime root, stubs and trust anchors, feature.
early failure, faster on first query, but more traffic.
o library add convenience functions for A, AAAA, PTR, getaddrinfo, libresolve.
o library add function to validate input from app that is signed.
o add dynamic-update requests (making a dynupd request) to libunbound api.
o SIG(0) and TSIG.
o support OPT record placement on recv anywhere in the additional section.
o add local-file: config with authority features.
o (option) to make local-data answers be secure for libunbound (default=no)
o (option) to make chroot: copy all needed files into jail (or make jail)
perhaps also print reminder to link /dev/random and sysloghack.
o overhaul outside-network servicedquery to merge with udpwait and tcpwait,
to make timers in servicedquery independent of udpwait queues.
o check into rebinding ports for efficiency, configure time test.
o EVP hardware crypto support.
o option to ignore all inception and expiration dates for rrsigs.
o cleaner code; return and func statements on newline.
o memcached module that sits before validator module; checks for memcached
data (on local lan), stores recursion lookup. Provides one cache for multiple resolver machines, coherent reply content in anycast setup.
o no openssl_add_all_algorithms, but only the ones necessary, less space.
o listen to NOTIFY messages for zones and flush the cache for that zone
if received. Useful when also having a stub to that auth server.
Needs proper protection, TSIG, in place.
o winevent - do not go more than 64 fds (by polling with select one by
one), win95/98 have 100fd limit in the kernel, so this ruins w9x portability.
*** Features features, for later
* dTLS, TLS, look to need special port numbers, cert storage, recent libssl.
* aggressive negative caching for NSEC, NSEC3.
* multiple queries per question, server exploration, server selection.
* support TSIG on queries, for validating resolver deployment.
* retry-mode, where a bogus result triggers a retry-mode query, where a list
of responses over a time interval is collected, and each is validated.
or try in TCP mode. Do not 'try all servers several times', since we must
not create packet storms with operator errors.
o on windows version, implement that OS ancillary data capabilities for
interface-automatic. IPPKTINFO, IP6PKTINFO for WSARecvMsg, WSASendMsg.
o local-zone directive with authority service, full authority server
is a non-goal.
o infra and lame cache: easier size config (in Mb), show usage in graphs.
- store time of dump in cachedumps, so that on a load the ttls can be
compared to the absolute time, and now-expired items can be dealt with.
later
- selective verbosity; ubcontrol trace example.com
- cache fork-dump, pre-load
- for fwds, send queries to N servers in fwd-list, use first reply.
document high scalable, high available unbound setup onepager.
- prefetch DNSKEY when DS in delegation seen (nonCD, underTA).
- use libevent if available on system by default(?), default outgoing 256to1024
+66
View File
@@ -0,0 +1,66 @@
Specification for the unbound-control protocol.
Server listens on 953 TCP (localhost by default). Client connects,
SSLv3 or TLSv1 connection setup (server selfsigned certificate,
client has cert signed by server certificate).
Query and Response
------------------
Client sends
UBCT [commandline] \n
fixed string UBCT, then an ascii text line, with a command,
some whitespace allowed. Line ends with '\n'.
Server executes command. And sends reply in ascii text over channel,
closes the channel when done.
in case of error the first line of the response is:
error <descriptive text possible> \n
or the remainder is data of the response, for many commands the
response is 'ok\n'.
Queries and responses
---------------------
stop
stops the server.
reload
reloads the config file, and flushes the cache.
verbosity <new value>
Change logging verbosity to new value.
stats
output is a list of [name]=[value] lines.
clears the counters.
dump_cache
output is a text representation of the cache contents.
data ends with a line 'EOF' before connection close.
load_cache
client sends cache contents (like from dump_cache), which is stored
in the cache. end of data indicated with a line with 'EOF' on it.
The data is sent after the query line.
flush <name>
flushes some information regarding the name from the cache.
removes the A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV, NAPTR types.
Does not remove other types.
flush_type <name> <RR type>
removes rrtype entry from the cache.
flush_zone <name>
removes name and everything below that name from the cache.
has to search through the cache item by item, so this is slow.
lookup <name>
see what servers would be queried for a lookup of the given name.
local_zone_remove <name of local-zone entry>
the local-zone entry is removed.
All data from the local zone is also deleted.
If it did not exist, nothing happens.
local_zone <name of local zone> <type>
As the config file entry. Adds new local zone or updates
existing zone type.
local_data_remove <name>
Removes local-data (all types) name.
local_data <resource record string>
Add new local data record (on the rest of the line).
local_data_add www.example.com. IN A 192.0.2.2
if no local_zone exists for it; a transparent zone with the same
name as the data is created.
-86
View File
@@ -1,86 +0,0 @@
#
# Example configuration file.
#
# See unbound.conf(5) man page.
#
# this is a comment.
#Use this to include other text into the file.
#include: "otherfile.conf"
# The server clause sets the main parameters.
server:
# whitespace is not necessary, but looks cleaner.
# verbosity number, 0 is least verbose. 1 is default.
verbosity: 2
# number of threads to create. 1 disables threading.
# num-threads: 1
# specify the interfaces to answer queries from by ip-address.
# If you give none the default (all) interface is used.
# interface: 127.0.0.1
# port to answer queries from
# port: 53
# unbound needs to send packets to authoritative nameservers.
# it uses a range of ports for that.
# the start number of the port range
# outgoing-port: 1053
# number of port to allocate per thread, determines the size of the
# port range. A larger port range gives more resistance to certain
# spoof attacks, as it gets harder to guess which port is used.
# But also takes more system resources (for open sockets).
# outgoing-range: 16
# the amount of memory to use for the message cache.
# in bytes. default is 4 Mb
# msg-cache-size: 4194304
# the number of slabs to use for the message cache.
# more slabs reduce lock contention, but fracture memory usage.
# msg-cache-slabs: 4
# the number of queries that a thread gets to service.
# num-queries-per-thread: 1024
# Enable IPv4, "yes" or "no".
# do-ip4: yes
# Enable IPv6, "yes" or "no".
# do-ip6: yes
# Enable UDP, "yes" or "no".
# do-udp: yes
# Enable TCP, "yes" or "no".
# do-tcp: yes
# Set this to configure unbound to act as a forwarder. All queries are
# sent to the remote nameserver that will resolve them.
# Set to "" to disable forwarding, or give ip-address to enable.
# forward-to: ""
# The port number to send forwarded queries to.
# forward-to-port: 53
# if given, a chroot(2) is done to the given directory.
# i.e. you can chroot to the working directory, for example,
# for extra security, but make sure all files are in that directory.
# chroot: "/some/directory"
# if given, user privileges are dropped (after binding port),
# and the given username is assumed. Default is nothing "".
# username: "unbound"
# the working directory.
# directory: "/etc/unbound"
# the log file, "" means log to stderr.
# logfile: ""
# the pid file.
# pidfile: "unbound.pid"
+484
View File
@@ -0,0 +1,484 @@
#
# Example configuration file.
#
# See unbound.conf(5) man page.
#
# this is a comment.
#Use this to include other text into the file.
#include: "otherfile.conf"
# The server clause sets the main parameters.
server:
# whitespace is not necessary, but looks cleaner.
# verbosity number, 0 is least verbose. 1 is default.
verbosity: 1
# print statistics to the log (for every thread) every N seconds.
# Set to "" or 0 to disable. Default is disabled.
# statistics-interval: 0
# enable cumulative statistics, without clearing them after printing.
# statistics-cumulative: no
# enable extended statistics (query types, answer codes, status)
# printed from unbound-control. default off, because of speed.
# extended-statistics: no
# number of threads to create. 1 disables threading.
# num-threads: 1
# specify the interfaces to answer queries from by ip-address.
# The default is to listen to localhost (127.0.0.1 and ::1).
# specify 0.0.0.0 and ::0 to bind to all available interfaces.
# specify every interface on a new 'interface:' labelled line.
# The listen interfaces are not changed on reload, only on restart.
# interface: 192.0.2.153
# interface: 192.0.2.154
# interface: 2001:DB8::5
# enable this feature to copy the source address of queries to reply.
# Socket options are not supported on all platforms. experimental.
# interface-automatic: no
# port to answer queries from
# port: 53
# specify the interfaces to send outgoing queries to authoritative
# server from by ip-address. If none, the default (all) interface
# is used. Specify every interface on a 'outgoing-interface:' line.
# outgoing-interface: 192.0.2.153
# outgoing-interface: 2001:DB8::5
# outgoing-interface: 2001:DB8::6
# number of ports to allocate per thread, determines the size of the
# port range that can be open simultaneously.
# outgoing-range: 256
# permit unbound to use this port number or port range for
# making outgoing queries, using an outgoing interface.
# outgoing-port-permit: 32768
# deny unbound the use this of port number or port range for
# making outgoing queries, using an outgoing interface.
# Use this to make sure unbound does not grab a UDP port that some
# other server on this computer needs. The default is to avoid
# IANA-assigned port numbers.
# outgoing-port-avoid: "3200-3208"
# number of outgoing simultaneous tcp buffers to hold per thread.
# outgoing-num-tcp: 10
# number of incoming simultaneous tcp buffers to hold per thread.
# incoming-num-tcp: 10
# buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
# 0 is system default. Use 4m to catch query spikes for busy servers.
# so-rcvbuf: 0
# EDNS reassembly buffer to advertise to UDP peers (the actual buffer
# is set with msg-buffer-size). 1480 can solve fragmentation (timeouts).
# edns-buffer-size: 4096
# buffer size for handling DNS data. No messages larger than this
# size can be sent or received, by UDP or TCP. In bytes.
# msg-buffer-size: 65552
# the amount of memory to use for the message cache.
# plain value in bytes or you can append k, m or G. default is "4Mb".
# msg-cache-size: 4m
# the number of slabs to use for the message cache.
# the number of slabs must be a power of 2.
# more slabs reduce lock contention, but fragment memory usage.
# msg-cache-slabs: 4
# the number of queries that a thread gets to service.
# num-queries-per-thread: 1024
# if very busy, 50% queries run to completion, 50% get timeout in msec
# jostle-timeout: 200
# the amount of memory to use for the RRset cache.
# plain value in bytes or you can append k, m or G. default is "4Mb".
# rrset-cache-size: 4m
# the number of slabs to use for the RRset cache.
# the number of slabs must be a power of 2.
# more slabs reduce lock contention, but fragment memory usage.
# rrset-cache-slabs: 4
# the time to live (TTL) value lower bound, in seconds. Default 0.
# If more than an hour could easily give trouble due to stale data.
# cache-min-ttl: 0
# the time to live (TTL) value cap for RRsets and messages in the
# cache. Items are not cached for longer. In seconds.
# cache-max-ttl: 86400
# the time to live (TTL) value for cached roundtrip times and
# EDNS version information for hosts. In seconds.
# infra-host-ttl: 900
# the time to live (TTL) value for cached lame delegations. In sec.
# infra-lame-ttl: 900
# the number of slabs to use for the Infrastructure cache.
# the number of slabs must be a power of 2.
# more slabs reduce lock contention, but fragment memory usage.
# infra-cache-slabs: 4
# the maximum number of hosts that are cached (roundtrip times, EDNS).
# infra-cache-numhosts: 10000
# the maximum size of the lame zones cached per host. in bytes.
# infra-cache-lame-size: 10k
# Enable IPv4, "yes" or "no".
# do-ip4: yes
# Enable IPv6, "yes" or "no".
# do-ip6: yes
# Enable UDP, "yes" or "no".
# do-udp: yes
# Enable TCP, "yes" or "no".
# do-tcp: yes
# Detach from the terminal, run in background, "yes" or "no".
# do-daemonize: yes
# control which clients are allowed to make (recursive) queries
# to this server. Specify classless netblocks with /size and action.
# By default everything is refused, except for localhost.
# Choose deny (drop message), refuse (polite error reply),
# allow (recursive ok), allow_snoop (recursive and nonrecursive ok)
# access-control: 0.0.0.0/0 refuse
# access-control: 127.0.0.0/8 allow
# access-control: ::0/0 refuse
# access-control: ::1 allow
# access-control: ::ffff:127.0.0.1 allow
# if given, a chroot(2) is done to the given directory.
# i.e. you can chroot to the working directory, for example,
# for extra security, but make sure all files are in that directory.
#
# If chroot is enabled, you should pass the configfile (from the
# commandline) as a full path from the original root. After the
# chroot has been performed the now defunct portion of the config
# file path is removed to be able to reread the config after a reload.
#
# All other file paths (working dir, logfile, roothints, and
# key files) can be specified in several ways:
# o as an absolute path relative to the new root.
# o as a relative path to the working directory.
# o as an absolute path relative to the original root.
# In the last case the path is adjusted to remove the unused portion.
#
# The pid file can be absolute and outside of the chroot, it is
# written just prior to performing the chroot and dropping permissions.
#
# Additionally, unbound may need to access /dev/random (for entropy).
# How to do this is specific to your OS.
#
# If you give "" no chroot is performed. The path must not end in a /.
# chroot: "@UNBOUND_CHROOT_DIR@"
# if given, user privileges are dropped (after binding port),
# and the given username is assumed. Default is user "unbound".
# If you give "" no privileges are dropped.
# username: "@UNBOUND_USERNAME@"
# the working directory. The relative files in this config are
# relative to this directory. If you give "" the working directory
# is not changed.
# directory: "@UNBOUND_RUN_DIR@"
# the log file, "" means log to stderr.
# Use of this option sets use-syslog to "no".
# logfile: ""
# Log to syslog(3) if yes. The log facility LOG_DAEMON is used to
# log to, with identity "unbound". If yes, it overrides the logfile.
# use-syslog: yes
# print UTC timestamp in ascii to logfile, default is epoch in seconds.
# log-time-ascii: no
# the pid file. Can be an absolute path outside of chroot/work dir.
# pidfile: "@UNBOUND_PIDFILE@"
# file to read root hints from.
# get one from ftp://FTP.INTERNIC.NET/domain/named.cache
# root-hints: ""
# enable to not answer id.server and hostname.bind queries.
# hide-identity: no
# enable to not answer version.server and version.bind queries.
# hide-version: no
# the identity to report. Leave "" or default to return hostname.
# identity: ""
# the version to report. Leave "" or default to return package version.
# version: ""
# the target fetch policy.
# series of integers describing the policy per dependency depth.
# The number of values in the list determines the maximum dependency
# depth the recursor will pursue before giving up. Each integer means:
# -1 : fetch all targets opportunistically,
# 0: fetch on demand,
# positive value: fetch that many targets opportunistically.
# Enclose the list of numbers between quotes ("").
# target-fetch-policy: "3 2 1 0 0"
# Harden against very small EDNS buffer sizes.
# harden-short-bufsize: no
# Harden against unseemly large queries.
# harden-large-queries: no
# Harden against out of zone rrsets, to avoid spoofing attempts.
# harden-glue: yes
# Harden against receiving dnssec-stripped data. If you turn it
# off, failing to validate dnskey data for a trustanchor will
# trigger insecure mode for that zone (like without a trustanchor).
# Default on, which insists on dnssec data for trust-anchored zones.
# harden-dnssec-stripped: yes
# Harden the referral path by performing additional queries for
# infrastructure data. Validates the replies (if possible).
# Default off, because the lookups burden the server. Experimental
# implementation of draft-wijngaards-dnsext-resolver-side-mitigation.
# harden-referral-path: no
# Use 0x20-encoded random bits in the query to foil spoof attempts.
# This feature is an experimental implementation of draft dns-0x20.
# use-caps-for-id: no
# Enforce privacy of these addresses. Strips them away from answers.
# It may cause DNSSEC validation to additionally mark it as bogus.
# Protects against 'DNS Rebinding' (uses browser as network proxy).
# Only 'private-domain' and 'local-data' names are allowed to have
# these private addresses. No default.
# private-address: 10.0.0.0/8
# private-address: 172.16.0.0/12
# private-address: 192.168.0.0/16
# private-address: 192.254.0.0/16
# private-address: fd00::/8
# private-address: fe80::/10
# Allow the domain (and its subdomains) to contain private addresses.
# local-data statements are allowed to contain private addresses too.
# private-domain: "example.com"
# If nonzero, unwanted replies are not only reported in statistics,
# but also a running total is kept per thread. If it reaches the
# threshold, a warning is printed and a defensive action is taken,
# the cache is cleared to flush potential poison out of it.
# A suggested value is 10000000, the default is 0 (turned off).
# unwanted-reply-threshold: 0
# Do not query the following addresses. No DNS queries are sent there.
# List one address per entry. List classless netblocks with /size,
# do-not-query-address: 127.0.0.1/8
# do-not-query-address: ::1
# if yes, the above default do-not-query-address entries are present.
# if no, localhost can be queried (for testing and debugging).
# do-not-query-localhost: yes
# module configuration of the server. A string with identifiers
# separated by spaces. "iterator" or "validator iterator"
# module-config: "validator iterator"
# File with DLV trusted keys. Same format as trust-anchor-file.
# There can be only one DLV configured, it is trusted from root down.
# Download http://ftp.isc.org/www/dlv/dlv.isc.org.key
# dlv-anchor-file: "dlv.isc.org.key"
# File with trusted keys for validation. Specify more than one file
# with several entries, one file per entry.
# Zone file format, with DS and DNSKEY entries.
# trust-anchor-file: ""
# File with trusted keys, kept uptodate using RFC5011 probes,
# initial file like trust-anchor-file, then it stores metadata.
# Use several entries, one per domain name, to track multiple zones.
# auto-trust-anchor-file: ""
# Trusted key for validation. DS or DNSKEY. specify the RR on a
# single line, surrounded by "". TTL is ignored. class is IN default.
# (These examples are from August 2007 and may not be valid anymore).
# trust-anchor: "nlnetlabs.nl. DNSKEY 257 3 5 AQPzzTWMz8qSWIQlfRnPckx2BiVmkVN6LPupO3mbz7FhLSnm26n6iG9N Lby97Ji453aWZY3M5/xJBSOS2vWtco2t8C0+xeO1bc/d6ZTy32DHchpW 6rDH1vp86Ll+ha0tmwyy9QP7y2bVw5zSbFCrefk8qCUBgfHm9bHzMG1U BYtEIQ=="
# trust-anchor: "jelte.nlnetlabs.nl. DS 42860 5 1 14D739EB566D2B1A5E216A0BA4D17FA9B038BE4A"
# File with trusted keys for validation. Specify more than one file
# with several entries, one file per entry. Like trust-anchor-file
# but has a different file format. Format is BIND-9 style format,
# the trusted-keys { name flag proto algo "key"; }; clauses are read.
# trusted-keys-file: ""
# Ignore chain of trust. Domain is treated as insecure.
# domain-insecure: "example.com"
# Override the date for validation with a specific fixed date.
# Do not set this unless you are debugging signature inception
# and expiration. "" or "0" turns the feature off.
# val-override-date: ""
# The time to live for bogus data, rrsets and messages. This avoids
# some of the revalidation, until the time interval expires. in secs.
# val-bogus-ttl: 60
# The signature inception and expiration dates are allowed to be off
# by 10% of the lifetime of the signature from our local clock.
# This leeway is capped with a minimum and a maximum. In seconds.
# val-sig-skew-min: 3600
# val-sig-skew-max: 86400
# Should additional section of secure message also be kept clean of
# unsecure data. Useful to shield the users of this validator from
# potential bogus data in the additional section. All unsigned data
# in the additional section is removed from secure messages.
# val-clean-additional: yes
# Turn permissive mode on to permit bogus messages. Thus, messages
# for which security checks failed will be returned to clients,
# instead of SERVFAIL. It still performs the security checks, which
# result in interesting log files and possibly the AD bit in
# replies if the message is found secure. The default is off.
# val-permissive-mode: no
# Have the validator log failed validations for your diagnosis.
# 0: off. 1: A line per failed user query.
# val-log-level: 0
# It is possible to configure NSEC3 maximum iteration counts per
# keysize. Keep this table very short, as linear search is done.
# A message with an NSEC3 with larger count is marked insecure.
# List in ascending order the keysize and count values.
# val-nsec3-keysize-iterations: "1024 150 2048 500 4096 2500"
# instruct the auto-trust-anchor-file probing to add anchors after ttl.
# add-holddown: 2592000 # 30 days
# instruct the auto-trust-anchor-file probing to del anchors after ttl.
# del-holddown: 2592000 # 30 days
# auto-trust-anchor-file probing removes missing anchors after ttl.
# If the value 0 is given, missing anchors are not removed.
# keep-missing: 31622400 # 366 days
# the amount of memory to use for the key cache.
# plain value in bytes or you can append k, m or G. default is "4Mb".
# key-cache-size: 4m
# the number of slabs to use for the key cache.
# the number of slabs must be a power of 2.
# more slabs reduce lock contention, but fragment memory usage.
# key-cache-slabs: 4
# the amount of memory to use for the negative cache (used for DLV).
# plain value in bytes or you can append k, m or G. default is "1Mb".
# neg-cache-size: 1m
# a number of locally served zones can be configured.
# local-zone: <zone> <type>
# local-data: "<resource record string>"
# o deny serves local data (if any), else, drops queries.
# o refuse serves local data (if any), else, replies with error.
# o static serves local data, else, nxdomain or nodata answer.
# o transparent gives local data, but resolves normally for other names
# o redirect serves the zone data for any subdomain in the zone.
# o nodefault can be used to normally resolve AS112 zones.
#
# defaults are localhost address, reverse for 127.0.0.1 and ::1
# and nxdomain for AS112 zones. If you configure one of these zones
# the default content is omitted, or you can omit it with 'nodefault'.
#
# If you configure local-data without specifying local-zone, by
# default a transparent local-zone is created for the data.
#
# You can add locally served data with
# local-zone: "local." static
# local-data: "mycomputer.local. IN A 192.0.2.51"
# local-data: 'mytext.local TXT "content of text record"'
#
# You can override certain queries with
# local-data: "adserver.example.com A 127.0.0.1"
#
# You can redirect a domain to a fixed address with
# (this makes example.com, www.example.com, etc, all go to 192.0.2.3)
# local-zone: "example.com" redirect
# local-data: "example.com A 192.0.2.3"
#
# Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
# You can also add PTR records using local-data directly, but then
# you need to do the reverse notation yourself.
# local-data-ptr: "192.0.2.3 www.example.com"
# Python config section. To enable:
# o use --with-pythonmodule to configure before compiling.
# o list python in the module-config string (above) to enable.
# o and give a python-script to run.
python:
# Script file to load
# python-script: "@UNBOUND_SHARE_DIR@/ubmodule-tst.py"
# Remote control config section.
remote-control:
# Enable remote control with unbound-control(8) here.
# set up the keys and certificates with unbound-control-setup.
# control-enable: no
# what interfaces are listened to for remote control.
# give 0.0.0.0 and ::0 to listen to all interfaces.
# control-interface: 127.0.0.1
# control-interface: ::1
# port number for remote control operations.
# control-port: 953
# unbound server key file.
# server-key-file: "@UNBOUND_RUN_DIR@/unbound_server.key"
# unbound server certificate file.
# server-cert-file: "@UNBOUND_RUN_DIR@/unbound_server.pem"
# unbound-control key file.
# control-key-file: "@UNBOUND_RUN_DIR@/unbound_control.key"
# unbound-control certificate file.
# control-cert-file: "@UNBOUND_RUN_DIR@/unbound_control.pem"
# Stub zones.
# Create entries like below, to make all queries for 'example.com' and
# 'example.org' go to the given list of nameservers. list zero or more
# nameservers by hostname or by ipaddress. If you set stub-prime to yes,
# the list is treated as priming hints (default is no).
# stub-zone:
# name: "example.com"
# stub-addr: 192.0.2.68
# stub-prime: no
# stub-zone:
# name: "example.org"
# stub-host: ns.example.com.
# Forward zones
# Create entries like below, to make all queries for 'example.com' and
# 'example.org' go to the given list of servers. These servers have to handle
# recursion to other nameservers. List zero or more nameservers by hostname
# or by ipaddress. Use an entry with name "." to forward all queries.
# forward-zone:
# name: "example.com"
# forward-addr: 192.0.2.68
# forward-addr: 192.0.2.73@5355 # forward to port 5355.
# forward-zone:
# name: "example.org"
# forward-host: fwd.example.com
+374
View File
@@ -0,0 +1,374 @@
.TH "libunbound" "3" "@date@" "NLnet Labs" "unbound @version@"
.\"
.\" libunbound.3 -- unbound library functions manual
.\"
.\" Copyright (c) 2007, NLnet Labs. All rights reserved.
.\"
.\" See LICENSE for the license.
.\"
.\"
.SH "NAME"
.LP
.B libunbound,
.B unbound.h,
.B ub_ctx,
.B ub_result,
.B ub_callback_t,
.B ub_ctx_create,
.B ub_ctx_delete,
.B ub_ctx_set_option,
.B ub_ctx_config,
.B ub_ctx_set_fwd,
.B ub_ctx_resolvconf,
.B ub_ctx_hosts,
.B ub_ctx_add_ta,
.B ub_ctx_add_ta_file,
.B ub_ctx_trustedkeys,
.B ub_ctx_debugout,
.B ub_ctx_debuglevel,
.B ub_ctx_async,
.B ub_poll,
.B ub_wait,
.B ub_fd,
.B ub_process,
.B ub_resolve,
.B ub_resolve_async,
.B ub_cancel,
.B ub_resolve_free,
.B ub_strerror,
.B ub_ctx_print_local_zones,
.B ub_ctx_zone_add,
.B ub_ctx_zone_remove,
.B ub_ctx_data_add,
.B ub_ctx_data_remove
\- Unbound DNS validating resolver @version@ functions.
.SH "SYNOPSIS"
.LP
.B #include <unbound.h>
.LP
\fIstruct ub_ctx *\fR
\fBub_ctx_create\fR(\fIvoid\fR);
.LP
\fIvoid\fR
\fBub_ctx_delete\fR(\fIstruct ub_ctx*\fR ctx);
.LP
\fIint\fR
\fBub_ctx_set_option\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR opt, \fIchar*\fR val);
.LP
\fIint\fR
\fBub_ctx_config\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR fname);
.LP
\fIint\fR
\fBub_ctx_set_fwd\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR addr);
.LP
\fIint\fR
\fBub_ctx_resolvconf\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR fname);
.LP
\fIint\fR
\fBub_ctx_hosts\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR fname);
.LP
\fIint\fR
\fBub_ctx_add_ta\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR ta);
.LP
\fIint\fR
\fBub_ctx_add_ta_file\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR fname);
.LP
\fIint\fR
\fBub_ctx_trustedkeys\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR fname);
.LP
\fIint\fR
\fBub_ctx_debugout\fR(\fIstruct ub_ctx*\fR ctx, \fIFILE*\fR out);
.LP
\fIint\fR
\fBub_ctx_debuglevel\fR(\fIstruct ub_ctx*\fR ctx, \fIint\fR d);
.LP
\fIint\fR
\fBub_ctx_async\fR(\fIstruct ub_ctx*\fR ctx, \fIint\fR dothread);
.LP
\fIint\fR
\fBub_poll\fR(\fIstruct ub_ctx*\fR ctx);
.LP
\fIint\fR
\fBub_wait\fR(\fIstruct ub_ctx*\fR ctx);
.LP
\fIint\fR
\fBub_fd\fR(\fIstruct ub_ctx*\fR ctx);
.LP
\fIint\fR
\fBub_process\fR(\fIstruct ub_ctx*\fR ctx);
.LP
\fIint\fR
\fBub_resolve\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR name,
.br
\fIint\fR rrtype, \fIint\fR rrclass, \fIstruct ub_result**\fR result);
.LP
\fIint\fR
\fBub_resolve_async\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR name,
.br
\fIint\fR rrtype, \fIint\fR rrclass, \fIvoid*\fR mydata,
.br
\fIub_callback_t\fR callback, \fIint*\fR async_id);
.LP
\fIint\fR
\fBub_cancel\fR(\fIstruct ub_ctx*\fR ctx, \fIint\fR async_id);
.LP
\fIvoid\fR
\fBub_resolve_free\fR(\fIstruct ub_result*\fR result);
.LP
\fIconst char *\fR
\fBub_strerror\fR(\fIint\fR err);
.LP
\fIint\fR
\fBub_ctx_print_local_zones\fR(\fIstruct ub_ctx*\fR ctx);
.LP
\fIint\fR
\fBub_ctx_zone_add\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR zone_name, \fIchar*\fR zone_type);
.LP
\fIint\fR
\fBub_ctx_zone_remove\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR zone_name);
.LP
\fIint\fR
\fBub_ctx_data_add\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR data);
.LP
\fIint\fR
\fBub_ctx_data_remove\fR(\fIstruct ub_ctx*\fR ctx, \fIchar*\fR data);
.SH "DESCRIPTION"
.LP
.B Unbound
is an implementation of a DNS resolver, that does caching and
DNSSEC validation. This is the library API, for using the \-lunbound library.
The server daemon is described in \fIunbound\fR(8).
The library can be used to convert hostnames to ip addresses, and back,
and obtain other information from the DNS. The library performs public\-key
validation of results with DNSSEC.
.P
The library uses a variable of type \fIstruct ub_ctx\fR to keep context
between calls. The user must maintain it, creating it with
.B ub_ctx_create
and deleting it with
.B ub_ctx_delete\fR.
It can be created and deleted at any time. Creating it anew removes any
previous configuration (such as trusted keys) and clears any cached results.
.P
The functions are thread\-safe, and a context an be used in a threaded (as
well as in a non\-threaded) environment. Also resolution (and validation)
can be performed blocking and non\-blocking (also called asynchronous).
The async method returns from the call immediately, so that processing
can go on, while the results become available later.
.P
The functions are discussed in turn below.
.SH "FUNCTIONS"
.TP
.B ub_ctx_create
Create a new context, initialised with defaults.
The information from /etc/resolv.conf and /etc/hosts is not utilised
by default. Use
.B ub_ctx_resolvconf
and
.B ub_ctx_hosts
to read them.
.TP
.B ub_ctx_delete
Delete validation context and free associated resources.
Outstanding async queries are killed and callbacks are not called for them.
.TP
.B ub_ctx_set_option
A power\-user interface that lets you specify one of the options from the
config file format, see \fIunbound.conf\fR(5). Not all options are
relevant. For some specific options, such as adding trust anchors, special
routines exist. Pass the option name with the trailing ':'.
.TP
.B ub_ctx_config
A power\-user interface that lets you specify an unbound config file, see
\fIunbound.conf\fR(5), which is read for configuration. Not all options are
relevant. For some specific options, such as adding trust anchors, special
routines exist.
.TP
.B ub_ctx_set_fwd
Set machine to forward DNS queries to, the caching resolver to use.
IP4 or IP6 address. Forwards all DNS requests to that machine, which
is expected to run a recursive resolver. If the proxy is not
DNSSEC capable, validation may fail. Can be called several times, in
that case the addresses are used as backup servers.
At this time it is only possible to set configuration before the
first resolve is done.
.TP
.B ub_ctx_resolvconf
Read list of nameservers to use from the filename given.
Usually "/etc/resolv.conf". Uses those nameservers as caching proxies.
If they do not support DNSSEC, validation may fail.
Only nameservers are picked up, the searchdomain, ndots and other
settings from \fIresolv.conf\fR(5) are ignored.
If fname NULL is passed, "/etc/resolv.conf" is used (if on Windows,
the system\-wide configured nameserver is picked instead).
At this time it is only possible to set configuration before the
first resolve is done.
.TP
.B ub_ctx_hosts
Read list of hosts from the filename given.
Usually "/etc/hosts". When queried for, these addresses are not marked
DNSSEC secure. If fname NULL is passed, "/etc/hosts" is used
(if on Windows, etc/hosts from WINDIR is picked instead).
At this time it is only possible to set configuration before the
first resolve is done.
.TP
.B
ub_ctx_add_ta
Add a trust anchor to the given context.
At this time it is only possible to add trusted keys before the
first resolve is done.
The format is a string, similar to the zone\-file format,
[domainname] [type] [rdata contents]. Both DS and DNSKEY records are accepted.
.TP
.B ub_ctx_add_ta_file
Add trust anchors to the given context.
Pass name of a file with DS and DNSKEY records in zone file format.
At this time it is only possible to add trusted keys before the
first resolve is done.
.TP
.B ub_ctx_trustedkeys
Add trust anchors to the given context.
Pass the name of a bind\-style config file with trusted\-keys{}.
At this time it is only possible to add trusted keys before the
first resolve is done.
.TP
.B ub_ctx_debugout
Set debug and error log output to the given stream. Pass NULL to disable
output. Default is stderr. File\-names or using syslog can be enabled
using config options, this routine is for using your own stream.
.TP
.B ub_ctx_debuglevel
Set debug verbosity for the context. Output is directed to stderr.
Higher debug level gives more output.
.TP
.B ub_ctx_async
Set a context behaviour for asynchronous action.
if set to true, enables threading and a call to
.B ub_resolve_async
creates a thread to handle work in the background.
If false, a process is forked to handle work in the background.
Changes to this setting after
.B ub_resolve_async
calls have been made have no effect (delete and re\-create the context
to change).
.TP
.B ub_poll
Poll a context to see if it has any new results.
Do not poll in a loop, instead extract the fd below to poll for readiness,
and then check, or wait using the wait routine.
Returns 0 if nothing to read, or nonzero if a result is available.
If nonzero, call
.B ub_process
to do callbacks.
.TP
.B ub_wait
Wait for a context to finish with results. Calls
.B ub_process
after the wait for you. After the wait, there are no more outstanding
asynchronous queries.
.TP
.B ub_fd
Get file descriptor. Wait for it to become readable, at this point
answers are returned from the asynchronous validating resolver.
Then call the \fBub_process\fR to continue processing.
.TP
.B ub_process
Call this routine to continue processing results from the validating
resolver (when the fd becomes readable).
Will perform necessary callbacks.
.TP
.B ub_resolve
Perform resolution and validation of the target name.
The name is a domain name in a zero terminated text string.
The rrtype and rrclass are DNS type and class codes.
The result structure is newly allocated with the resulting data.
.TP
.B ub_resolve_async
Perform asynchronous resolution and validation of the target name.
Arguments mean the same as for \fBub_resolve\fR except no
data is returned immediately, instead a callback is called later.
The callback receives a copy of the mydata pointer, that you can use to pass
information to the callback. The callback type is a function pointer to
a function declared as
.IP
void my_callback_function(void* my_arg, int err,
.br
struct ub_result* result);
.IP
The async_id is returned so you can (at your option) decide to track it
and cancel the request if needed. If you pass a NULL pointer the async_id
is not returned.
.TP
.B ub_cancel
Cancel an async query in progress. This may return an error if the query
does not exist, or the query is already being delivered, in that case you
may still get a callback for the query.
.TP
.B ub_resolve_free
Free struct ub_result contents after use.
.TP
.B ub_strerror
Convert error value from one of the unbound library functions
to a human readable string.
.TP
.B ub_ctx_print_local_zones
Debug printout the local authority information to debug output.
.TP
.B ub_ctx_zone_add
Add new zone to local authority info, like local\-zone \fIunbound.conf\fR(5)
statement.
.TP
.B ub_ctx_zone_remove
Delete zone from local authority info.
.TP
.B ub_ctx_data_add
Add resource record data to local authority info, like local\-data
\fIunbound.conf\fR(5) statement.
.TP
.B ub_ctx_data_remove
Delete local authority data from the name given.
.SH "RESULT DATA STRUCTURE"
.LP
The result of the DNS resolution and validation is returned as
\fIstruct ub_result\fR. The result structure contains the following entries.
.P
.nf
struct ub_result {
char* qname; /* text string, original question */
int qtype; /* type code asked for */
int qclass; /* class code asked for */
char** data; /* array of rdata items, NULL terminated*/
int* len; /* array with lengths of rdata items */
char* canonname; /* canonical name of result */
int rcode; /* additional error code in case of no data */
void* answer_packet; /* full network format answer packet */
int answer_len; /* length of packet in octets */
int havedata; /* true if there is data */
int nxdomain; /* true if nodata because name does not exist */
int secure; /* true if result is secure */
int bogus; /* true if a security failure happened */
char* why_bogus; /* string with error if bogus */
};
.fi
.P
If both secure and bogus are false, security was not enabled for the
domain of the query.
.SH "RETURN VALUES"
Many routines return an error code. The value 0 (zero) denotes no error
happened. Other values can be passed to
.B ub_strerror
to obtain a readable error string.
.B ub_strerror
returns a zero terminated string.
.B ub_ctx_create
returns NULL on an error (a malloc failure).
.B ub_poll
returns true if some information may be available, false otherwise.
.B ub_fd
returns a file descriptor or \-1 on error.
.SH "SEE ALSO"
\fIunbound.conf\fR(5),
\fIunbound\fR(8).
.SH "AUTHORS"
.B Unbound
developers are mentioned in the CREDITS file in the distribution.
-240
View File
@@ -1,240 +0,0 @@
Plan for Unbound.
Split into a set of boxes. Every box will take about 3 weeks to a month
to complete. The first set of of boxes (approx 5 months) will need coding
by a limited set of people. But after every box, a 0.x release is done,
which is then tested and code review is done.
Every box:
* implement the features
* documentation of those features
* test-framework for the new features
* tests for the new features
* speed test of this stage
* release of 0.x version (0.x for development only)
* a teleconference(jabber) held to discuss.
* code review internal couple of days, external a week or so,
while we continue the next box.
Roughly the boxes are as follows:
0.0 initial setup - results in network code that forwards queries
and returns the reply (no cache), but also testbed, svn, maillist.
One query at a time (nonblocking IO though).
0.1 threads - results in threaded forwarder
0.2 LRU hashtable, results in basic caching forwarder (no DNS parse)
0.3 First functionality - results in caching forwarder (with DNS parse,
query compare, RR specific updates).
0.4 Basic resolver - module layout, iterator module, scrubber module,
results in resolver that can service multiple queries per thread.
This stage takes longer, due to complexity in the iterator module.
Twice as long; one box for module layout, one box for iterator module.
0.5 Validator - validator module.
0.6 Bigger and better - good syslog, compressed packets, port ranges,
config file format with config checker.
0.7 Local zones feature - localzones stubzones fwdzones, no leak rfc1918.
0.8 Library use - resolver validator lib (and test apps)
0.9 Corner cases - be able to resolve in the wild. Run fuzzers.
Run as many tests as we can think of.
0.10 Beta release. Run shadow for a resolver in production for several
weeks.
For boxes 0.5-1.0 the planning is to be revised, at the 0.5 stage external
coders are welcome. Since the project is bigger, there is room for them.
This is a summary of the items. Below more detailed work items are spelled
out with a (tentative) directory structure for the project.
Styleguide:
* write working stuff. (it starts to work with no features)
* write tests immediately for every function, every feature.
* document as you go. (doxygen comments, manpages and readme).
* copyright every file BSD. comments every file. clean coding in C.
* every day discuss state of the nation for 10 minutes.
*** Initial setup
* setup svn repo. Makefile with automatic dependencies and configure script.
* link with ldns.
* listen_dnsport and outside_network services, (unit) tests for them.
* use libevent to listen on fds.
* setup test infrastructure (tpkg on checkin; testbed on labs test machines).
* daemon version that forwards queries. (listen, send) Tests for it.
* test by having the outside_net service grab answers from a
file instead of network, file of id priority answerpacket.
and what query to give this answer to, highprio matches first.
*** Threads
* first simple config file reading/writing and tests on config file.
(config option is forwarder: yes/no. Cache size. That sort of thing.)
(very simple format)
* First simple logging (to a file).
* Threads
* check if pthread lib is the one to use (sys specific is faster?).
* make config option to have threads.
* alloc threadable.
* locks.c
* Tests with and without threads.
* alloc_service. Tests for alloc service (unit tests in internal structs).
* threading for the network services.
* Make sure threading/libevent starts working on all test machines.
Use configure to turn off threading/libevent/...
-- use libevent packaged together if not in system.
-- maybe also for pthreads/...
* threaded forwarder version.
* speed test of threaded version.
*** LRU hashtable.
* mini msg/reply structure for LRU hashtable test, simple replay format.
* hashtable+LRU structure. Tests on structure.
* tests on enter/remove, finding items.
* tests on LRU movements.
* Test on speed of finding items.
* slabbed hashtable+LRU structure.
* Test locking; perhaps by having sleeps in some threads to force
locks to contend. helgrind.
* daemon upgraded to be a caching forwarder. So it stores all in cache.
Replies from cache. Tests on fake-caching forwarder functionality.
* timeout of data test
* finding data in cache.
* finding data not in cache.
* lru falloff of data.
* Speed test of fake-caching forwarder.
*** First functionality
* implement dname type and unit tests on it. (all corner cases, random cases)
* implement rrset type and tests. (all corner cases, random cases).
* msg-reply structure. unit tests of structure.
* Test of those rrset pointers
* daemon upgraded to be a caching forwarder. So it stores all in cache.
Replies from cache. Tests on caching forwarder functionality.
* timeout of data test
* finding data in cache.
* finding data not in cache.
* lru falloff of data.
* Test update of one rrset in cached packet.
* Speed test of caching forwarder.
*** Basic Resolver
* Create module interfacce and module caller algorithm.
* Daemon config to use modules. Test the module caller.
* Create basic iterator and scrubber modules.
* Test every state of the iterator by passing test data into
it.
* And scrubber.
* Daemon config as cache(iterator).
* Test daemon
* Speed test.
*** Validator
* Create validator
* Test validator on various conditions. By having stored set of
domains and RRs in those domains to return to validator.
* Validating resolver.
* Test resolver.
* Speed test.
*** Bigger and Better
* DNS packet compression of output.
* test packet compression (that it compresses.)
* config option to compress yes/no
* speed test with and without compression.
* Config file syntax checker program. Tests on checker.
* Use a huge number of random outgoing ports.
* Logging first class feature with config options.
*** Local zones feature.
* Build in local zone features. First the total stop for1912.
* Then 'local content' for minimal serving of localhost.localdomain,
and so on.
* Remember jakob's diagram.
* Forward-local-zone to NSD.
- include in package, autoforkexec on localhost to do so.
* forward local zone to remote server.
* stub zones - send queries for a zone to configged nameserver.
* test local zones
* for speed
* for correctness on corner cases
* for validation
* in case you get data on localzone in an answer (from rootserver).
*** Library use
* Create library that can do:
* resolver
* validator
* validating resolver.
* Test application that links the library. (Like /usr/bin/host+validating).
* Test it.
*** Corner cases
* Try to setup corner cases of (mis)configured DNS service/websites.
* Resolve msoft, google, yahoo, etc weird websites.
* Try to resolve many many different queries, perhaps compared with bind.
treeshrew/
validator/ *.c *.h
module takes qname, qtype, asks next module for answer
and validates that answer.
iterator/ *.c *.h
module takes qname, qtype, iterative DNS queries
never asks next module.
services/
- Routines that provide the callback services for modules.
alloc_service: L1, L2 alloc service
outside_network: pending queries helpers.
pending query structure
listen_dnsport: listen port53 service.
request structure
type_caches/
rrset_cache
msg_cache
rrset and msg cache check local zones.
infra_cache
trusted_key_cache
util/
- Various components from which to build the rest.
storage/
rbtree: redblack tree, for L1 use.
- copy from NSD.
hashtable and hashfunc: for L1 use.
locked_hashtable: for L2 use. -- not needed.
fragment_hashtable: for L2 use.
fragment_rbtree: for L2 use.
slab_allocator: perhaps to support alloc service.
(in util/ itself)
locks: selected lock,unlock (spinlock/mutex).
config: reads, stores config file
netio: register callbacks to select().
- use libevent (!)
- copy from NSD.
log: error and log handling.
module.h: module interface
misc: time() wrapper for speed.
data/
msg_reply: qname/qtype/CD/qclass/reply store.
packed_rrset: main datatype
dname: compare, printf, parse
testcode/
main programs that do unit tests, using testdata
testdata/
daemon/
unbound.c for validating caching recursive dns server.
scheduler.c for the modules.
libunbound-all/
app linkable. Can be configged to do whatever,
validator, iterator, validating iterator, forwarding stub.
libunbound-fwd/
app linkable forwarding stub. Small lib.
ask_cachor/ *.c *.h
module takes qname, qtype, returns answer from msgcache.
could ask cached for answer (and wait for network, 10 ms).
if not in cache, asks next module.
cachord/
main.c, simple udp proto, query or store msg in cache.
supports option to save cache to disk (absolute time ttls).
+182 -1
View File
@@ -34,7 +34,7 @@ then interface with the modules to perform the necessary processing.
In Section 2 the origins of the Unbound project are documented. Section
3 lists the goals, while Section 4 lists the explicit non-goals of the
project.
project. Section 5 discusses choices made during development.
2. History
@@ -79,3 +79,184 @@ o An authoritative name server.
o Too many Features.
5. Choices
----------
o rfc2181 decourages duplicates RRs in RRsets. unbound does not create
duplicates, but when presented with duplicates on the wire from the
authoritative servers, does not perform duplicate removal.
It does do some rrsig duplicate removal, in the msgparser, for dnssec qtype
rrsig and any, because of special rrsig processing in the msgparser.
o The harden-glue feature, when yes all out of zone glue is deleted, when
no out of zone glue is used for further resolving, is more complicated
than that, see below.
Main points:
* rfc2182 trust handling is used.
* data is let through only in very specific cases
* spoofability remains possible.
Not all glue is let through (despite the name of the option). Only glue
which is present in a delegation, of type A and AAAA, where the name is
present in the NS record in the authority section is let through.
The glue that is let through is stored in the cache (marked as 'from the
additional section'). And will then be used for sending queries to. It
will not be present in the reply to the client (if RD is off).
A direct query for that name will attempt to get a msg into the message
cache. Since A and AAAA queries are not synthesized by the unbound cache,
this query will be (eventually) sent to the authoritative server and its
answer will be put in the cache, marked as 'from the answer section' and
thus remove the 'from the additional section' data, and this record is
returned to the client.
The message has a TTL smaller or equal to the TTL of the answer RR.
If the cache memory is low; the answer RR may be dropped, and a glue
RR may be inserted, within the message TTL time, and thus return the
spoofed glue to a client. When the message expires, it is refetched and
the cached RR is updated with the correct content.
The server can be spoofed by getting it to visit a especially prepared
domain. This domain then inserts an address for another authoritative
server into the cache, when visiting that other domain, this address may
then be used to send queries to. And fake answers may be returned.
If the other domain is signed by DNSSEC, the fakes will be detected.
In summary, the harden glue feature presents a security risk if
disabled. Disabling the feature leads to possible better performance
as more glue is present for the recursive service to use. The feature
is implemented so as to minimise the security risk, while trying to
keep this performance gain.
o The method by which dnssec-lameness is detected is not secure. DNSSEC lame
is when a server has the zone in question, but lacks dnssec data, such as
signatures. The method to detect dnssec lameness looks at nonvalidated
data from the parent of a zone. This can be used, by spoofing the parent,
to create a false sense of dnssec-lameness in the child, or a false sense
or dnssec-non-lameness in the child. The first results in the server marked
lame, and not used for 900 seconds, and the second will result in a
validator failure (SERVFAIL again), when the query is validated later on.
Concluding, a spoof of the parent delegation can be used for many cases
of denial of service. I.e. a completely different NS set could be returned,
or the information withheld. All of these alterations can be caught by
the validator if the parent is signed, and result in 900 seconds bogus.
The dnssec-lameness detection is used to detect operator failures,
before the validator will properly verify the messages.
Also for zones for which no chain of trust exists, but a DS is given by the
parent, dnssec-lameness detection enables. This delivers dnssec to our
clients when possible (for client validators).
The following issue needs to be resolved:
a server that serves both a parent and child zone, where
parent is signed, but child is not. The server must not be marked
lame for the parent zone, because the child answer is not signed.
Instead of a false positive, we want false negatives; failure to
detect dnssec-lameness is less of a problem than marking honest
servers lame. dnssec-lameness is a config error and deserves the trouble.
So, only messages that identify the zone are used to mark the zone
lame. The zone is identified by SOA or NS RRsets in the answer/auth.
That includes almost all negative responses and also A, AAAA qtypes.
That would be most responses from servers.
For referrals, delegations that add a single label can be checked to be
from their zone, this covers most delegation-centric zones.
So possibly, for complicated setups, with multiple (parent-child) zones
on a server, dnssec-lameness detection does not work - no dnssec-lameness
is detected. Instead the zone that is dnssec-lame becomes bogus.
o authority features.
This is a recursive server, and authority features are out of scope.
However, some authority features are expected in a recursor. Things like
localhost, reverse lookup for 127.0.0.1, or blocking AS112 traffic.
Also redirection of domain names with fixed data is needed by service
providers. Limited support is added specifically to address this.
Adding full authority support, requires much more code, and more complex
maintenance.
The limited support allows adding some static data (for localhost and so),
and to respond with a fixed rcode (NXDOMAIN) for domains (such as AS112).
You can put authority data on a separate server, and set the server in
unbound.conf as stub for those zones, this allows clients to access data
from the server without making unbound authoritative for the zones.
o the access control denies queries before any other processing.
This denies queries that are not authoritative, or version.bind, or any.
And thus prevents cache-snooping (denied hosts cannot make non-recursive
queries and get answers from the cache).
o If a client makes a query without RD bit, in the case of a returned
message from cache which is:
answer section: empty
auth section: NS record present, no SOA record, no DS record,
maybe NSEC or NSEC3 records present.
additional: A records or other relevant records.
A SOA record would indicate that this was a NODATA answer.
A DS records would indicate a referral.
Absence of NS record would indicate a NODATA answer as well.
Then the receiver does not know whether this was a referral
with attempt at no-DS proof) or a nodata answer with attempt
at no-data proof. It could be determined by attempting to prove
either condition; and looking if only one is valid, but both
proofs could be valid, or neither could be valid, which creates
doubt. This case is validated by unbound as a 'referral' which
ascertains that RRSIGs are OK (and not omitted), but does not
check NSEC/NSEC3.
o Case preservation
Unbound preserves the casing received from authority servers as best
as possible. It compresses without case, so case can get lost there.
The casing from the query name is used in preference to the casing
of the authority server. This is the same as BIND. RFC4343 allows either
behaviour.
o Denial of service protection
If many queries are made, and they are made to names for which the
authority servers do not respond, then the requestlist for unbound
fills up fast. This results in denial of service for new queries.
To combat this the first 50% of the requestlist can run to completion.
The last 50% of the requestlist get (200 msec) at least and are replaced
by newer queries when older (LIFO).
When a new query comes in, and a place in the first 50% is available, this
is preferred. Otherwise, it can replace older queries out of the last 50%.
Thus, even long queries get a 50% chance to be resolved. And many 'short'
one or two round-trip resolves can be done in the last 50% of the list.
The timeout can be configured.
o EDNS fallback. Is done according to the EDNS RFC (and update draft-00).
Unbound assumes EDNS 0 support for the first query. Then it can detect
support (if the servers replies) or non-support (on a NOTIMPL or FORMERR).
Some middleboxes drop EDNS 0 queries, mainly when forwarding, not when
routing packets. To detect this, when timeouts keep happening, as the
timeout approached 5-10 seconds, and EDNS status has not been detected yet,
a single probe query is sent. This probe has a sub-second timeout, and
if the server responds (quickly) without EDNS, this is cached for 15 min.
This works very well when detecting an address that you use much - like
a forwarder address - which is where the middleboxes need to be detected.
Otherwise, it results in a 5 second wait time before EDNS timeout is
detected, which is slow but it works at least.
It minimizes the chances of a dropped query making a (DNSSEC) EDNS server
falsely EDNS-nonsupporting, and thus DNSSEC-bogus, works well with
middleboxes, and can detect the occasional authority that drops EDNS.
For some boxes it is necessary to probe for every failing query, a
reassurance that the DNS server does EDNS does not mean that path can
take large DNS answers.
o 0x20 backoff.
The draft describes to back off to the next server, and go through all
servers several times. Unbound goes on get the full list of nameserver
addresses, and then makes 3 * number of addresses queries.
They are sent to a random server, but no one address more than 4 times.
It succeeds if one has 0x20 intact, or else all are equal.
Otherwise, servfail is returned to the client.
o NXDOMAIN and SOA serial numbers.
Unbound keeps TTL values for message formats, and thus rcodes, such
as NXDOMAIN. Also it keeps the latest rrsets in the rrset cache.
So it will faithfully negative cache for the exact TTL as originally
specified for an NXDOMAIN message, but send a newer SOA record if
this has been found in the mean time. In point, this could lead to a
negative cached NXDOMAIN reply with a SOA RR where the serial number
indicates a zone version where this domain is not any longer NXDOMAIN.
These situations become consistent once the original TTL expires.
If the domain is DNSSEC signed, by the way, then NSEC records are
updated more carefully. If one of the NSEC records in an NXDOMAIN is
updated from another query, the NXDOMAIN is dropped from the cache,
and queried for again, so that its proof can be checked again.
+49
View File
@@ -0,0 +1,49 @@
.TH "unbound-checkconf" "8" "@date@" "NLnet Labs" "unbound @version@"
.\"
.\" unbound-checkconf.8 -- unbound configuration checker manual
.\"
.\" Copyright (c) 2007, NLnet Labs. All rights reserved.
.\"
.\" See LICENSE for the license.
.\"
.\"
.SH "NAME"
.LP
unbound\-checkconf
\- Check unbound configuration file for errors.
.SH "SYNOPSIS"
.B unbound\-checkconf
.RB [ \-h ]
.RB [ \-o
.IR option ]
.RI [ cfgfile ]
.SH "DESCRIPTION"
.B Unbound\-checkconf
checks the configuration file for the
\fIunbound\fR(8)
DNS resolver for syntax and other errors.
The config file syntax is described in
\fIunbound.conf\fR(5).
.P
The available options are:
.TP
.B \-h
Show the version and commandline option help.
.TP
.B \-o\fI option
If given, after checking the config file the value of this option is
printed to stdout. For "" (disabled) options an empty line is printed.
.TP
.I cfgfile
The config file to read with settings for unbound. It is checked.
If omitted, the config file at the default location is checked.
.SH "EXIT CODE"
The unbound\-checkconf program exits with status code 1 on error,
0 for a correct config file.
.SH "FILES"
.TP
.I @ub_conf_file@
unbound configuration file.
.SH "SEE ALSO"
\fIunbound.conf\fR(5),
\fIunbound\fR(8).
+364
View File
@@ -0,0 +1,364 @@
.TH "unbound-control" "8" "@date@" "NLnet Labs" "unbound @version@"
.\"
.\" unbound-control.8 -- unbound remote control manual
.\"
.\" Copyright (c) 2008, NLnet Labs. All rights reserved.
.\"
.\" See LICENSE for the license.
.\"
.\"
.SH "NAME"
.LP
.B unbound\-control,
.B unbound\-control\-setup
\- Unbound remote server control utility.
.SH "SYNOPSIS"
.B unbound\-control
.RB [ \-h ]
.RB [ \-c
.IR cfgfile ]
.RB [ \-s
.IR server ]
.IR command
.SH "DESCRIPTION"
.B Unbound\-control
performs remote administration on the \fIunbound\fR(8) DNS server.
It reads the configuration file, contacts the unbound server over SSL
sends the command and displays the result.
.P
The available options are:
.TP
.B \-h
Show the version and commandline option help.
.TP
.B \-c \fIcfgfile
The config file to read with settings. If not given the default
config file @ub_conf_file@ is used.
.TP
.B \-s \fIserver[@port]
IPv4 or IPv6 address of the server to contact. If not given, the
address is read from the config file.
.SH "COMMANDS"
There are several commands that the server understands.
.TP
.B start
Start the server. Simply execs \fIunbound\fR(8). The unbound executable
is searched for in the \fBPATH\fR set in the environment. It is started
with the config file specified using \fI\-c\fR or the default config file.
.TP
.B stop
Stop the server. The server daemon exits.
.TP
.B reload
Reload the server. This flushes the cache and reads the config file fresh.
.TP
.B verbosity \fInumber
Change verbosity value for logging. Same values as \fBverbosity\fR keyword in
\fIunbound.conf\fR(5). This new setting lasts until the server is issued
a reload (taken from config file again), or the next verbosity control command.
.TP
.B stats
Print statistics. Resets the internal counters to zero, this can be
controlled using the \fBstatistics\-cumulative\fR config statement.
Statistics are printed with one [name]: [value] per line.
.TP
.B stats_noreset
Peek at statistics. Prints them like the \fBstats\fR command does, but does not
reset the internal counters to zero.
.TP
.B status
Display server status. Exit code 3 if not running (the connection to the
port is refused), 1 on error, 0 if running.
.TP
.B local_zone \fIname\fR \fItype
Add new local zone with name and type. Like \fBlocal\-zone\fR config statement.
If the zone already exists, the type is changed to the given argument.
.TP
.B local_zone_remove \fIname
Remove the local zone with the given name. Removes all local data inside
it. If the zone does not exist, the command succeeds.
.TP
.B local_data \fIRR data...
Add new local data, the given resource record. Like \fBlocal\-data\fR
config statement, except for when no covering zone exists. In that case
this remote control command creates a transparent zone with the same
name as this record. This command is not good at returning detailed syntax
errors.
.TP
.B local_data_remove \fIname
Remove all RR data from local name. If the name already has no items,
nothing happens. Often results in NXDOMAIN for the name (in a static zone),
but if the name has become an empty nonterminal (there is still data in
domain names below the removed name), NOERROR nodata answers are the
result for that name.
.TP
.B dump_cache
The contents of the cache is printed in a text format to stdout. You can
redirect it to a file to store the cache in a file.
.TP
.B load_cache
The contents of the cache is loaded from stdin. Uses the same format as
dump_cache uses. Loading the cache with old, or wrong data can result
in old or wrong data returned to clients. Loading data into the cache
in this way is supported in order to aid with debugging.
.TP
.B lookup \fIname
Print to stdout the name servers that would be used to look up the
name specified.
.TP
.B flush \fIname
Remove the name from the cache. Removes the types
A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV and NAPTR.
Because that is fast to do. Other record types can be removed using
.B flush_type
or
.B flush_zone\fR.
.TP
.B flush_type \fIname\fR \fItype
Remove the name, type information from the cache.
.TP
.B flush_zone \fIname
Remove all information at or below the name from the cache.
The rrsets and key entries are removed so that new lookups will be performed.
This needs to walk and inspect the entire cache, and is a slow operation.
.TP
.B flush_stats
Reset statistics to zero.
.TP
.B flush_requestlist
Drop the queries that are worked on. Stops working on the queries that the
server is working on now. The cache is unaffected. No reply is sent for
those queries, probably making those users request again later.
Useful to make the server restart working on queries with new settings,
such as a higher verbosity level.
.TP
.B dump_requestlist
Show what is worked on. Prints all queries that the server is currently
working on. Prints the time that users have been waiting. For internal
requests, no time is printed. And then prints out the module status.
.TP
.B forward [off | addr ... ]
Setup forwarding mode. Configures if the server should ask other upstream
nameservers, should go to the internet root nameservers itself, or show
the current config. You could pass the nameservers after a DHCP update.
.IP
Without arguments the current list of addresses used to forward all queries
to is printed. On startup this is from the forward\-zone "." configuration.
Afterwards it shows the status. It prints off when no forwarding is used.
.IP
If \fIoff\fR is passed, forwarding is disabled and the root nameservers
are used. This can be used to avoid to avoid buggy or non\-DNSSEC supporting
nameservers returned from DHCP. But may not work in hotels or hotspots.
.IP
If one or more IPv4 or IPv6 addresses are given, those are then used to forward
queries to. The addresses must be separated with spaces. With '@port' the
port number can be set explicitly (default port is 53 (DNS)).
.IP
By default the forwarder information from the config file for the root "." is
used. The config file is not changed, so after a reload these changes are
gone. Other forward zones from the config file are not affected by this command.
.SH "EXIT CODE"
The unbound\-control program exits with status code 1 on error, 0 on success.
.SH "SET UP"
The setup requires a self\-signed certificate and private keys for both
the server and client. The script \fIunbound\-control\-setup\fR generates
these in the default run directory, or with \-d in another directory.
Run the script under the same username as you have configured in unbound.conf
so that the daemon is permitted to read the files, for example with:
.nf
sudo \-u unbound unbound\-control\-setup
.fi
If you have not configured
a username in unbound.conf, the keys need read permission for the user
credentials under which the daemon is started.
The script preserves private keys present in the directory.
After running the script as root, turn on \fBcontrol\-enable\fR in
\fIunbound.conf\fR.
.SH "STATISTIC COUNTERS"
The \fIstats\fR command shows a number of statistic counters.
.TP
.I threadX.num.queries
number of queries received by thread
.TP
.I threadX.num.cachehits
number of queries that were successfully answered using a cache lookup
.TP
.I threadX.num.cachemiss
number of queries that needed recursive processing
.TP
.I threadX.num.recursivereplies
The number of replies sent to queries that needed recursive processing. Could be smaller than threadX.num.cachemiss if due to timeouts no replies were sent for some queries.
.TP
.I threadX.requestlist.avg
The average number of requests in the internal recursive processing request list on insert of a new incoming recursive processing query.
.TP
.I threadX.requestlist.max
Maximum size attained by the internal recursive processing request list.
.TP
.I threadX.requestlist.overwritten
Number of requests in the request list that were overwritten by newer entries. This happens if there is a flood of queries that recursive processing and the server has a hard time.
.TP
.I threadX.requestlist.exceeded
Queries that were dropped because the request list was full. This happens if a flood of queries need recursive processing, and the server can not keep up.
.TP
.I threadX.requestlist.current.all
Current size of the request list, includes internally generated queries (such
as priming queries and glue lookups).
.TP
.I threadX.requestlist.current.user
Current size of the request list, only the requests from client queries.
.TP
.I threadX.recursion.time.avg
Average time it took to answer queries that needed recursive processing. Note that queries that were answered from the cache are not in this average.
.TP
.I threadX.recursion.time.median
The median of the time it took to answer queries that needed recursive
processing. The median means that 50% of the user queries were answered in
less than this time. Because of big outliers (usually queries to non
responsive servers), the average can be bigger than the median. This median
has been calculated by interpolation from a histogram.
.TP
.I total.num.queries
summed over threads.
.TP
.I total.num.cachehits
summed over threads.
.TP
.I total.num.cachemiss
summed over threads.
.TP
.I total.num.recursivereplies
summed over threads.
.TP
.I total.requestlist.avg
averaged over threads.
.TP
.I total.requestlist.max
the maximum of the thread requestlist.max values.
.TP
.I total.requestlist.overwritten
summed over threads.
.TP
.I total.requestlist.exceeded
summed over threads.
.TP
.I total.requestlist.current.all
summed over threads.
.TP
.I total.recursion.time.median
averaged over threads.
.TP
.I time.now
current time in seconds since 1970.
.TP
.I time.up
uptime since server boot in seconds.
.TP
.I time.elapsed
time since last statistics printout, in seconds.
.SH EXTENDED STATISTICS
.TP
.I mem.total.sbrk
If sbrk(2) is available, an estimate of the heap size of the program in number of bytes. Close to the total memory used by the program, as reported by top and ps. Could be wrong if the OS allocates memory non\-contiguously.
.TP
.I mem.cache.rrset
Memory in bytes in use by the RRset cache.
.TP
.I mem.cache.message
Memory in bytes in use by the message cache.
.TP
.I mem.mod.iterator
Memory in bytes in use by the iterator module.
.TP
.I mem.mod.validator
Memory in bytes in use by the validator module. Includes the key cache and
negative cache.
.TP
.I histogram.<sec>.<usec>.to.<sec>.<usec>
Shows a histogram, summed over all threads. Every element counts the
recursive queries whose reply time fit between the lower and upper bound.
Times larger or equal to the lowerbound, and smaller than the upper bound.
There are 40 buckets, with bucket sizes doubling.
.TP
.I num.query.type.A
The total number of queries over all threads with query type A.
Printed for the other query types as well, but only for the types for which
queries were received, thus =0 entries are omitted for brevity.
.TP
.I num.query.type.other
Number of queries with query types 256\-65535.
.TP
.I num.query.class.IN
The total number of queries over all threads with query class IN (internet).
Also printed for other classes (such as CH (CHAOS) sometimes used for
debugging), or NONE, ANY, used by dynamic update.
num.query.class.other is printed for classes 256\-65535.
.TP
.I num.query.opcode.QUERY
The total number of queries over all threads with query opcode QUERY.
Also printed for other opcodes, UPDATE, ...
.TP
.I num.query.tcp
Number of queries that were made using TCP towards the unbound server.
.TP
.I num.query.ipv6
Number of queries that were made using IPv6 towards the unbound server.
.TP
.I num.query.flags.RD
The number of queries that had the RD flag set in the header.
Also printed for flags QR, AA, TC, RA, Z, AD, CD.
Note that queries with flags QR, AA or TC may have been rejected
because of that.
.TP
.I num.query.edns.present
number of queries that had an EDNS OPT record present.
.TP
.I num.query.edns.DO
number of queries that had an EDNS OPT record with the DO (DNSSEC OK) bit set.
These queries are also included in the num.query.edns.present number.
.TP
.I num.answer.rcode.NXDOMAIN
The number of answers to queries, from cache or from recursion, that had the
return code NXDOMAIN. Also printed for the other return codes.
.TP
.I num.answer.rcode.nodata
The number of answers to queries that had the pseudo return code nodata.
This means the actual return code was NOERROR, but additionally, no data was
carried in the answer (making what is called a NOERROR/NODATA answer).
These queries are also included in the num.answer.rcode.NOERROR number.
Common for AAAA lookups when an A record exists, and no AAAA.
.TP
.I num.answer.secure
Number of answers that were secure. The answer validated correctly.
The AD bit might have been set in some of these answers, where the client
signalled (with DO or AD bit in the query) that they were ready to accept
the AD bit in the answer.
.TP
.I num.answer.bogus
Number of answers that were bogus. These answers resulted in SERVFAIL
to the client because the answer failed validation.
.TP
.I num.rrset.bogus
The number of rrsets marked bogus by the validator. Increased for every
RRset inspection that fails.
.TP
.I unwanted.queries
Number of queries that were refused or dropped because they failed the
access control settings.
.TP
.I unwanted.replies
Replies that were unwanted or unsolicited. Could have been random traffic,
delayed duplicates, very late answers, or could be spoofing attempts.
Some low level of late answers and delayed duplicates are to be expected
with the UDP protocol. Very high values could indicate a threat (spoofing).
.SH "FILES"
.TP
.I @ub_conf_file@
unbound configuration file.
.TP
.I @UNBOUND_RUN_DIR@
directory with private keys (unbound_server.key and unbound_control.key) and
self\-signed certificates (unbound_server.pem and unbound_control.pem).
.SH "SEE ALSO"
\fIunbound.conf\fR(5),
\fIunbound\fR(8).
+116
View File
@@ -0,0 +1,116 @@
.TH "unbound\-host" "1" "@date@" "NLnet Labs" "unbound @version@"
.\"
.\" unbound-host.1 -- unbound DNS lookup utility
.\"
.\" Copyright (c) 2007, NLnet Labs. All rights reserved.
.\"
.\" See LICENSE for the license.
.\"
.\"
.SH "NAME"
.LP
.B unbound\-host
\- unbound DNS lookup utility
.SH "SYNOPSIS"
.LP
.B unbound\-host
.RB [ \-vdhr46 ]
.RB [ \-c
.IR class ]
.RB [ \-t
.IR type ]
.I hostname
.RB [ \-y
.IR key ]
.RB [ \-f
.IR keyfile ]
.RB [ \-F
.IR namedkeyfile ]
.RB [ \-C
.IR configfile ]
.SH "DESCRIPTION"
.LP
.B Unbound\-host
uses the unbound validating resolver to query for the hostname and display
results. With the \fB\-v\fR option it displays validation
status: secure, insecure, bogus (security failure).
.P
By default it reads no configuration file whatsoever. It attempts to reach
the internet root servers. With \fB\-C\fR an unbound config file and with
\fB\-r\fR resolv.conf can be read.
.P
The available options are:
.TP
.I hostname
This name is resolved (looked up in the DNS).
If a IPv4 or IPv6 address is given, a reverse lookup is performed.
.TP
.B \-h
Show the version and commandline option help.
.TP
.B \-v
Enable verbose output and it shows validation results, on every line.
Secure means that the NXDOMAIN (no such domain name), nodata (no such data)
or positive data response validated correctly with one of the keys.
Insecure means that that domain name has no security set up for it.
Bogus (security failure) means that the response failed one or more checks,
it is likely wrong, outdated, tampered with, or broken.
.TP
.B \-d
Enable debug output to stderr. One \-d shows what the resolver and validator
are doing and may tell you what is going on. More times, \-d \-d, gives a
lot of output, with every packet sent and received.
.TP
.B \-c \fIclass
Specify the class to lookup for, the default is IN the internet class.
.TP
.B \-t \fItype
Specify the type of data to lookup. The default looks for IPv4, IPv6 and
mail handler data, or domain name pointers for reverse queries.
.TP
.B \-y \fIkey
Specify a public key to use as trust anchor. This is the base for a chain
of trust that is built up from the trust anchor to the response, in order
to validate the response message. Can be given as a DS or DNSKEY record.
For example \-y "example.com DS 31560 5 1 1CFED84787E6E19CCF9372C1187325972FE546CD".
.TP
.B \-f \fIkeyfile
Reads keys from a file. Every line has a DS or DNSKEY record, in the format
as for \-y. The zone file format, the same as dig and drill produce.
.TP
.B \-F \fInamedkeyfile
Reads keys from a BIND\-style named.conf file. Only the trusted\-key {}; entries
are read.
.TP
.B \-C \fIconfigfile
Uses the specified unbound.conf to prime
.IR libunbound (3).
.TP
.B \-r
Read /etc/resolv.conf, and use the forward DNS servers from there (those could
have been set by DHCP). More info in
.IR resolv.conf (5).
Breaks validation if those servers do not support DNSSEC.
.TP
.B \-4
Use solely the IPv4 network for sending packets.
.TP
.B \-6
Use solely the IPv6 network for sending packets.
.SH "EXAMPLES"
.LP
Some examples of use. The keys shown below are fakes, thus a security failure
is encountered.
.P
$ unbound\-host www.example.com
.P
$ unbound\-host \-v \-y "example.com DS 31560 5 1 1CFED84787E6E19CCF9372C1187325972FE546CD" www.example.com
.P
$ unbound\-host \-v \-y "example.com DS 31560 5 1 1CFED84787E6E19CCF9372C1187325972FE546CD" 192.0.2.153
.SH "EXIT CODE"
The unbound\-host program exits with status code 1 on error,
0 on no error. The data may not be available on exit code 0, exit code 1
means the lookup encountered a fatal error.
.SH "SEE ALSO"
\fIunbound.conf\fR(5),
\fIunbound\fR(8).
-78
View File
@@ -1,78 +0,0 @@
.ig
unbound.8 -- unbound manual
Copyright (c) 2007, NLnet Labs. All rights reserved.
This software is open source.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of the NLNET LABS nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
..
.Dd @date@
.Dt unbound 8
.Sh NAME
unbound
.Nd Unbound DNS validating resolver @version@.
.Sh SYNOPSIS
.Nm unbound
.Op Fl h
.Op Fl d
.Op Fl v
.Op Fl c Ar cfgfile
.Sh DESCRIPTION
.Ic Unbound
is an implementation of a DNS resolver, that does caching and
DNSSEC validation.
.Pp
The available options are:
.Bl -tag -width indent
.It Fl h
Show the version and commandline option help.
.It Fl c Ar cfgfile
Set the config file to read with settings for unbound. The syntax is
described in
.Xr unbound.conf 5 .
.It Fl d
Debug flag, do not fork into the background, but stay attached to the
console.
.It Fl v
Increase verbosity. If given multiple times, more information is logged.
This is in addition to the verbosity (if any) from the config file.
.El
.Sh SEE ALSO
.Xr unbound.conf 5 .
.Sh AUTHORS
.Ic Unbound
developers are mentioned in the CREDITS file in the distribution.
+51
View File
@@ -0,0 +1,51 @@
.TH "unbound" "8" "@date@" "NLnet Labs" "unbound @version@"
.\"
.\" unbound.8 -- unbound manual
.\"
.\" Copyright (c) 2007, NLnet Labs. All rights reserved.
.\"
.\" See LICENSE for the license.
.\"
.\"
.SH "NAME"
.LP
.B unbound
\- Unbound DNS validating resolver @version@.
.SH "SYNOPSIS"
.LP
.B unbound
.RB [ \-h ]
.RB [ \-d ]
.RB [ \-v ]
.RB [ \-c
.IR cfgfile ]
.SH "DESCRIPTION"
.LP
.B Unbound
is an implementation of a DNS resolver, that does caching and
DNSSEC validation.
.P
The available options are:
.TP
.B \-h
Show the version and commandline option help.
.TP
.B \-c\fI cfgfile
Set the config file with settings for unbound to read instead of reading the
file at the default location, @ub_conf_file@. The syntax is
described in \fIunbound.conf\fR(5).
.TP
.B \-d
Debug flag, do not fork into the background, but stay attached to the
console. This flag will also delay writing to the logfile until the
thread\-spawn time. So that most config and setup errors appear on stderr.
.TP
.B \-v
Increase verbosity. If given multiple times, more information is logged.
This is in addition to the verbosity (if any) from the config file.
.SH "SEE ALSO"
\fIunbound.conf\fR(5),
\fIunbound\-checkconf\fR(8).
.SH "AUTHORS"
.B Unbound
developers are mentioned in the CREDITS file in the distribution.
-117
View File
@@ -1,117 +0,0 @@
.\"
.\" unbound.conf.5 -- unbound.conf manual
.\"
.\" Copyright (c) 2007, NLnet Labs. All rights reserved.
.\"
.\" See LICENSE for the license.
.\"
.\"
.Dd @date@
.Os FreeBSD
.Dt unbound.conf 5
.Sh NAME
.Nm unbound.conf
.Nd Unbound configuration file.
.Sh SYNOPSIS
.Nm unbound.conf
.Sh DESCRIPTION
.Ic unbound.conf
is used to configure
.Xr unbound 8 .
The file format has attributes and values. Some attributes have attributes inside them.
The notation is: attribute: value.
Comments start with # and last to the end of line. Empty lines are
ignored as is whitespace at the beginning of a line.
.El
.Sh FILE FORMAT
There must be whitespace between keywords. Attribute keywords end with a colon ':'. An attribute
is followed by its containing attributes, or a value.
.Pp
Files can be included using the
.Ic include:
directive. It can appear anywhere, and takes a single filename as an argument.
Processing continues as if the text from the included file was copied into
the config file at that point.
.Ss Server Options
There may only be one
.Ic server:
clause.
.Bl -tag -width indent
.It \fBverbosity:\fR <number>
The verbosity number, level 0 means no verbosity, only errors. Level 1
gives operational information. Level 2 gives query level information,
output per query. Level 3 gives algorithm level information.
Default is level 1. The verbosity can also be increased from the commandline,
see
.Xr unbound 8 .
.It \fBnum-threads:\fR <number>
The number of threads to create to serve clients. Use 1 for no threading.
.It \fBport:\fR <port number>
The port number, default 53, on which the server responds to queries.
.It \fBinterface:\fR <ip address>
Interface to use to connect to the network. Can be given multiple times to
work on several interfaces. If none are given the default (all) is used.
.It \fBoutgoing-port:\fR <port number>
The starting port number where the outgoing query port range is allocated.
Default is 1053.
.It \fBoutgoing-range:\fR <number>
Number of ports to open. This number is opened per thread for every outgoing
query interface. Must be at least 1. Default is 16.
Larger numbers give more protection against spoofing attempts, but need
extra resources from the operating system.
.It \fBmsg-cache-size:\fR <number>
Number of bytes size of the message cache. Default is 4 megabytes.
.It \fBmsg-cache-slabs:\fR <number>
Number of slabs in the message cache. Slabs reduce lock contention by threads.
Must be set to a power of 2. Setting (close) to the number of cpus is a
reasonable guess.
.It \fBnum-queries-per-thread:\fR <number>
The number of queries that every thread will service simultaneously.
.It \fBdo-ip4:\fR <yes or no>
Enable or disable whether ip4 queries are answered. Default is yes.
.It \fBdo-ip6:\fR <yes or no>
Enable or disable whether ip6 queries are answered. Default is yes.
.It \fBdo-udp:\fR <yes or no>
Enable or disable whether UDP queries are answered. Default is yes.
.It \fBdo-tcp:\fR <yes or no>
Enable or disable whether TCP queries are answered. Default is yes.
.It \fBforward-to:\fR <ip address>
If set (not "") then forwarder mode is enabled. Default is "" (disabled).
The ip address is used to forward all DNS queries to.
.It \fBforward-to-port:\fR <port number>
The port on which the remote server is running that answers forwarded queries.
Default is 53.
.It \fBchroot:\fR <directory>
If given a chroot is done to the given directory. The default is none ("").
.It \fBusername:\fR <name>
If given, after binding the port the user privileges are dropped. Default is
not to change user, username: "". If this user is not capable of binding the
port, reloads (by signal HUP) will still retain the opened ports.
If you change the port number in the config file, and that new port number
requires privileges, then a restart is needed.
.It \fBdirectory:\fR <directory>
Sets the working directory for the program.
.It \fBlogfile:\fR <filename>
If "" is given, logging goes to stderr, or nowhere once daemonized.
The logfile is appended to, in the following format:
[seconds since 1970] unbound[pid:tid]: type: message.
.It \fBpidfile:\fR <filename>
The process id is written to the file. Default is "unbound.pid". So,
kill -HUP `cat /etc/unbound/unbound.pid` will trigger a reload,
kill -QUIT `cat /etc/unbound/unbound.pid` will gracefully terminate.
.Sh FILES
.Bl -tag -width indent
.It Pa unbound.conf
unbound configuration file.
.El
.Sh SEE ALSO
.Xr unbound 8
.Sh AUTHORS
.Ic Unbound
was written by NLnet Labs. Please see CREDITS file
in the distribution for further details.
+982
View File
@@ -0,0 +1,982 @@
.TH "unbound.conf" "5" "@date@" "NLnet Labs" "unbound @version@"
.\"
.\" unbound.conf.5 -- unbound.conf manual
.\"
.\" Copyright (c) 2007, NLnet Labs. All rights reserved.
.\"
.\" See LICENSE for the license.
.\"
.\"
.SH "NAME"
.LP
.B unbound.conf
\- Unbound configuration file.
.SH "SYNOPSIS"
.LP
.B unbound.conf
.SH "DESCRIPTION"
.LP
.B unbound.conf
is used to configure
\fIunbound\fR(8).
The file format has attributes and values. Some attributes have attributes inside them.
The notation is: attribute: value.
.P
Comments start with # and last to the end of line. Empty lines are
ignored as is whitespace at the beginning of a line.
.P
The utility
\fIunbound\-checkconf\fR(8)
can be used to check unbound.conf prior to usage.
.SH "EXAMPLE"
An example config file is shown below. Copy this to /etc/unbound/unbound.conf
and start the server with:
.P
.nf
$ unbound \-c /etc/unbound/unbound.conf
.fi
.P
Most settings are the defaults. Stop the server with:
.P
.nf
$ kill `cat /etc/unbound/unbound.pid`
.fi
.P
Below is a minimal config file. The source distribution contains an extensive
example.conf file with all the options.
.P
.nf
# unbound.conf(5) config file for unbound(8).
server:
directory: "/etc/unbound"
username: unbound
# make sure unbound can access entropy from inside the chroot.
# e.g. on linux the use these commands (on BSD, devfs(8) is used):
# mount \-\-bind \-n /dev/random /etc/unbound/dev/random
# and mount \-\-bind \-n /dev/log /etc/unbound/dev/log
chroot: "/etc/unbound"
# logfile: "/etc/unbound/unbound.log" #uncomment to use logfile.
pidfile: "/etc/unbound/unbound.pid"
# verbosity: 1 # uncomment and increase to get more logging.
# listen on all interfaces, answer queries from the local subnet.
interface: 0.0.0.0
interface: ::0
access\-control: 10.0.0.0/8 allow
access\-control: 2001:DB8::/64 allow
.fi
.SH "FILE FORMAT"
.LP
There must be whitespace between keywords. Attribute keywords end with a colon ':'. An attribute
is followed by its containing attributes, or a value.
.P
Files can be included using the
.B include:
directive. It can appear anywhere, and takes a single filename as an argument.
Processing continues as if the text from the included file was copied into
the config file at that point. If also using chroot, using full path names
for the included files works, relative pathnames for the included names work
if the directory where the daemon is started equals its chroot/working
directory.
.SS "Server Options"
These options are part of the
.B server:
clause.
.TP
.B verbosity: \fI<number>
The verbosity number, level 0 means no verbosity, only errors. Level 1
gives operational information. Level 2 gives detailed operational
information. Level 3 gives query level information, output per query.
Level 4 gives algorithm level information. Level 5 logs client
identification for cache misses. Default is level 1.
The verbosity can also be increased from the commandline, see \fIunbound\fR(8).
.TP
.B statistics\-interval: \fI<seconds>
The number of seconds between printing statistics to the log for every thread.
Disable with value 0 or "". Default is disabled.
.TP
.B statistics\-cumulative: \fI<yes or no>
If enabled, statistics are cumulative since starting unbound, without clearing
the statistics counters after logging the statistics. Default is no.
.TP
.B extended\-statistics: \fI<yes or no>
If enabled, extended statistics are printed from \fIunbound\-control\fR(8).
Default is off, because keeping track of more statistics takes time.
.TP
.B num\-threads: \fI<number>
The number of threads to create to serve clients. Use 1 for no threading.
.TP
.B port: \fI<port number>
The port number, default 53, on which the server responds to queries.
.TP
.B interface: \fI<ip address>
Interface to use to connect to the network. This interface is listened to
for queries from clients, and answers to clients are given from it.
Can be given multiple times to work on several interfaces. If none are
given the default is to listen to localhost.
The interfaces are not changed on a reload (kill \-HUP) but only on restart.
.TP
.B interface\-automatic: \fI<yes or no>
Detect source interface on UDP queries and copy them to replies. This
feature is experimental, and needs support in your OS for IPv6
(and its socket options) and IPv4 (and have source\-interface socket options).
Default value is no.
.TP
.B outgoing\-interface: \fI<ip address>
Interface to use to connect to the network. This interface is used to send
queries to authoritative servers and receive their replies. Can be given
multiple times to work on several interfaces. If none are given the
default (all) is used. You can specify the same interfaces in
.B interface:
and
.B outgoing\-interface:
lines, the interfaces are then used for both purposes. Outgoing queries are
sent via a random outgoing interface to counter spoofing.
.TP
.B outgoing\-range: \fI<number>
Number of ports to open. This number of file descriptors can be opened per
thread. Must be at least 1. Default is 256. Larger numbers need extra
resources from the operating system.
.TP
.B outgoing\-port\-permit: \fI<port number or range>
Permit unbound to open this port or range of ports for use to send queries.
A larger number of permitted outgoing ports increases resilience against
spoofing attempts. Make sure these ports are not needed by other daemons.
By default only ports above 1024 that have not been assigned by IANA are used.
Give a port number or a range of the form "low\-high", without spaces.
.IP
The \fBoutgoing\-port\-permit\fR and \fBoutgoing\-port\-avoid\fR statements
are processed in the line order of the config file, adding the permitted ports
and subtracting the avoided ports from the set of allowed ports. The
processing starts with the non IANA allocated ports above 1024 in the set
of allowed ports.
.TP
.B outgoing\-port\-avoid: \fI<port number or range>
Do not permit unbound to open this port or range of ports for use to send
queries. Use this to make sure unbound does not grab a port that another
daemon needs. The port is avoided on all outgoing interfaces, both IP4 and IP6.
By default only ports above 1024 that have not been assigned by IANA are used.
Give a port number or a range of the form "low\-high", without spaces.
.TP
.B outgoing\-num\-tcp: \fI<number>
Number of outgoing TCP buffers to allocate per thread. Default is 10. If set
to 0, or if do_tcp is "no", no TCP queries to authoritative servers are done.
.TP
.B incoming\-num\-tcp: \fI<number>
Number of incoming TCP buffers to allocate per thread. Default is 10. If set
to 0, or if do_tcp is "no", no TCP queries from clients are accepted.
.TP
.B edns\-buffer\-size: \fI<number>
Number of bytes size to advertise as the EDNS reassembly buffer size.
This is the value put into datagrams over UDP towards peers. The actual
buffer size is determined by msg\-buffer\-size (both for TCP and UDP). Do
not set lower than that value. Default is 4096 which is RFC recommended.
If you have fragmentation reassembly problems, usually seen as timeouts,
then a value of 1480 can fix it. Setting to 512 bypasses even the most
stringent path MTU problems, but is seen as extreme, since the amount
of TCP fallback generated is excessive (probably also for this resolver,
consider tuning the outgoing tcp number).
.TP
.B msg\-buffer\-size: \fI<number>
Number of bytes size of the message buffers. Default is 65552 bytes, enough
for 64 Kb packets, the maximum DNS message size. No message larger than this
can be sent or received. Can be reduced to use less memory, but some requests
for DNS data, such as for huge resource records, will result in a SERVFAIL
reply to the client.
.TP
.B msg\-cache\-size: \fI<number>
Number of bytes size of the message cache. Default is 4 megabytes.
A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes
or gigabytes (1024*1024 bytes in a megabyte).
.TP
.B msg\-cache\-slabs: \fI<number>
Number of slabs in the message cache. Slabs reduce lock contention by threads.
Must be set to a power of 2. Setting (close) to the number of cpus is a
reasonable guess.
.TP
.B num\-queries\-per\-thread: \fI<number>
The number of queries that every thread will service simultaneously.
If more queries arrive that need servicing, and no queries can be jostled out
(see \fIjostle\-timeout\fR), then the queries are dropped. This forces
the client to resend after a timeout; allowing the server time to work on
the existing queries. Default 1024.
.TP
.B jostle\-timeout: \fI<msec>
Timeout used when the server is very busy. Set to a value that usually
results in one roundtrip to the authority servers. If too many queries
arrive, then 50% of the queries are allowed to run to completion, and
the other 50% are replaced with the new incoming query if they have already
spent more than their allowed time. This protects against denial of
service by slow queries or high query rates. Default 200 milliseconds.
.TP
.B so\-rcvbuf: \fI<number>
If not 0, then set the SO_RCVBUF socket option to get more buffer
space on UDP port 53 incoming queries. So that short spikes on busy
servers do not drop packets (see counter in netstat \-su). Default is
0 (use system value). Otherwise, the number of bytes to ask for, try
"4m" on a busy server. The OS caps it at a maximum, on linux unbound
needs root permission to bypass the limit, or the admin can use sysctl
net.core.rmem_max. On BSD change kern.ipc.maxsockbuf in /etc/sysctl.conf.
On OpenBSD change header and recompile kernel. On Solaris ndd \-set
/dev/udp udp_max_buf 8388608.
.TP
.B rrset\-cache\-size: \fI<number>
Number of bytes size of the RRset cache. Default is 4 megabytes.
A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes
or gigabytes (1024*1024 bytes in a megabyte).
.TP
.B rrset\-cache\-slabs: \fI<number>
Number of slabs in the RRset cache. Slabs reduce lock contention by threads.
Must be set to a power of 2.
.TP
.B cache\-max\-ttl: \fI<seconds>
Time to live maximum for RRsets and messages in the cache. Default is
86400 seconds (1 day). If the maximum kicks in, responses to clients
still get decrementing TTLs based on the original (larger) values.
When the internal TTL expires, the cache item has expired.
Can be set lower to force the resolver to query for data often, and not
trust (very large) TTL values.
.TP
.B cache\-min\-ttl: \fI<seconds>
Time to live minimum for RRsets and messages in the cache. Default is 0.
If the the minimum kicks in, the data is cached for longer than the domain
owner intended, and thus less queries are made to look up the data.
Zero makes sure the data in the cache is as the domain owner intended,
higher values, especially more than an hour or so, can lead to trouble as
the data in the cache does not match up with the actual data any more.
.TP
.B infra\-host\-ttl: \fI<seconds>
Time to live for entries in the host cache. The host cache contains
roundtrip timing and EDNS support information. Default is 900.
.TP
.B infra\-lame\-ttl: \fI<seconds>
The time to live when a delegation is discovered to be lame. Default is 900.
.TP
.B infra\-cache\-slabs: \fI<number>
Number of slabs in the infrastructure cache. Slabs reduce lock contention
by threads. Must be set to a power of 2.
.TP
.B infra\-cache\-numhosts: \fI<number>
Number of hosts for which information is cached. Default is 10000.
.TP
.B infra\-cache\-lame\-size: \fI<number>
Number of bytes that the lameness cache per host is allowed to use. Default
is 10 kb, which gives maximum storage for a couple score zones, depending on
the lame zone name lengths.
.TP
.B do\-ip4: \fI<yes or no>
Enable or disable whether ip4 queries are answered or issued. Default is yes.
.TP
.B do\-ip6: \fI<yes or no>
Enable or disable whether ip6 queries are answered or issued. Default is yes.
If disabled, queries are not answered on IPv6, and queries are not sent on
IPv6 to the internet nameservers.
.TP
.B do\-udp: \fI<yes or no>
Enable or disable whether UDP queries are answered or issued. Default is yes.
.TP
.B do\-tcp: \fI<yes or no>
Enable or disable whether TCP queries are answered or issued. Default is yes.
.TP
.B do\-daemonize: \fI<yes or no>
Enable or disable whether the unbound server forks into the background as
a daemon. Default is yes.
.TP
.B access\-control: \fI<IP netblock> <action>
The netblock is given as an IP4 or IP6 address with /size appended for a
classless network block. The action can be \fIdeny\fR, \fIrefuse\fR,
\fIallow\fR or \fIallow_snoop\fR.
.IP
The action \fIdeny\fR stops queries from hosts from that netblock.
.IP
The action \fIrefuse\fR stops queries too, but sends a DNS rcode REFUSED
error message back.
.IP
The action \fIallow\fR gives access to clients from that netblock.
It gives only access for recursion clients (which is
what almost all clients need). Nonrecursive queries are refused.
.IP
The \fIallow\fR action does allow nonrecursive queries to access the
local\-data that is configured. The reason is that this does not involve
the unbound server recursive lookup algorithm, and static data is served
in the reply. This supports normal operations where nonrecursive queries
are made for the authoritative data. For nonrecursive queries any replies
from the dynamic cache are refused.
.IP
The action \fIallow_snoop\fR gives nonrecursive access too. This give
both recursive and non recursive access. The name \fIallow_snoop\fR refers
to cache snooping, a technique to use nonrecursive queries to examine
the cache contents (for malicious acts). However, nonrecursive queries can
also be a valuable debugging tool (when you want to examine the cache
contents). In that case use \fIallow_snoop\fR for your administration host.
.IP
By default only localhost is \fIallow\fRed, the rest is \fIrefuse\fRd.
The default is \fIrefuse\fRd, because that is protocol\-friendly. The DNS
protocol is not designed to handle dropped packets due to policy, and
dropping may result in (possibly excessive) retried queries.
.TP
.B chroot: \fI<directory>
If chroot is enabled, you should pass the configfile (from the
commandline) as a full path from the original root. After the
chroot has been performed the now defunct portion of the config
file path is removed to be able to reread the config after a reload.
.IP
All other file paths (working dir, logfile, roothints, and
key files) can be specified in several ways:
as an absolute path relative to the new root,
as a relative path to the working directory, or
as an absolute path relative to the original root.
In the last case the path is adjusted to remove the unused portion.
.IP
The pidfile can be either a relative path to the working directory, or
an absolute path relative to the original root. It is written just prior
to chroot and dropping permissions. This allows the pidfile to be
/var/run/unbound.pid and the chroot to be /var/unbound, for example.
.IP
Additionally, unbound may need to access /dev/random (for entropy)
from inside the chroot.
.IP
If given a chroot is done to the given directory. The default is
"@UNBOUND_CHROOT_DIR@". If you give "" no chroot is performed.
.TP
.B username: \fI<name>
If given, after binding the port the user privileges are dropped. Default is
"@UNBOUND_USERNAME@". If you give username: "" no user change is performed.
.IP
If this user is not capable of binding the
port, reloads (by signal HUP) will still retain the opened ports.
If you change the port number in the config file, and that new port number
requires privileges, then a reload will fail; a restart is needed.
.TP
.B directory: \fI<directory>
Sets the working directory for the program. Default is "@UNBOUND_RUN_DIR@".
.TP
.B logfile: \fI<filename>
If "" is given, logging goes to stderr, or nowhere once daemonized.
The logfile is appended to, in the following format:
.nf
[seconds since 1970] unbound[pid:tid]: type: message.
.fi
If this option is given, the use\-syslog is option is set to "no".
The logfile is reopened (for append) when the config file is reread, on
SIGHUP.
.TP
.B use\-syslog: \fI<yes or no>
Sets unbound to send log messages to the syslogd, using
\fIsyslog\fR(3).
The log facility LOG_DAEMON is used, with identity "unbound".
The logfile setting is overridden when use\-syslog is turned on.
The default is to log to syslog.
.TP
.B log\-time\-ascii: \fI<yes or no>
Sets logfile lines to use a timestamp in UTC ascii. Default is no, which
prints the seconds since 1970 in brackets. No effect if using syslog, in
that case syslog formats the timestamp printed into the log files.
.TP
.B pidfile: \fI<filename>
The process id is written to the file. Default is "@UNBOUND_PIDFILE@".
So,
.nf
kill \-HUP `cat @UNBOUND_PIDFILE@`
.fi
triggers a reload,
.nf
kill \-QUIT `cat @UNBOUND_PIDFILE@`
.fi
gracefully terminates.
.TP
.B root\-hints: \fI<filename>
Read the root hints from this file. Default is nothing, using builtin hints
for the IN class. The file has the format of zone files, with root
nameserver names and addresses only. The default may become outdated,
when servers change, therefore it is good practice to use a root\-hints file.
.TP
.B hide\-identity: \fI<yes or no>
If enabled id.server and hostname.bind queries are refused.
.TP
.B identity: \fI<string>
Set the identity to report. If set to "", the default, then the hostname
of the server is returned.
.TP
.B hide\-version: \fI<yes or no>
If enabled version.server and version.bind queries are refused.
.TP
.B version: \fI<string>
Set the version to report. If set to "", the default, then the package
version is returned.
.TP
.B target\-fetch\-policy: \fI<"list of numbers">
Set the target fetch policy used by unbound to determine if it should fetch
nameserver target addresses opportunistically. The policy is described per
dependency depth.
.IP
The number of values determines the maximum dependency depth
that unbound will pursue in answering a query.
A value of \-1 means to fetch all targets opportunistically for that dependency
depth. A value of 0 means to fetch on demand only. A positive value fetches
that many targets opportunistically.
.IP
Enclose the list between quotes ("") and put spaces between numbers.
The default is "3 2 1 0 0". Setting all zeroes, "0 0 0 0 0" gives behaviour
closer to that of BIND 9, while setting "\-1 \-1 \-1 \-1 \-1" gives behaviour
rumoured to be closer to that of BIND 8.
.TP
.B harden\-short\-bufsize: \fI<yes or no>
Very small EDNS buffer sizes from queries are ignored. Default is off, since
it is legal protocol wise to send these, and unbound tries to give very
small answers to these queries, where possible.
.TP
.B harden\-large\-queries: \fI<yes or no>
Very large queries are ignored. Default is off, since it is legal protocol
wise to send these, and could be necessary for operation if TSIG or EDNS
payload is very large.
.TP
.B harden\-glue: \fI<yes or no>
Will trust glue only if it is within the servers authority. Default is on.
.TP
.B harden\-dnssec\-stripped: \fI<yes or no>
Require DNSSEC data for trust\-anchored zones, if such data is absent,
the zone becomes bogus. If turned off, and no DNSSEC data is received
(or the DNSKEY data fails to validate), then the zone is made insecure,
this behaves like there is no trust anchor. You could turn this off if
you are sometimes behind an intrusive firewall (of some sort) that
removes DNSSEC data from packets, or a zone changes from signed to
unsigned to badly signed often. If turned off you run the risk of a
downgrade attack that disables security for a zone. Default is on.
.TP
.B harden\-referral\-path: \fI<yes or no>
Harden the referral path by performing additional queries for
infrastructure data. Validates the replies if trust anchors are configured
and the zones are signed. This enforces DNSSEC validation on nameserver
NS sets and the nameserver addresses that are encountered on the referral
path to the answer.
Default off, because it burdens the authority servers, and it is
not RFC standard, and could lead to performance problems because of the
extra query load that is generated. Experimental option.
.TP
.B use\-caps\-for\-id: \fI<yes or no>
Use 0x20\-encoded random bits in the query to foil spoof attempts.
This perturbs the lowercase and uppercase of query names sent to
authority servers and checks if the reply still has the correct casing.
Disabled by default.
This feature is an experimental implementation of draft dns\-0x20.
.TP
.B private\-address: \fI<IP address or subnet>
Give IPv4 of IPv6 addresses or classless subnets. These are addresses
on your private network, and are not allowed to be returned for public
internet names. Any occurence of such addresses are removed from
DNS answers. Additionally, the DNSSEC validator may mark the answers
bogus. This protects against so\-called DNS Rebinding, where a user browser
is turned into a network proxy, allowing remote access through the browser
to other parts of your private network. Some names can be allowed to
contain your private addresses, by default all the \fBlocal\-data\fR
that you configured is allowed to, and you can specify additional
names using \fBprivate\-domain\fR. No private addresses are enabled
by default. We consider to enable this for the RFC1918 private IP
address space by default in later releases. That would enable private
addresses for 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 192.254.0.0/16
fd00::/8 and fe80::/10, since the RFC standards say these addresses
should not be visible on the public internet. Turning on 127.0.0.0/8
would hinder many spamblocklists as they use that.
.TP
.B private\-domain: \fI<domain name>
Allow this domain, and all its subdomains to contain private addresses.
Give multiple times to allow multiple domain names to contain private
addresses. Default is none.
.TP
.B unwanted\-reply\-threshold: \fI<number>
If set, a total number of unwanted replies is kept track of in every thread.
When it reaches the threshold, a defensive action is taken and a warning
is printed to the log. The defensive action is to clear the rrset and
message caches, hopefully flushing away any poison. A value of 10 million
is suggested. Default is 0 (turned off).
.TP
.B do\-not\-query\-address: \fI<IP address>
Do not query the given IP address. Can be IP4 or IP6. Append /num to
indicate a classless delegation netblock, for example like
10.2.3.4/24 or 2001::11/64.
.TP
.B do\-not\-query\-localhost: \fI<yes or no>
If yes, localhost is added to the do\-not\-query\-address entries, both
IP6 ::1 and IP4 127.0.0.1/8. If no, then localhost can be used to send
queries to. Default is yes.
.TP
.B module\-config: \fI<"module names">
Module configuration, a list of module names separated by spaces, surround
the string with quotes (""). The modules can be validator, iterator.
Setting this to "iterator" will result in a non\-validating server.
Setting this to "validator iterator" will turn on DNSSEC validation.
The ordering of the modules is important.
You must also set trust\-anchors for validation to be useful.
.TP
.B trust\-anchor\-file: \fI<filename>
File with trusted keys for validation. Both DS and DNSKEY entries can appear
in the file. The format of the file is the standard DNS Zone file format.
Default is "", or no trust anchor file.
.TP
.B auto\-trust\-anchor\-file: \fI<filename>
File with trust anchor for one zone, which is tracked with RFC5011 probes.
The probes are several times per month, thus the machine must be online
frequently. The initial file can be one with contents as described in
\fBtrust\-anchor\-file\fR. The file is written to when the anchor is updated,
so the unbound user must have write permission.
.TP
.B trust\-anchor: \fI<"Resource Record">
A DS or DNSKEY RR for a key to use for validation. Multiple entries can be
given to specify multiple trusted keys, in addition to the trust\-anchor\-files.
The resource record is entered in the same format as 'dig' or 'drill' prints
them, the same format as in the zone file. Has to be on a single line, with
"" around it. A TTL can be specified for ease of cut and paste, but is ignored.
A class can be specified, but class IN is default.
.TP
.B trusted\-keys\-file: \fI<filename>
File with trusted keys for validation. Specify more than one file
with several entries, one file per entry. Like \fBtrust\-anchor\-file\fR
but has a different file format. Format is BIND\-9 style format,
the trusted\-keys { name flag proto algo "key"; }; clauses are read.
It is possible to use wildcards with this statement, the wildcard is
expanded on start and on reload.
.TP
.B dlv\-anchor\-file: \fI<filename>
File with trusted keys for DLV (DNSSEC Lookaside Validation). Both DS and
DNSKEY entries can be used in the file, in the same format as for
\fItrust\-anchor\-file:\fR statements. Only one DLV can be configured, more
would be slow. The DLV configured is used as a root trusted DLV, this
means that it is a lookaside for the root. Default is "", or no dlv anchor file.
.TP
.B dlv\-anchor: \fI<"Resource Record">
Much like trust\-anchor, this is a DLV anchor with the DS or DNSKEY inline.
.TP
.B domain\-insecure: \fI<domain name>
Sets domain name to be insecure, DNSSEC chain of trust is ignored towards
the domain name. So a trust anchor above the domain name can not make the
domain secure with a DS record, such a DS record is then ignored.
Also keys from DLV are ignored for the domain. Can be given multiple times
to specify multiple domains that are treated as if unsigned. If you set
trust anchors for the domain they override this setting (and the domain
is secured).
.IP
This can be useful if you want to make sure a trust anchor for external
lookups does not affect an (unsigned) internal domain. A DS record
externally can create validation failures for that internal domain.
.TP
.B val\-override\-date: \fI<rrsig\-style date spec>
Default is "" or "0", which disables this debugging feature. If enabled by
giving a RRSIG style date, that date is used for verifying RRSIG inception
and expiration dates, instead of the current date. Do not set this unless
you are debugging signature inception and expiration.
.TP
.B val\-sig\-skew\-min: \fI<seconds>
Minimum number of seconds of clock skew to apply to validated signatures.
A value of 10% of the signature lifetime is used, capped by this setting.
Default is 3600 (1 hour) which allows for daylight savings differences.
Lower this value for more strict checking of short lived signatures.
.TP
.B val\-sig\-skew\-max: \fI<seconds>
Maximum number of seconds of clock skew to apply to validated signatures.
A value of 10% of the signature lifetime is used, capped by this setting.
Default is 86400 (24 hours) which allows for timezone setting problems in
stable domains. Setting both min and max very low disables the clock skew
allowances. Setting both min and max very high makes the validator check
the signature timestamps less strictly.
.TP
.B val\-bogus\-ttl: \fI<number>
The time to live for bogus data. This is data that has failed validation;
due to invalid signatures or other checks. The TTL from that data cannot be
trusted, and this value is used instead. The value is in seconds, default 60.
The time interval prevents repeated revalidation of bogus data.
.TP
.B val\-clean\-additional: \fI<yes or no>
Instruct the validator to remove data from the additional section of secure
messages that are not signed properly. Messages that are insecure, bogus,
indeterminate or unchecked are not affected. Default is yes. Use this setting
to protect the users that rely on this validator for authentication from
protentially bad data in the additional section.
.TP
.B val\-log\-level: \fI<number>
Have the validator print validation failures to the log. Regardless of the
verbosity setting. Default is 0, off. At 1, for every user query that fails
a line is printed to the logs. This way you can monitor what happens with
validation. Use a diagnosis tool, such as dig or drill, to find out why
validation is failing for these queries.
.TP
.B val\-permissive\-mode: \fI<yes or no>
Instruct the validator to mark bogus messages as indeterminate. The security
checks are performed, but if the result is bogus (failed security), the
reply is not withheld from the client with SERVFAIL as usual. The client
receives the bogus data. For messages that are found to be secure the AD bit
is set in replies. Also logging is performed as for full validation.
The default value is "no".
.TP
.B val\-nsec3\-keysize\-iterations: \fI<"list of values">
List of keysize and iteration count values, separated by spaces, surrounded
by quotes. Default is "1024 150 2048 500 4096 2500". This determines the
maximum allowed NSEC3 iteration count before a message is simply marked
insecure instead of performing the many hashing iterations. The list must
be in ascending order and have at least one entry. If you set it to
"1024 65535" there is no restriction to NSEC3 iteration values.
This table must be kept short; a very long list could cause slower operation.
.TP
.B add\-holddown: \fI<seconds>
Instruct the \fBauto\-trust\-anchor\-file\fR probe mechanism for RFC5011
autotrust updates to add new trust anchors only after they have been
visible for this time. Default is 30 days as per the RFC.
.TP
.B del\-holddown: \fI<seconds>
Instruct the \fBauto\-trust\-anchor\-file\fR probe mechanism for RFC5011
autotrust updates to remove revoked trust anchors after they have been
kept in the revoked list for this long. Default is 30 days as per
the RFC.
.TP
.B keep\-missing: \fI<seconds>
Instruct the \fBauto\-trust\-anchor\-file\fR probe mechanism for RFC5011
autotrust updates to remove missing trust anchors after they have been
unseen for this long. This cleans up the state file if the target zone
does not perform trust anchor revocation, so this makes the auto probe
mechanism work with zones that perform regular (non\-5011) rollovers.
The default is 366 days. The value 0 does not remove missing anchors,
as per the RFC.
.TP
.B key\-cache\-size: \fI<number>
Number of bytes size of the key cache. Default is 4 megabytes.
A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes
or gigabytes (1024*1024 bytes in a megabyte).
.TP
.B key\-cache\-slabs: \fI<number>
Number of slabs in the key cache. Slabs reduce lock contention by threads.
Must be set to a power of 2. Setting (close) to the number of cpus is a
reasonable guess.
.TP
.B neg\-cache\-size: \fI<number>
Number of bytes size of the aggressive negative cache. Default is 1 megabyte.
A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes
or gigabytes (1024*1024 bytes in a megabyte).
.TP
.B local\-zone: \fI<zone> <type>
Configure a local zone. The type determines the answer to give if there is
no match from local\-data. The types are deny, refuse, static, transparent,
redirect, nodefault, and are explained below. After that the default settings
are listed. Use local\-data: to enter data into the local zone. Answers for
local zones are authoritative DNS answers. By default the zones are class IN.
.IP
If you need more complicated authoritative data, with referrals, wildcards,
CNAME/DNAME support, or DNSSEC authoritative service, setup a stub\-zone for
it as detailed in the stub zone section below.
.TP 10
\h'5'\fIdeny\fR
Do not send an answer, drop the query.
If there is a match from local data, the query is answered.
.TP 10
\h'5'\fIrefuse\fR
Send an error message reply, with rcode REFUSED.
If there is a match from local data, the query is answered.
.TP 10
\h'5'\fIstatic\fR
If there is a match from local data, the query is answered.
Otherwise, the query is answered with nodata or nxdomain.
For a negative answer a SOA is included in the answer if present
as local\-data for the zone apex domain.
.TP 10
\h'5'\fItransparent\fR
If there is a match from local data, the query is answered.
Otherwise if the query has a different name, the query is resolved normally.
If the query is for a name given in localdata but no such type of data is
given in localdata, then a noerror nodata answer is returned.
If no local\-zone is given local\-data causes a transparent zone
to be created by default.
.TP 10
\h'5'\fIredirect\fR
The query is answered from the local data for the zone name.
There may be no local data beneath the zone name.
This answers queries for the zone, and all subdomains of the zone
with the local data for the zone.
It can be used to redirect a domain to return a different address record
to the end user, with
local\-zone: "example.com." redirect and
local\-data: "example.com. A 127.0.0.1"
queries for www.example.com and www.foo.example.com are redirected, so
that users with web browsers cannot access sites with suffix example.com.
.TP 10
\h'5'\fInodefault\fR
Used to turn off default contents for AS112 zones. The other types
also turn off default contents for the zone. The 'nodefault' option
has no other effect than turning off default contents for the
given zone.
.P
The default zones are localhost, reverse 127.0.0.1 and ::1, and the AS112
zones. The AS112 zones are reverse DNS zones for private use and reserved
IP addresses for which the servers on the internet cannot provide correct
answers. They are configured by default to give nxdomain (no reverse
information) answers. The defaults can be turned off by specifying your
own local\-zone of that name, or using the 'nodefault' type. Below is a
list of the default zone contents.
.TP 10
\h'5'\fIlocalhost\fR
The IP4 and IP6 localhost information is given. NS and SOA records are provided
for completeness and to satisfy some DNS update tools. Default content:
.nf
local\-zone: "localhost." static
local\-data: "localhost. 10800 IN NS localhost."
local\-data: "localhost. 10800 IN
SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
local\-data: "localhost. 10800 IN A 127.0.0.1"
local\-data: "localhost. 10800 IN AAAA ::1"
.fi
.TP 10
\h'5'\fIreverse IPv4 loopback\fR
Default content:
.nf
local\-zone: "127.in\-addr.arpa." static
local\-data: "127.in\-addr.arpa. 10800 IN NS localhost."
local\-data: "127.in\-addr.arpa. 10800 IN
SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
local\-data: "1.0.0.127.in\-addr.arpa. 10800 IN
PTR localhost."
.fi
.TP 10
\h'5'\fIreverse IPv6 loopback\fR
Default content:
.nf
local\-zone: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." static
local\-data: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa. 10800 IN
NS localhost."
local\-data: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa. 10800 IN
SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
local\-data: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa. 10800 IN
PTR localhost."
.fi
.TP 10
\h'5'\fIreverse RFC1918 local use zones\fR
Reverse data for zones 10.in\-addr.arpa, 16.172.in\-addr.arpa to
31.172.in\-addr.arpa, 168.192.in\-addr.arpa.
The \fBlocal\-zone:\fR is set static and as \fBlocal\-data:\fR SOA and NS
records are provided.
.TP 10
\h'5'\fIreverse RFC3330 IP4 this, link\-local, testnet and broadcast\fR
Reverse data for zones 0.in\-addr.arpa, 254.169.in\-addr.arpa,
2.0.192.in\-addr.arpa, 255.255.255.255.in\-addr.arpa.
.TP 10
\h'5'\fIreverse RFC4291 IP6 unspecified\fR
Reverse data for zone
.nf
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.
.fi
.TP 10
\h'5'\fIreverse RFC4193 IPv6 Locally Assigned Local Addresses\fR
Reverse data for zone D.F.ip6.arpa.
.TP 10
\h'5'\fIreverse RFC4291 IPv6 Link Local Addresses\fR
Reverse data for zones 8.E.F.ip6.arpa to B.E.F.ip6.arpa.
.TP 10
\h'5'\fIreverse IPv6 Example Prefix\fR
Reverse data for zone 8.B.D.0.1.0.0.2.ip6.arpa. This zone is used for
tutorials and examples. You can remove the block on this zone with:
.nf
local\-zone: 8.B.D.0.1.0.0.2.ip6.arpa. nodefault
.fi
This also works with the other default zones.
.\" End of local-zone listing.
.TP 5
.B local\-data: \fI"<resource record string>"
Configure local data, which is served in reply to queries for it.
The query has to match exactly unless you configure the local\-zone as
redirect. If not matched exactly, the local\-zone type determines
further processing. If local\-data is configured that is not a subdomain of
a local\-zone, a transparent local\-zone is configured.
For record types such as TXT, use single quotes, as in
local\-data: 'example. TXT "text"'.
.IP
If you need more complicated authoritative data, with referrals, wildcards,
CNAME/DNAME support, or DNSSEC authoritative service, setup a stub\-zone for
it as detailed in the stub zone section below.
.TP 5
.B local\-data\-ptr: \fI"IPaddr name"
Configure local data shorthand for a PTR record with the reversed IPv4 or
IPv6 address and the host name. For example "192.0.2.4 www.example.com".
TTL can be inserted like this: "2001:DB8::4 7200 www.example.com"
.SS "Remote Control Options"
In the
.B remote\-control:
clause are the declarations for the remote control facility. If this is
enabled, the \fIunbound\-control\fR(8) utility can be used to send
commands to the running unbound server. The server uses these clauses
to setup SSLv3 / TLSv1 security for the connection. The
\fIunbound\-control\fR(8) utility also reads the \fBremote\-control\fR
section for options. To setup the correct self\-signed certificates use the
\fIunbound\-control\-setup\fR(8) utility.
.TP 5
.B control\-enable: \fI<yes or no>
The option is used to enable remote control, default is "no".
If turned off, the server does not listen for control commands.
.TP 5
.B control\-interface: <ip address>
Give IPv4 or IPv6 addresses to listen on for control commands.
By default localhost (127.0.0.1 and ::1) is listened to.
Use 0.0.0.0 and ::0 to listen to all interfaces.
.TP 5
.B control\-port: <port number>
The port number to listen on for control commands, default is 953
(that is the same port number named uses to listen to rndc).
If you change this port number, and permissions have been dropped, a
reload is not sufficient to open the port again, you must then restart.
.TP 5
.B server\-key\-file: "<private key file>"
Path to the server private key, by default unbound_server.key.
This file is generated by the \fIunbound\-control\-setup\fR utility.
This file is used by the unbound server, but not by \fIunbound\-control\fR.
.TP 5
.B server\-cert\-file: "<certificate file.pem>"
Path to the server self signed certificate, by default unbound_server.pem.
This file is generated by the \fIunbound\-control\-setup\fR utility.
This file is used by the unbound server, and also by \fIunbound\-control\fR.
.TP 5
.B control\-key\-file: "<private key file>"
Path to the control client private key, by default unbound_control.key.
This file is generated by the \fIunbound\-control\-setup\fR utility.
This file is used by \fIunbound\-control\fR.
.TP 5
.B control\-cert\-file: "<certificate file.pem>"
Path to the control client certificate, by default unbound_control.pem.
This certificate has to be signed with the server certificate.
This file is generated by the \fIunbound\-control\-setup\fR utility.
This file is used by \fIunbound\-control\fR.
.SS "Stub Zone Options"
.LP
There may be multiple
.B stub\-zone:
clauses. Each with a name: and zero or more hostnames or IP addresses.
For the stub zone this list of nameservers is used. Class IN is assumed.
The servers should be authority servers, not recursors; unbound performs
the recursive processing itself for stub zones.
.P
The stub zone can be used to configure authoritative data to be used
by the resolver that cannot be accessed using the public internet servers.
This is useful for company\-local data or private zones. Setup an
authoritative server on a different host (or different port). Enter a config
entry for unbound with
.B stub\-addr:
<ip address of host[@port]>.
The unbound resolver can then access the data, without referring to the
public internet for it.
.P
This setup allows DNSSEC signed zones to be served by that
authoritative server, in which case a trusted key entry with the public key
can be put in config, so that unbound can validate the data and set the AD
bit on replies for the private zone (authoritative servers do not set the
AD bit). This setup makes unbound capable of answering queries for the
private zone, and can even set the AD bit ('authentic'), but the AA
('authoritative') bit is not set on these replies.
.TP
.B name: \fI<domain name>
Name of the stub zone.
.TP
.B stub\-host: \fI<domain name>
Name of stub zone nameserver. Is itself resolved before it is used.
.TP
.B stub\-addr: \fI<IP address>
IP address of stub zone nameserver. Can be IP 4 or IP 6.
To use a nondefault port for DNS communication append '@' with the port number.
.TP
.B stub\-prime: \fI<yes or no>
This option is by default off. If enabled it performs NS set priming,
which is similar to root hints, where it starts using the list of nameservers
currently published by the zone. Thus, if the hint list is slightly outdated,
the resolver picks up a correct list online.
.SS "Forward Zone Options"
.LP
There may be multiple
.B forward\-zone:
clauses. Each with a \fBname:\fR and zero or more hostnames or IP
addresses. For the forward zone this list of nameservers is used to
forward the queries to. The servers listed as \fBforward\-host:\fR and
\fBforward\-addr:\fR have to handle further recursion for the query. Thus,
those servers are not authority servers, but are (just like unbound is)
recursive servers too; unbound does not perform recursion itself for the
forward zone, it lets the remote server do it. Class IN is assumed.
A forward\-zone entry with name "." and a forward\-addr target will
forward all queries to that other server (unless it can answer from
the cache).
.TP
.B name: \fI<domain name>
Name of the forward zone.
.TP
.B forward\-host: \fI<domain name>
Name of server to forward to. Is itself resolved before it is used.
.TP
.B forward\-addr: \fI<IP address>
IP address of server to forward to. Can be IP 4 or IP 6.
To use a nondefault port for DNS communication append '@' with the port number.
.SS "Python Module Options"
.LP
The
.B python:
clause gives the settings for the \fIpython\fR(1) script module. This module
acts like the iterator and validator modules do, on queries and answers.
To enable the script module it has to be compiled into the daemon,
and the word "python" has to be put in the \fBmodule\-conf:\fR option
(usually first, or between the validator and iterator).
.TP
.B python\-script: \fI<python file>\fR
The script file to load.
.SH "MEMORY CONTROL EXAMPLE"
In the example config settings below memory usage is reduced. Some service
levels are lower, notable very large data and a high TCP load are no longer
supported. Very large data and high TCP loads are exceptional for the DNS.
DNSSEC validation is enabled, just add trust anchors.
If you do not have to worry about programs using more than 3 Mb of memory,
the below example is not for you. Use the defaults to receive full service,
which on BSD\-32bit tops out at 30\-40 Mb after heavy usage.
.P
.nf
# example settings that reduce memory usage
server:
num\-threads: 1
outgoing\-num\-tcp: 1 # this limits TCP service, uses less buffers.
incoming\-num\-tcp: 1
outgoing\-range: 16 # uses less memory, but less performance.
msg\-buffer\-size: 8192 # note this limits service, 'no huge stuff'.
msg\-cache\-size: 100k
msg\-cache\-slabs: 1
rrset\-cache\-size: 100k
rrset\-cache\-slabs: 1
infra\-cache\-numhosts: 200
infra\-cache\-slabs: 1
infra\-cache\-lame\-size: 1k
key\-cache\-size: 100k
key\-cache\-slabs: 1
neg\-cache\-size: 10k
num\-queries\-per\-thread: 30
target\-fetch\-policy: "2 1 0 0 0 0"
harden\-large\-queries: "yes"
harden\-short\-bufsize: "yes"
.fi
.SH "FILES"
.TP
.I @UNBOUND_RUN_DIR@
default unbound working directory.
.TP
.I @UNBOUND_CHROOT_DIR@
default
\fIchroot\fR(2)
location.
.TP
.I @ub_conf_file@
unbound configuration file.
.TP
.I @UNBOUND_PIDFILE@
default unbound pidfile with process ID of the running daemon.
.TP
.I unbound.log
unbound log file. default is to log to
\fIsyslog\fR(3).
.SH "SEE ALSO"
\fIunbound\fR(8),
\fIunbound\-checkconf\fR(8).
.SH "AUTHORS"
.B Unbound
was written by NLnet Labs. Please see CREDITS file
in the distribution for further details.
+80 -48
View File
@@ -1,4 +1,4 @@
# Doxyfile 1.4.6
# Doxyfile 1.5.2
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
@@ -14,6 +14,14 @@
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file that
# follow. The default is UTF-8 which is also the encoding used for all text before
# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into
# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of
# possible encodings.
# DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
@@ -45,24 +53,14 @@ CREATE_SUBDIRS = NO
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
# Swedish, and Ukrainian.
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
OUTPUT_LANGUAGE = English
# This tag can be used to specify the encoding used in the generated output.
# The encoding is not always determined by the language that is chosen,
# but also whether or not the output is meant for Windows or non-Windows users.
# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
# forces the Windows encoding (this is the default for the Windows binary),
# whereas setting the tag to NO uses a Unix-style encoding (the default for
# all platforms other than Windows).
USE_WINDOWS_ENCODING = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
@@ -152,8 +150,7 @@ MULTILINE_CPP_IS_BRIEF = NO
# will output the detailed description near the top, like JavaDoc.
# If set to NO, the detailed description appears after the member
# documentation.
DETAILS_AT_TOP = NO
#DETAILS_AT_TOP = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
@@ -204,6 +201,11 @@ OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
# CPP_CLI_SUPPORT = NO
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
@@ -459,7 +461,14 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = .
INPUT = .
# This tag can be used to specify the character encoding of the source files that
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default
# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding.
# See http://www.gnu.org/software/libiconv for the list of possible encodings.
# INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -468,7 +477,7 @@ INPUT = .
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
#FILE_PATTERNS = *.h *.c *.dox
FILE_PATTERNS =
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@@ -480,7 +489,20 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = ./build ./compat util/configparser.c util/configparser.h util/configlexer.c util/locks.h
EXCLUDE = ./build \
./compat \
util/configparser.c \
util/configparser.h \
util/configlexer.c \
util/locks.h \
pythonmod/unboundmodule.py \
pythonmod/interface.h \
pythonmod/examples/resgen.py \
pythonmod/examples/resmod.py \
pythonmod/examples/resip.py \
libunbound/python/unbound.py \
libunbound/python/libunbound_wrap.c \
./ldns-src
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
@@ -496,6 +518,13 @@ EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the output.
# The symbol name can be a fully qualified name, a word, or if the wildcard * is used,
# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
# EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
@@ -581,6 +610,13 @@ REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
# link to the source code. Otherwise they will link to the documentstion.
# REFERENCES_LINK_SOURCE = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
@@ -884,7 +920,7 @@ MAN_LINKS = NO
# generate an XML file that captures the structure of
# the code including all documentation.
GENERATE_XML = NO
GENERATE_XML = YES
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
@@ -1078,6 +1114,14 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to
# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to
# specify the directory where the mscgen tool resides. If left empty the tool is assumed to
# be found in the default search path.
# MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
@@ -1143,6 +1187,14 @@ INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
# generate a caller dependency graph for every global function or class method.
# Note that enabling this option will significantly increase the time of a run.
# So in most cases it will be better to enable caller graphs for selected
# functions only using the \callergraph command.
# CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
@@ -1172,33 +1224,13 @@ DOT_PATH =
DOTFILE_DIRS =
# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
# visualized by representing a node as a red box. Note that doxygen will always
# show the root nodes and its direct children regardless of this setting.
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
# this value, doxygen will try to truncate the graph, so that it fits within
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that a graph may be further truncated if the graph's
# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
# the graph is not depth-constrained.
MAX_DOT_GRAPH_DEPTH = 0
# DOT_GRAPH_MAX_NODES = 50
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, which results in a white background.
+468 -200
View File
@@ -1,251 +1,519 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright 1991 by the Massachusetts Institute of Technology
# Copyright (C) 1994 X Consortium
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
true
doit_exec=$doit
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
posix_mkdir=
pathcomp=''
# Desired mode of installed file.
mode=0755
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
src=
dst=
dir_arg=
dst_arg=
pathcomp="${pathcomp}/"
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# If we're going to rename the final executable, determine the name now.
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
mkdir_mode=
fi
# don't allow the sed command to completely eliminate the filename
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
true
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
# Make a temp file name in the proper directory.
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
dsttmp=$dstdir/#inst.$$#
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Move or copy the file name to the temp name
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
$doit $instcmd $src $dsttmp &&
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap "rm -f ${dsttmp}" 0 &&
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
# Now rename the file to the real destination.
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
fi &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
+446
View File
@@ -0,0 +1,446 @@
/*
* iterator/iter_delegpt.c - delegation point with NS and address information.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file implements the Delegation Point. It contains a list of name servers
* and their addresses if known.
*/
#include "config.h"
#include "iterator/iter_delegpt.h"
#include "services/cache/dns.h"
#include "util/regional.h"
#include "util/data/dname.h"
#include "util/data/packed_rrset.h"
#include "util/data/msgreply.h"
#include "util/net_help.h"
struct delegpt*
delegpt_create(struct regional* region)
{
struct delegpt* dp=(struct delegpt*)regional_alloc(
region, sizeof(*dp));
if(!dp)
return NULL;
memset(dp, 0, sizeof(*dp));
return dp;
}
struct delegpt* delegpt_copy(struct delegpt* dp, struct regional* region)
{
struct delegpt* copy = delegpt_create(region);
struct delegpt_ns* ns;
struct delegpt_addr* a;
if(!copy)
return NULL;
if(!delegpt_set_name(copy, region, dp->name))
return NULL;
copy->bogus = dp->bogus;
for(ns = dp->nslist; ns; ns = ns->next) {
if(!delegpt_add_ns(copy, region, ns->name))
return NULL;
copy->nslist->resolved = ns->resolved;
copy->nslist->got4 = ns->got4;
copy->nslist->got6 = ns->got6;
}
for(a = dp->target_list; a; a = a->next_target) {
if(!delegpt_add_addr(copy, region, &a->addr, a->addrlen,
a->bogus, 0))
return NULL;
}
return copy;
}
int
delegpt_set_name(struct delegpt* dp, struct regional* region, uint8_t* name)
{
dp->namelabs = dname_count_size_labels(name, &dp->namelen);
dp->name = regional_alloc_init(region, name, dp->namelen);
return dp->name != 0;
}
int
delegpt_add_ns(struct delegpt* dp, struct regional* region, uint8_t* name)
{
struct delegpt_ns* ns;
size_t len;
(void)dname_count_size_labels(name, &len);
/* slow check for duplicates to avoid counting failures when
* adding the same server as a dependency twice */
if(delegpt_find_ns(dp, name, len))
return 1;
ns = (struct delegpt_ns*)regional_alloc(region,
sizeof(struct delegpt_ns));
if(!ns)
return 0;
ns->next = dp->nslist;
ns->namelen = len;
dp->nslist = ns;
ns->name = regional_alloc_init(region, name, ns->namelen);
ns->resolved = 0;
ns->got4 = 0;
ns->got6 = 0;
return 1;
}
struct delegpt_ns*
delegpt_find_ns(struct delegpt* dp, uint8_t* name, size_t namelen)
{
struct delegpt_ns* p = dp->nslist;
while(p) {
if(namelen == p->namelen &&
query_dname_compare(name, p->name) == 0) {
return p;
}
p = p->next;
}
return NULL;
}
struct delegpt_addr*
delegpt_find_addr(struct delegpt* dp, struct sockaddr_storage* addr,
socklen_t addrlen)
{
struct delegpt_addr* p = dp->target_list;
while(p) {
if(sockaddr_cmp_addr(addr, addrlen, &p->addr, p->addrlen)==0) {
return p;
}
p = p->next_target;
}
return NULL;
}
int
delegpt_add_target(struct delegpt* dp, struct regional* region,
uint8_t* name, size_t namelen, struct sockaddr_storage* addr,
socklen_t addrlen, int bogus, int nodup)
{
struct delegpt_ns* ns = delegpt_find_ns(dp, name, namelen);
if(!ns) {
/* ignore it */
return 1;
}
if(addr_is_ip6(addr, addrlen))
ns->got6 = 1;
else ns->got4 = 1;
if(ns->got4 && ns->got6)
ns->resolved = 1;
return delegpt_add_addr(dp, region, addr, addrlen, bogus, nodup);
}
int
delegpt_add_addr(struct delegpt* dp, struct regional* region,
struct sockaddr_storage* addr, socklen_t addrlen, int bogus, int nodup)
{
struct delegpt_addr* a;
if(nodup) {
if((a = delegpt_find_addr(dp, addr, addrlen))) {
if(bogus)
a->bogus = bogus;
return 1;
}
}
a = (struct delegpt_addr*)regional_alloc(region,
sizeof(struct delegpt_addr));
if(!a)
return 0;
a->next_target = dp->target_list;
dp->target_list = a;
a->next_result = 0;
a->next_usable = dp->usable_list;
dp->usable_list = a;
memcpy(&a->addr, addr, addrlen);
a->addrlen = addrlen;
a->attempts = 0;
a->bogus = bogus;
return 1;
}
void
delegpt_count_ns(struct delegpt* dp, size_t* numns, size_t* missing)
{
struct delegpt_ns* ns;
*numns = 0;
*missing = 0;
for(ns = dp->nslist; ns; ns = ns->next) {
(*numns)++;
if(!ns->resolved)
(*missing)++;
}
}
void
delegpt_count_addr(struct delegpt* dp, size_t* numaddr, size_t* numres,
size_t* numavail)
{
struct delegpt_addr* a;
*numaddr = 0;
*numres = 0;
*numavail = 0;
for(a = dp->target_list; a; a = a->next_target) {
(*numaddr)++;
}
for(a = dp->result_list; a; a = a->next_result) {
(*numres)++;
}
for(a = dp->usable_list; a; a = a->next_usable) {
(*numavail)++;
}
}
void delegpt_log(enum verbosity_value v, struct delegpt* dp)
{
char buf[LDNS_MAX_DOMAINLEN+1];
struct delegpt_ns* ns;
struct delegpt_addr* a;
size_t missing=0, numns=0, numaddr=0, numres=0, numavail=0;
if(verbosity < v)
return;
dname_str(dp->name, buf);
if(dp->nslist == NULL && dp->target_list == NULL) {
log_info("DelegationPoint<%s>: empty", buf);
return;
}
delegpt_count_ns(dp, &numns, &missing);
delegpt_count_addr(dp, &numaddr, &numres, &numavail);
log_info("DelegationPoint<%s>: %u names (%u missing), "
"%u addrs (%u result, %u avail)",
buf, (unsigned)numns, (unsigned)missing,
(unsigned)numaddr, (unsigned)numres, (unsigned)numavail);
if(verbosity >= VERB_ALGO) {
for(ns = dp->nslist; ns; ns = ns->next) {
dname_str(ns->name, buf);
log_info(" %s %s%s%s%s", buf, (ns->resolved?"*":""),
(ns->got4?" A":""), (ns->got6?" AAAA":""),
(dp->bogus?" BOGUS":"") );
}
for(a = dp->target_list; a; a = a->next_target) {
if(a->bogus)
log_addr(VERB_ALGO, " BOGUS ",
&a->addr, a->addrlen);
else log_addr(VERB_ALGO, " ", &a->addr, a->addrlen);
}
}
}
void
delegpt_add_unused_targets(struct delegpt* dp)
{
struct delegpt_addr* usa = dp->usable_list;
dp->usable_list = NULL;
while(usa) {
usa->next_result = dp->result_list;
dp->result_list = usa;
usa = usa->next_usable;
}
}
size_t
delegpt_count_missing_targets(struct delegpt* dp)
{
struct delegpt_ns* ns;
size_t n = 0;
for(ns = dp->nslist; ns; ns = ns->next)
if(!ns->resolved)
n++;
return n;
}
/** find NS rrset in given list */
static struct ub_packed_rrset_key*
find_NS(struct reply_info* rep, size_t from, size_t to)
{
size_t i;
for(i=from; i<to; i++) {
if(ntohs(rep->rrsets[i]->rk.type) == LDNS_RR_TYPE_NS)
return rep->rrsets[i];
}
return NULL;
}
struct delegpt*
delegpt_from_message(struct dns_msg* msg, struct regional* region)
{
struct ub_packed_rrset_key* ns_rrset = NULL;
struct delegpt* dp;
size_t i;
/* look for NS records in the authority section... */
ns_rrset = find_NS(msg->rep, msg->rep->an_numrrsets,
msg->rep->an_numrrsets+msg->rep->ns_numrrsets);
/* In some cases (even legitimate, perfectly legal cases), the
* NS set for the "referral" might be in the answer section. */
if(!ns_rrset)
ns_rrset = find_NS(msg->rep, 0, msg->rep->an_numrrsets);
/* If there was no NS rrset in the authority section, then this
* wasn't a referral message. (It might not actually be a
* referral message anyway) */
if(!ns_rrset)
return NULL;
/* If we found any, then Yay! we have a delegation point. */
dp = delegpt_create(region);
if(!dp)
return NULL;
if(!delegpt_set_name(dp, region, ns_rrset->rk.dname))
return NULL;
if(!delegpt_rrset_add_ns(dp, region, ns_rrset))
return NULL;
/* add glue, A and AAAA in answer and additional section */
for(i=0; i<msg->rep->rrset_count; i++) {
struct ub_packed_rrset_key* s = msg->rep->rrsets[i];
/* skip auth section. FIXME really needed?*/
if(msg->rep->an_numrrsets <= i &&
i < (msg->rep->an_numrrsets+msg->rep->ns_numrrsets))
continue;
if(ntohs(s->rk.type) == LDNS_RR_TYPE_A) {
if(!delegpt_add_rrset_A(dp, region, s, 0))
return NULL;
} else if(ntohs(s->rk.type) == LDNS_RR_TYPE_AAAA) {
if(!delegpt_add_rrset_AAAA(dp, region, s, 0))
return NULL;
}
}
return dp;
}
int
delegpt_rrset_add_ns(struct delegpt* dp, struct regional* region,
struct ub_packed_rrset_key* ns_rrset)
{
struct packed_rrset_data* nsdata = (struct packed_rrset_data*)
ns_rrset->entry.data;
size_t i;
if(nsdata->security == sec_status_bogus)
dp->bogus = 1;
for(i=0; i<nsdata->count; i++) {
if(nsdata->rr_len[i] < 2+1) continue; /* len + root label */
if(dname_valid(nsdata->rr_data[i]+2, nsdata->rr_len[i]-2) !=
(size_t)ldns_read_uint16(nsdata->rr_data[i]))
continue; /* bad format */
/* add rdata of NS (= wirefmt dname), skip rdatalen bytes */
if(!delegpt_add_ns(dp, region, nsdata->rr_data[i]+2))
return 0;
}
return 1;
}
int
delegpt_add_rrset_A(struct delegpt* dp, struct regional* region,
struct ub_packed_rrset_key* ak, int nodup)
{
struct packed_rrset_data* d=(struct packed_rrset_data*)ak->entry.data;
size_t i;
struct sockaddr_in sa;
socklen_t len = (socklen_t)sizeof(sa);
memset(&sa, 0, len);
sa.sin_family = AF_INET;
sa.sin_port = (in_port_t)htons(UNBOUND_DNS_PORT);
for(i=0; i<d->count; i++) {
if(d->rr_len[i] != 2 + INET_SIZE)
continue;
memmove(&sa.sin_addr, d->rr_data[i]+2, INET_SIZE);
if(!delegpt_add_target(dp, region, ak->rk.dname,
ak->rk.dname_len, (struct sockaddr_storage*)&sa,
len, (d->security==sec_status_bogus), nodup))
return 0;
}
return 1;
}
int
delegpt_add_rrset_AAAA(struct delegpt* dp, struct regional* region,
struct ub_packed_rrset_key* ak, int nodup)
{
struct packed_rrset_data* d=(struct packed_rrset_data*)ak->entry.data;
size_t i;
struct sockaddr_in6 sa;
socklen_t len = (socklen_t)sizeof(sa);
memset(&sa, 0, len);
sa.sin6_family = AF_INET6;
sa.sin6_port = (in_port_t)htons(UNBOUND_DNS_PORT);
for(i=0; i<d->count; i++) {
if(d->rr_len[i] != 2 + INET6_SIZE) /* rdatalen + len of IP6 */
continue;
memmove(&sa.sin6_addr, d->rr_data[i]+2, INET6_SIZE);
if(!delegpt_add_target(dp, region, ak->rk.dname,
ak->rk.dname_len, (struct sockaddr_storage*)&sa,
len, (d->security==sec_status_bogus), nodup))
return 0;
}
return 1;
}
int
delegpt_add_rrset(struct delegpt* dp, struct regional* region,
struct ub_packed_rrset_key* rrset)
{
if(!rrset)
return 1;
if(ntohs(rrset->rk.type) == LDNS_RR_TYPE_NS)
return delegpt_rrset_add_ns(dp, region, rrset);
else if(ntohs(rrset->rk.type) == LDNS_RR_TYPE_A)
return delegpt_add_rrset_A(dp, region, rrset, 0);
else if(ntohs(rrset->rk.type) == LDNS_RR_TYPE_AAAA)
return delegpt_add_rrset_AAAA(dp, region, rrset, 0);
log_warn("Unknown rrset type added to delegpt");
return 1;
}
void delegpt_add_neg_msg(struct delegpt* dp, struct msgreply_entry* msg)
{
struct reply_info* rep = (struct reply_info*)msg->entry.data;
if(!rep) return;
/* if error or no answers */
if(FLAGS_GET_RCODE(rep->flags) != 0 || rep->an_numrrsets == 0) {
struct delegpt_ns* ns = delegpt_find_ns(dp, msg->key.qname,
msg->key.qname_len);
if(ns) {
if(msg->key.qtype == LDNS_RR_TYPE_A)
ns->got4 = 1;
else if(msg->key.qtype == LDNS_RR_TYPE_AAAA)
ns->got6 = 1;
if(ns->got4 && ns->got6)
ns->resolved = 1;
}
}
}
+310
View File
@@ -0,0 +1,310 @@
/*
* iterator/iter_delegpt.h - delegation point with NS and address information.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file implements the Delegation Point. It contains a list of name servers
* and their addresses if known.
*/
#ifndef ITERATOR_ITER_DELEGPT_H
#define ITERATOR_ITER_DELEGPT_H
#include "util/log.h"
struct regional;
struct delegpt_ns;
struct delegpt_addr;
struct dns_msg;
struct ub_packed_rrset_key;
struct msgreply_entry;
/**
* Delegation Point.
* For a domain name, the NS rrset, and the A and AAAA records for those.
*/
struct delegpt {
/** the domain name of the delegation point. */
uint8_t* name;
/** length of the delegation point name */
size_t namelen;
/** number of labels in delegation point */
int namelabs;
/** the nameservers, names from the NS RRset rdata. */
struct delegpt_ns* nslist;
/** the target addresses for delegation */
struct delegpt_addr* target_list;
/** the list of usable targets; subset of target_list
* the items in this list are not part of the result list. */
struct delegpt_addr* usable_list;
/** the list of returned targets; subset of target_list */
struct delegpt_addr* result_list;
/** if true, the NS RRset was bogus. All info is bad. */
int bogus;
};
/**
* Nameservers for a delegation point.
*/
struct delegpt_ns {
/** next in list */
struct delegpt_ns* next;
/** name of nameserver */
uint8_t* name;
/** length of name */
size_t namelen;
/**
* If the name has been resolved. false if not queried for yet.
* true if the A, AAAA queries have been generated.
* marked true if those queries fail.
* and marked true is got4 and got6 are both true.
*/
int resolved;
/** if the ipv4 address is in the delegpt */
uint8_t got4;
/** if the ipv6 address is in the delegpt */
uint8_t got6;
};
/**
* Address of target nameserver in delegation point.
*/
struct delegpt_addr {
/** next delegation point in results */
struct delegpt_addr* next_result;
/** next delegation point in usable list */
struct delegpt_addr* next_usable;
/** next delegation point in all targets list */
struct delegpt_addr* next_target;
/** delegation point address */
struct sockaddr_storage addr;
/** length of addr */
socklen_t addrlen;
/** number of attempts for this addr */
int attempts;
/** rtt stored here in the selection algorithm */
int sel_rtt;
/** if true, the A or AAAA RR was bogus, so this address is bad.
* Also check the dp->bogus to see if everything is bogus. */
int bogus;
};
/**
* Create new delegation point.
* @param regional: where to allocate it.
* @return new delegation point or NULL on error.
*/
struct delegpt* delegpt_create(struct regional* regional);
/**
* Create a copy of a delegation point.
* @param dp: delegation point to copy.
* @param regional: where to allocate it.
* @return new delegation point or NULL on error.
*/
struct delegpt* delegpt_copy(struct delegpt* dp, struct regional* regional);
/**
* Set name of delegation point.
* @param dp: delegation point.
* @param regional: where to allocate the name copy.
* @param name: name to use.
* @return false on error.
*/
int delegpt_set_name(struct delegpt* dp, struct regional* regional,
uint8_t* name);
/**
* Add a name to the delegation point.
* @param dp: delegation point.
* @param regional: where to allocate the info.
* @param name: domain name in wire format.
* @return false on error.
*/
int delegpt_add_ns(struct delegpt* dp, struct regional* regional,
uint8_t* name);
/**
* Add NS rrset; calls add_ns repeatedly.
* @param dp: delegation point.
* @param regional: where to allocate the info.
* @param ns_rrset: NS rrset.
* return 0 on alloc error.
*/
int delegpt_rrset_add_ns(struct delegpt* dp, struct regional* regional,
struct ub_packed_rrset_key* ns_rrset);
/**
* Add target address to the delegation point.
* @param dp: delegation point.
* @param regional: where to allocate the info.
* @param name: name for which target was found (must be in nslist).
* This name is marked resolved.
* @param namelen: length of name.
* @param addr: the address.
* @param addrlen: the length of addr.
* @param bogus: security status for the address, pass true if bogus.
* @param nodup: if true, no address duplicates are made by this add.
* name duplicates are always filtered.
* @return false on error.
*/
int delegpt_add_target(struct delegpt* dp, struct regional* regional,
uint8_t* name, size_t namelen, struct sockaddr_storage* addr,
socklen_t addrlen, int bogus, int nodup);
/**
* Add A RRset to delegpt.
* @param dp: delegation point.
* @param regional: where to allocate the info.
* @param rrset: RRset A to add.
* @param nodup: if true, no duplicates are made by this add. takes time.
* @return 0 on alloc error.
*/
int delegpt_add_rrset_A(struct delegpt* dp, struct regional* regional,
struct ub_packed_rrset_key* rrset, int nodup);
/**
* Add AAAA RRset to delegpt.
* @param dp: delegation point.
* @param regional: where to allocate the info.
* @param rrset: RRset AAAA to add.
* @param nodup: if true, no duplicates are made by this add. takes time.
* @return 0 on alloc error.
*/
int delegpt_add_rrset_AAAA(struct delegpt* dp, struct regional* regional,
struct ub_packed_rrset_key* rrset, int nodup);
/**
* Add any RRset to delegpt.
* Does not check for duplicates added.
* @param dp: delegation point.
* @param regional: where to allocate the info.
* @param rrset: RRset to add, NS, A, AAAA.
* @return 0 on alloc error.
*/
int delegpt_add_rrset(struct delegpt* dp, struct regional* regional,
struct ub_packed_rrset_key* rrset);
/**
* Add address to the delegation point. No servername is associated or checked.
* @param dp: delegation point.
* @param regional: where to allocate the info.
* @param addr: the address.
* @param addrlen: the length of addr.
* @param bogus: if address is bogus.
* @param nodup: if true, no duplicates are made by this add. takes time.
* @return false on error.
*/
int delegpt_add_addr(struct delegpt* dp, struct regional* regional,
struct sockaddr_storage* addr, socklen_t addrlen, int bogus, int nodup);
/**
* Find NS record in name list of delegation point.
* @param dp: delegation point.
* @param name: name of nameserver to look for, uncompressed wireformat.
* @param namelen: length of name.
* @return the ns structure or NULL if not found.
*/
struct delegpt_ns* delegpt_find_ns(struct delegpt* dp, uint8_t* name,
size_t namelen);
/**
* Find address record in total list of delegation point.
* @param dp: delegation point.
* @param addr: address
* @param addrlen: length of addr
* @return the addr structure or NULL if not found.
*/
struct delegpt_addr* delegpt_find_addr(struct delegpt* dp,
struct sockaddr_storage* addr, socklen_t addrlen);
/**
* Print the delegation point to the log. For debugging.
* @param v: verbosity value that is needed to emit to log.
* @param dp: delegation point.
*/
void delegpt_log(enum verbosity_value v, struct delegpt* dp);
/** count NS and number missing for logging */
void delegpt_count_ns(struct delegpt* dp, size_t* numns, size_t* missing);
/** count addresses, and number in result and available lists, for logging */
void delegpt_count_addr(struct delegpt* dp, size_t* numaddr, size_t* numres,
size_t* numavail);
/**
* Add all usable targets to the result list.
* @param dp: delegation point.
*/
void delegpt_add_unused_targets(struct delegpt* dp);
/**
* Count number of missing targets. These are ns names with no resolved flag.
* @param dp: delegation point.
* @return number of missing targets (or 0).
*/
size_t delegpt_count_missing_targets(struct delegpt* dp);
/**
* Create new delegation point from a dns message
*
* Note that this method does not actually test to see if the message is an
* actual referral. It really is just checking to see if it can construct a
* delegation point, so the message could be of some other type (some ANSWER
* messages, some CNAME messages, generally.) Note that the resulting
* DelegationPoint will contain targets for all "relevant" glue (i.e.,
* address records whose ownernames match the target of one of the NS
* records), so if policy dictates that some glue should be discarded beyond
* that, discard it before calling this method. Note that this method will
* find "glue" in either the ADDITIONAL section or the ANSWER section.
*
* @param msg: the dns message, referral.
* @param regional: where to allocate delegation point.
* @return new delegation point or NULL on alloc error, or if the
* message was not appropriate.
*/
struct delegpt* delegpt_from_message(struct dns_msg* msg,
struct regional* regional);
/**
* Add negative message to delegation point.
* @param dp: delegation point.
* @param msg: the message added, marks off A or AAAA from an NS entry.
*/
void delegpt_add_neg_msg(struct delegpt* dp, struct msgreply_entry* msg);
#endif /* ITERATOR_ITER_DELEGPT_H */
+153
View File
@@ -0,0 +1,153 @@
/*
* iterator/iter_donotq.c - iterative resolver donotqueryaddresses storage.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* The donotqueryaddresses are stored and looked up. These addresses
* (like 127.0.0.1) must not be used to send queries to, and can be
* discarded immediately from the server selection.
*/
#include "config.h"
#include "iterator/iter_donotq.h"
#include "util/regional.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/net_help.h"
struct iter_donotq*
donotq_create()
{
struct iter_donotq* dq = (struct iter_donotq*)calloc(1,
sizeof(struct iter_donotq));
if(!dq)
return NULL;
dq->region = regional_create();
if(!dq->region) {
donotq_delete(dq);
return NULL;
}
return dq;
}
void
donotq_delete(struct iter_donotq* dq)
{
if(!dq)
return;
regional_destroy(dq->region);
free(dq);
}
/** insert new address into donotq structure */
static int
donotq_insert(struct iter_donotq* dq, struct sockaddr_storage* addr,
socklen_t addrlen, int net)
{
struct addr_tree_node* node = (struct addr_tree_node*)regional_alloc(
dq->region, sizeof(*node));
if(!node)
return 0;
if(!addr_tree_insert(&dq->tree, node, addr, addrlen, net)) {
verbose(VERB_QUERY, "duplicate donotquery address ignored.");
}
return 1;
}
/** apply donotq string */
static int
donotq_str_cfg(struct iter_donotq* dq, const char* str)
{
struct sockaddr_storage addr;
int net;
socklen_t addrlen;
verbose(VERB_ALGO, "donotq: %s", str);
if(!netblockstrtoaddr(str, UNBOUND_DNS_PORT, &addr, &addrlen, &net)) {
log_err("cannot parse donotquery netblock: %s", str);
return 0;
}
if(!donotq_insert(dq, &addr, addrlen, net)) {
log_err("out of memory");
return 0;
}
return 1;
}
/** read donotq config */
static int
read_donotq(struct iter_donotq* dq, struct config_file* cfg)
{
struct config_strlist* p;
for(p = cfg->donotqueryaddrs; p; p = p->next) {
log_assert(p->str);
if(!donotq_str_cfg(dq, p->str))
return 0;
}
return 1;
}
int
donotq_apply_cfg(struct iter_donotq* dq, struct config_file* cfg)
{
regional_free_all(dq->region);
addr_tree_init(&dq->tree);
if(!read_donotq(dq, cfg))
return 0;
if(cfg->donotquery_localhost) {
if(!donotq_str_cfg(dq, "127.0.0.0/8"))
return 0;
if(cfg->do_ip6) {
if(!donotq_str_cfg(dq, "::1"))
return 0;
}
}
addr_tree_init_parents(&dq->tree);
return 1;
}
int
donotq_lookup(struct iter_donotq* donotq, struct sockaddr_storage* addr,
socklen_t addrlen)
{
return addr_tree_lookup(&donotq->tree, addr, addrlen) != NULL;
}
size_t
donotq_get_mem(struct iter_donotq* donotq)
{
if(!donotq) return 0;
return sizeof(*donotq) + regional_get_mem(donotq->region);
}
+101
View File
@@ -0,0 +1,101 @@
/*
* iterator/iter_donotq.h - iterative resolver donotqueryaddresses storage.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of the donotquery addresses and lookup fast.
*/
#ifndef ITERATOR_ITER_DONOTQ_H
#define ITERATOR_ITER_DONOTQ_H
#include "util/storage/dnstree.h"
struct iter_env;
struct config_file;
struct regional;
/**
* Iterator donotqueryaddresses structure
*/
struct iter_donotq {
/** regional for allocation */
struct regional* region;
/**
* Tree of the address spans that are blocked.
* contents of type addr_tree_node. Each node is an address span
* that must not be used to send queries to.
*/
rbtree_t tree;
};
/**
* Create donotqueryaddresses structure
* @return new structure or NULL on error.
*/
struct iter_donotq* donotq_create();
/**
* Delete donotqueryaddresses structure.
* @param donotq: to delete.
*/
void donotq_delete(struct iter_donotq* donotq);
/**
* Process donotqueryaddresses config.
* @param donotq: where to store.
* @param cfg: config options.
* @return 0 on error.
*/
int donotq_apply_cfg(struct iter_donotq* donotq, struct config_file* cfg);
/**
* See if an address is blocked.
* @param donotq: structure for address storage.
* @param addr: address to check
* @param addrlen: length of addr.
* @return: true if the address must not be queried. false if unlisted.
*/
int donotq_lookup(struct iter_donotq* donotq, struct sockaddr_storage* addr,
socklen_t addrlen);
/**
* Get memory used by donotqueryaddresses structure.
* @param donotq: structure for address storage.
* @return bytes in use.
*/
size_t donotq_get_mem(struct iter_donotq* donotq);
#endif /* ITERATOR_ITER_DONOTQ_H */
+386
View File
@@ -0,0 +1,386 @@
/*
* iterator/iter_fwd.c - iterative resolver module forward zones.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of forward zones and config settings.
*/
#include "config.h"
#include "iterator/iter_fwd.h"
#include "iterator/iter_delegpt.h"
#include "util/regional.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/net_help.h"
#include "util/data/dname.h"
int
fwd_cmp(const void* k1, const void* k2)
{
int m;
struct iter_forward_zone* n1 = (struct iter_forward_zone*)k1;
struct iter_forward_zone* n2 = (struct iter_forward_zone*)k2;
if(n1->dclass != n2->dclass) {
if(n1->dclass < n2->dclass)
return -1;
return 1;
}
return dname_lab_cmp(n1->name, n1->namelabs, n2->name, n2->namelabs,
&m);
}
struct iter_forwards*
forwards_create()
{
struct iter_forwards* fwd = (struct iter_forwards*)calloc(1,
sizeof(struct iter_forwards));
if(!fwd)
return NULL;
fwd->region = regional_create();
if(!fwd->region) {
forwards_delete(fwd);
return NULL;
}
return fwd;
}
void
forwards_delete(struct iter_forwards* fwd)
{
if(!fwd)
return;
regional_destroy(fwd->region);
free(fwd->tree);
free(fwd);
}
/** insert info into forward structure */
static int
forwards_insert_data(struct iter_forwards* fwd, uint16_t c, uint8_t* nm,
size_t nmlen, int nmlabs, struct delegpt* dp)
{
struct iter_forward_zone* node = regional_alloc(fwd->region,
sizeof(struct iter_forward_zone));
if(!node)
return 0;
node->node.key = node;
node->dclass = c;
node->name = regional_alloc_init(fwd->region, nm, nmlen);
if(!node->name)
return 0;
node->namelen = nmlen;
node->namelabs = nmlabs;
node->dp = dp;
if(!rbtree_insert(fwd->tree, &node->node)) {
log_err("duplicate forward zone ignored.");
}
return 1;
}
/** insert new info into forward structure given dp */
static int
forwards_insert(struct iter_forwards* fwd, uint16_t c, struct delegpt* dp)
{
return forwards_insert_data(fwd, c, dp->name, dp->namelen,
dp->namelabs, dp);
}
/** initialise parent pointers in the tree */
static void
fwd_init_parents(struct iter_forwards* fwd)
{
struct iter_forward_zone* node, *prev = NULL, *p;
int m;
RBTREE_FOR(node, struct iter_forward_zone*, fwd->tree) {
node->parent = NULL;
if(!prev || prev->dclass != node->dclass) {
prev = node;
continue;
}
(void)dname_lab_cmp(prev->name, prev->namelabs, node->name,
node->namelabs, &m); /* we know prev is smaller */
/* sort order like: . com. bla.com. zwb.com. net. */
/* find the previous, or parent-parent-parent */
for(p = prev; p; p = p->parent)
/* looking for name with few labels, a parent */
if(p->namelabs <= m) {
/* ==: since prev matched m, this is closest*/
/* <: prev matches more, but is not a parent,
* this one is a (grand)parent */
node->parent = p;
break;
}
prev = node;
}
}
/** set zone name */
static int
read_fwds_name(struct iter_forwards* fwd, struct config_stub* s,
struct delegpt* dp)
{
ldns_rdf* rdf;
if(!s->name) {
log_err("forward zone without a name (use name \".\" to forward everything)");
return 0;
}
rdf = ldns_dname_new_frm_str(s->name);
if(!rdf) {
log_err("cannot parse forward zone name %s", s->name);
return 0;
}
if(!delegpt_set_name(dp, fwd->region, ldns_rdf_data(rdf))) {
ldns_rdf_deep_free(rdf);
log_err("out of memory");
return 0;
}
ldns_rdf_deep_free(rdf);
return 1;
}
/** set fwd host names */
static int
read_fwds_host(struct iter_forwards* fwd, struct config_stub* s,
struct delegpt* dp)
{
struct config_strlist* p;
ldns_rdf* rdf;
for(p = s->hosts; p; p = p->next) {
log_assert(p->str);
rdf = ldns_dname_new_frm_str(p->str);
if(!rdf) {
log_err("cannot parse forward %s server name: '%s'",
s->name, p->str);
return 0;
}
if(!delegpt_add_ns(dp, fwd->region, ldns_rdf_data(rdf))) {
ldns_rdf_deep_free(rdf);
log_err("out of memory");
return 0;
}
ldns_rdf_deep_free(rdf);
}
return 1;
}
/** set fwd server addresses */
static int
read_fwds_addr(struct iter_forwards* fwd, struct config_stub* s,
struct delegpt* dp)
{
struct config_strlist* p;
struct sockaddr_storage addr;
socklen_t addrlen;
for(p = s->addrs; p; p = p->next) {
log_assert(p->str);
if(!extstrtoaddr(p->str, &addr, &addrlen)) {
log_err("cannot parse forward %s ip address: '%s'",
s->name, p->str);
return 0;
}
if(!delegpt_add_addr(dp, fwd->region, &addr, addrlen, 0, 1)) {
log_err("out of memory");
return 0;
}
}
return 1;
}
/** read forwards config */
static int
read_forwards(struct iter_forwards* fwd, struct config_file* cfg)
{
struct config_stub* s;
for(s = cfg->forwards; s; s = s->next) {
struct delegpt* dp = delegpt_create(fwd->region);
if(!dp) {
log_err("out of memory");
return 0;
}
if(!read_fwds_name(fwd, s, dp) ||
!read_fwds_host(fwd, s, dp) ||
!read_fwds_addr(fwd, s, dp))
return 0;
if(!forwards_insert(fwd, LDNS_RR_CLASS_IN, dp))
return 0;
verbose(VERB_QUERY, "Forward zone server list:");
delegpt_log(VERB_QUERY, dp);
}
return 1;
}
/** see if zone needs to have a hole inserted */
static int
need_hole_insert(rbtree_t* tree, struct iter_forward_zone* zone)
{
struct iter_forward_zone k;
if(rbtree_search(tree, zone))
return 0; /* exact match exists */
k = *zone;
k.node.key = &k;
/* search up the tree */
do {
dname_remove_label(&k.name, &k.namelen);
k.namelabs --;
if(rbtree_search(tree, &k))
return 1; /* found an upper forward zone, need hole */
} while(k.namelabs > 1);
return 0; /* no forwards above, no holes needed */
}
/** make NULL entries for stubs */
static int
make_stub_holes(struct iter_forwards* fwd, struct config_file* cfg)
{
struct config_stub* s;
struct iter_forward_zone key;
key.node.key = &key;
key.dclass = LDNS_RR_CLASS_IN;
for(s = cfg->stubs; s; s = s->next) {
ldns_rdf* rdf = ldns_dname_new_frm_str(s->name);
if(!rdf) {
log_err("cannot parse stub name '%s'", s->name);
return 0;
}
key.name = ldns_rdf_data(rdf);
key.namelabs = dname_count_size_labels(key.name, &key.namelen);
if(!need_hole_insert(fwd->tree, &key)) {
ldns_rdf_deep_free(rdf);
continue;
}
if(!forwards_insert_data(fwd, key.dclass, key.name,
key.namelen, key.namelabs, NULL)) {
ldns_rdf_deep_free(rdf);
log_err("out of memory");
return 0;
}
ldns_rdf_deep_free(rdf);
}
return 1;
}
int
forwards_apply_cfg(struct iter_forwards* fwd, struct config_file* cfg)
{
free(fwd->tree);
regional_free_all(fwd->region);
fwd->tree = rbtree_create(fwd_cmp);
if(!fwd->tree)
return 0;
/* read forward zones */
if(!read_forwards(fwd, cfg))
return 0;
if(!make_stub_holes(fwd, cfg))
return 0;
fwd_init_parents(fwd);
return 1;
}
struct delegpt*
forwards_lookup(struct iter_forwards* fwd, uint8_t* qname, uint16_t qclass)
{
/* lookup the forward zone in the tree */
rbnode_t* res = NULL;
struct iter_forward_zone *result;
struct iter_forward_zone key;
key.node.key = &key;
key.dclass = qclass;
key.name = qname;
key.namelabs = dname_count_size_labels(qname, &key.namelen);
if(rbtree_find_less_equal(fwd->tree, &key, &res)) {
/* exact */
result = (struct iter_forward_zone*)res;
} else {
/* smaller element (or no element) */
int m;
result = (struct iter_forward_zone*)res;
if(!result || result->dclass != qclass)
return NULL;
/* count number of labels matched */
(void)dname_lab_cmp(result->name, result->namelabs, key.name,
key.namelabs, &m);
while(result) { /* go up until qname is subdomain of stub */
if(result->namelabs <= m)
break;
result = result->parent;
}
}
if(result)
return result->dp;
return NULL;
}
struct delegpt*
forwards_lookup_root(struct iter_forwards* fwd, uint16_t qclass)
{
uint8_t root = 0;
return forwards_lookup(fwd, &root, qclass);
}
size_t
forwards_get_mem(struct iter_forwards* fwd)
{
if(!fwd)
return 0;
return sizeof(*fwd) + sizeof(*fwd->tree) +
regional_get_mem(fwd->region);
}
int
forwards_add_zone(struct iter_forwards* fwd, uint16_t c, struct delegpt* dp)
{
if(!forwards_insert(fwd, c, dp))
return 0;
fwd_init_parents(fwd);
return 1;
}
void
forwards_delete_zone(struct iter_forwards* fwd, uint16_t c, uint8_t* nm)
{
struct iter_forward_zone key;
key.node.key = &key;
key.dclass = c;
key.name = nm;
key.namelabs = dname_count_size_labels(nm, &key.namelen);
if(!rbtree_search(fwd->tree, &key))
return; /* nothing to do */
(void)rbtree_delete(fwd->tree, &key);
fwd_init_parents(fwd);
}
+165
View File
@@ -0,0 +1,165 @@
/*
* iterator/iter_fwd.h - iterative resolver module forward zones.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of forward zones, and read those from config.
*/
#ifndef ITERATOR_ITER_FWD_H
#define ITERATOR_ITER_FWD_H
#include "util/rbtree.h"
struct config_file;
struct delegpt;
struct regional;
/**
* Iterator forward zones structure
*/
struct iter_forwards {
/** regional where forward zone server addresses are allocated */
struct regional* region;
/**
* Zones are stored in this tree. Sort order is specially chosen.
* first sorted on qtype. Then on dname in nsec-like order, so that
* a lookup on class, name will return an exact match or the closest
* match which gives the ancestor needed.
* contents of type iter_forward_zone.
*/
rbtree_t* tree;
};
/**
* Iterator forward servers for a particular zone.
*/
struct iter_forward_zone {
/** redblacktree node, key is this structure: class and name */
rbnode_t node;
/** name */
uint8_t* name;
/** length of name */
size_t namelen;
/** number of labels in name */
int namelabs;
/** delegation point with forward server information for this zone.
* If NULL then this forward entry is used to indicate that a
* stub-zone with the same name exists, and should be used. */
struct delegpt* dp;
/** pointer to parent in tree (or NULL if none) */
struct iter_forward_zone* parent;
/** class. host order. */
uint16_t dclass;
};
/**
* Create forwards
* @return new forwards or NULL on error.
*/
struct iter_forwards* forwards_create();
/**
* Delete forwards.
* @param fwd: to delete.
*/
void forwards_delete(struct iter_forwards* fwd);
/**
* Process forwards config.
* @param fwd: where to store.
* @param cfg: config options.
* @return 0 on error.
*/
int forwards_apply_cfg(struct iter_forwards* fwd, struct config_file* cfg);
/**
* Find forward zone information
* For this qname/qclass find forward zone information, returns delegation
* point with server names and addresses, or NULL if no forwarding is needed.
*
* @param fwd: forward storage.
* @param qname: The qname of the query.
* @param qclass: The qclass of the query.
* @return: A delegation point if the query has to be forwarded to that list,
* otherwise null.
*/
struct delegpt* forwards_lookup(struct iter_forwards* fwd,
uint8_t* qname, uint16_t qclass);
/**
* Same as forwards_lookup, but for the root only
* @param fwd: forward storage.
* @param qclass: The qclass of the query.
* @return: A delegation point if root forward exists, otherwise null.
*/
struct delegpt* forwards_lookup_root(struct iter_forwards* fwd,
uint16_t qclass);
/**
* Get memory in use by forward storage
* @param fwd: forward storage.
* @return bytes in use
*/
size_t forwards_get_mem(struct iter_forwards* fwd);
/** compare two fwd entries */
int fwd_cmp(const void* k1, const void* k2);
/**
* Add zone to forward structure. For external use since it recalcs
* the tree parents.
* @param fwd: the forward data structure
* @param c: class of zone
* @param dp: delegation point with name and target nameservers for new
* forward zone. This delegation point and all its data must be
* malloced in the fwd->region. (then it is freed when the fwd is
* deleted).
* @return false on failure (out of memory);
*/
int forwards_add_zone(struct iter_forwards* fwd, uint16_t c,
struct delegpt* dp);
/**
* Remove zone from forward structure. For external use since it
* recalcs the tree parents. Does not actually release any memory, the region
* is unchanged.
* @param fwd: the forward data structure
* @param c: class of zone
* @param nm: name of zone (in uncompressed wireformat).
*/
void forwards_delete_zone(struct iter_forwards* fwd, uint16_t c, uint8_t* nm);
#endif /* ITERATOR_ITER_FWD_H */
+469
View File
@@ -0,0 +1,469 @@
/*
* iterator/iter_hints.c - iterative resolver module stub and root hints.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of stub and root hints, and read those from config.
*/
#include "config.h"
#include "iterator/iter_hints.h"
#include "iterator/iter_delegpt.h"
#include "util/regional.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/net_help.h"
#include "util/data/dname.h"
struct iter_hints*
hints_create()
{
struct iter_hints* hints = (struct iter_hints*)calloc(1,
sizeof(struct iter_hints));
if(!hints)
return NULL;
hints->region = regional_create();
if(!hints->region) {
hints_delete(hints);
return NULL;
}
return hints;
}
void
hints_delete(struct iter_hints* hints)
{
if(!hints)
return;
regional_destroy(hints->region);
free(hints);
}
/** add hint to delegation hints */
static int
ah(struct delegpt* dp, struct regional* r, const char* sv, const char* ip)
{
struct sockaddr_storage addr;
socklen_t addrlen;
ldns_rdf* rdf = ldns_dname_new_frm_str(sv);
if(!rdf) {
log_err("could not parse %s", sv);
return 0;
}
if(!delegpt_add_ns(dp, r, ldns_rdf_data(rdf)) ||
!extstrtoaddr(ip, &addr, &addrlen) ||
!delegpt_add_target(dp, r, ldns_rdf_data(rdf), ldns_rdf_size(rdf),
&addr, addrlen, 0, 1)) {
ldns_rdf_deep_free(rdf);
return 0;
}
ldns_rdf_deep_free(rdf);
return 1;
}
/** obtain compiletime provided root hints */
static struct delegpt*
compile_time_root_prime(struct regional* r, int do_ip4, int do_ip6)
{
/* from:
; This file is made available by InterNIC
; under anonymous FTP as
; file /domain/named.cache
; on server FTP.INTERNIC.NET
; -OR- RS.INTERNIC.NET
;
; related version of root zone: 2008051300
*/
struct delegpt* dp = delegpt_create(r);
if(!dp)
return NULL;
if(!delegpt_set_name(dp, r, (uint8_t*)"\000"))
return NULL;
if(do_ip4) {
if(!ah(dp, r, "A.ROOT-SERVERS.NET.", "198.41.0.4")) return 0;
if(!ah(dp, r, "B.ROOT-SERVERS.NET.", "192.228.79.201")) return 0;
if(!ah(dp, r, "C.ROOT-SERVERS.NET.", "192.33.4.12")) return 0;
if(!ah(dp, r, "D.ROOT-SERVERS.NET.", "128.8.10.90")) return 0;
if(!ah(dp, r, "E.ROOT-SERVERS.NET.", "192.203.230.10")) return 0;
if(!ah(dp, r, "F.ROOT-SERVERS.NET.", "192.5.5.241")) return 0;
if(!ah(dp, r, "G.ROOT-SERVERS.NET.", "192.112.36.4")) return 0;
if(!ah(dp, r, "H.ROOT-SERVERS.NET.", "128.63.2.53")) return 0;
if(!ah(dp, r, "I.ROOT-SERVERS.NET.", "192.36.148.17")) return 0;
if(!ah(dp, r, "J.ROOT-SERVERS.NET.", "192.58.128.30")) return 0;
if(!ah(dp, r, "K.ROOT-SERVERS.NET.", "193.0.14.129")) return 0;
if(!ah(dp, r, "L.ROOT-SERVERS.NET.", "199.7.83.42")) return 0;
if(!ah(dp, r, "M.ROOT-SERVERS.NET.", "202.12.27.33")) return 0;
}
if(do_ip6) {
if(!ah(dp, r, "A.ROOT-SERVERS.NET.", "2001:503:ba3e::2:30")) return 0;
if(!ah(dp, r, "F.ROOT-SERVERS.NET.", "2001:500:2f::f")) return 0;
if(!ah(dp, r, "H.ROOT-SERVERS.NET.", "2001:500:1::803f:235")) return 0;
if(!ah(dp, r, "J.ROOT-SERVERS.NET.", "2001:503:c27::2:30")) return 0;
if(!ah(dp, r, "K.ROOT-SERVERS.NET.", "2001:7fd::1")) return 0;
if(!ah(dp, r, "L.ROOT-SERVERS.NET.", "2001:500:3::42")) return 0;
if(!ah(dp, r, "M.ROOT-SERVERS.NET.", "2001:dc3::35")) return 0;
}
return dp;
}
/** insert new hint info into hint structure */
static int
hints_insert(struct iter_hints* hints, uint16_t c, struct delegpt* dp,
int noprime)
{
struct iter_hints_stub* node = regional_alloc(hints->region,
sizeof(struct iter_hints_stub));
uint8_t* nm;
if(!node)
return 0;
nm = regional_alloc_init(hints->region, dp->name, dp->namelen);
if(!nm)
return 0;
node->dp = dp;
node->noprime = (uint8_t)noprime;
if(!name_tree_insert(&hints->tree, &node->node, nm, dp->namelen,
dp->namelabs, c)) {
log_err("second hints ignored.");
}
return 1;
}
/** set stub name */
static int
read_stubs_name(struct iter_hints* hints, struct config_stub* s,
struct delegpt* dp)
{
ldns_rdf* rdf;
if(!s->name) {
log_err("stub zone without a name");
return 0;
}
rdf = ldns_dname_new_frm_str(s->name);
if(!rdf) {
log_err("cannot parse stub zone name %s", s->name);
return 0;
}
if(!delegpt_set_name(dp, hints->region, ldns_rdf_data(rdf))) {
ldns_rdf_deep_free(rdf);
log_err("out of memory");
return 0;
}
ldns_rdf_deep_free(rdf);
return 1;
}
/** set stub host names */
static int
read_stubs_host(struct iter_hints* hints, struct config_stub* s,
struct delegpt* dp)
{
struct config_strlist* p;
ldns_rdf* rdf;
for(p = s->hosts; p; p = p->next) {
log_assert(p->str);
rdf = ldns_dname_new_frm_str(p->str);
if(!rdf) {
log_err("cannot parse stub %s nameserver name: '%s'",
s->name, p->str);
return 0;
}
if(!delegpt_add_ns(dp, hints->region, ldns_rdf_data(rdf))) {
ldns_rdf_deep_free(rdf);
log_err("out of memory");
return 0;
}
ldns_rdf_deep_free(rdf);
}
return 1;
}
/** set stub server addresses */
static int
read_stubs_addr(struct iter_hints* hints, struct config_stub* s,
struct delegpt* dp)
{
struct config_strlist* p;
struct sockaddr_storage addr;
socklen_t addrlen;
for(p = s->addrs; p; p = p->next) {
log_assert(p->str);
if(!extstrtoaddr(p->str, &addr, &addrlen)) {
log_err("cannot parse stub %s ip address: '%s'",
s->name, p->str);
return 0;
}
if(!delegpt_add_addr(dp, hints->region, &addr, addrlen, 0, 1)) {
log_err("out of memory");
return 0;
}
}
return 1;
}
/** read stubs config */
static int
read_stubs(struct iter_hints* hints, struct config_file* cfg)
{
struct config_stub* s;
for(s = cfg->stubs; s; s = s->next) {
struct delegpt* dp = delegpt_create(hints->region);
if(!dp) {
log_err("out of memory");
return 0;
}
if(!read_stubs_name(hints, s, dp) ||
!read_stubs_host(hints, s, dp) ||
!read_stubs_addr(hints, s, dp))
return 0;
if(!hints_insert(hints, LDNS_RR_CLASS_IN, dp, !s->isprime))
return 0;
delegpt_log(VERB_QUERY, dp);
}
return 1;
}
/** read root hints from file */
static int
read_root_hints(struct iter_hints* hints, char* fname)
{
int lineno = 0;
uint32_t default_ttl = 0;
ldns_rdf* origin = NULL;
ldns_rdf* prev_rr = NULL;
struct delegpt* dp;
ldns_rr* rr = NULL;
ldns_status status;
uint16_t c = LDNS_RR_CLASS_IN;
FILE* f = fopen(fname, "r");
if(!f) {
log_err("could not read root hints %s: %s",
fname, strerror(errno));
return 0;
}
dp = delegpt_create(hints->region);
if(!dp) {
log_err("out of memory reading root hints");
fclose(f);
return 0;
}
verbose(VERB_QUERY, "Reading root hints from %s", fname);
while(!feof(f)) {
status = ldns_rr_new_frm_fp_l(&rr, f,
&default_ttl, &origin, &prev_rr, &lineno);
if(status == LDNS_STATUS_SYNTAX_EMPTY ||
status == LDNS_STATUS_SYNTAX_TTL ||
status == LDNS_STATUS_SYNTAX_ORIGIN)
continue;
if(status != LDNS_STATUS_OK) {
log_err("reading root hints %s %d: %s", fname,
lineno, ldns_get_errorstr_by_id(status));
goto stop_read;
}
if(ldns_rr_get_type(rr) == LDNS_RR_TYPE_NS) {
if(!delegpt_add_ns(dp, hints->region,
ldns_rdf_data(ldns_rr_rdf(rr, 0)))) {
log_err("out of memory reading root hints");
goto stop_read;
}
c = ldns_rr_get_class(rr);
if(!dp->name) {
if(!delegpt_set_name(dp, hints->region,
ldns_rdf_data(ldns_rr_owner(rr)))){
log_err("out of memory.");
goto stop_read;
}
}
} else if(ldns_rr_get_type(rr) == LDNS_RR_TYPE_A) {
struct sockaddr_in sa;
socklen_t len = (socklen_t)sizeof(sa);
memset(&sa, 0, len);
sa.sin_family = AF_INET;
sa.sin_port = (in_port_t)htons(UNBOUND_DNS_PORT);
memmove(&sa.sin_addr,
ldns_rdf_data(ldns_rr_rdf(rr, 0)), INET_SIZE);
if(!delegpt_add_target(dp, hints->region,
ldns_rdf_data(ldns_rr_owner(rr)),
ldns_rdf_size(ldns_rr_owner(rr)),
(struct sockaddr_storage*)&sa, len,
0, 1)) {
log_err("out of memory reading root hints");
goto stop_read;
}
} else if(ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) {
struct sockaddr_in6 sa;
socklen_t len = (socklen_t)sizeof(sa);
memset(&sa, 0, len);
sa.sin6_family = AF_INET6;
sa.sin6_port = (in_port_t)htons(UNBOUND_DNS_PORT);
memmove(&sa.sin6_addr,
ldns_rdf_data(ldns_rr_rdf(rr, 0)), INET6_SIZE);
if(!delegpt_add_target(dp, hints->region,
ldns_rdf_data(ldns_rr_owner(rr)),
ldns_rdf_size(ldns_rr_owner(rr)),
(struct sockaddr_storage*)&sa, len,
0, 1)) {
log_err("out of memory reading root hints");
goto stop_read;
}
} else {
log_warn("root hints %s:%d skipping type %d",
fname, lineno, ldns_rr_get_type(rr));
}
ldns_rr_free(rr);
}
if (origin)
ldns_rdf_deep_free(origin);
if (prev_rr)
ldns_rdf_deep_free(prev_rr);
fclose(f);
if(!dp->name) {
log_warn("root hints %s: no NS content", fname);
return 1;
}
if(!hints_insert(hints, c, dp, 0)) {
return 0;
}
delegpt_log(VERB_QUERY, dp);
return 1;
stop_read:
if (origin)
ldns_rdf_deep_free(origin);
if (prev_rr)
ldns_rdf_deep_free(prev_rr);
fclose(f);
return 0;
}
/** read root hints list */
static int
read_root_hints_list(struct iter_hints* hints, struct config_file* cfg)
{
struct config_strlist* p;
for(p = cfg->root_hints; p; p = p->next) {
log_assert(p->str);
if(p->str && p->str[0]) {
char* f = p->str;
if(cfg->chrootdir && cfg->chrootdir[0] &&
strncmp(p->str, cfg->chrootdir,
strlen(cfg->chrootdir)) == 0)
f += strlen(cfg->chrootdir);
if(!read_root_hints(hints, f))
return 0;
}
}
return 1;
}
int
hints_apply_cfg(struct iter_hints* hints, struct config_file* cfg)
{
regional_free_all(hints->region);
name_tree_init(&hints->tree);
/* read root hints */
if(!read_root_hints_list(hints, cfg))
return 0;
/* read stub hints */
if(!read_stubs(hints, cfg))
return 0;
/* use fallback compiletime root hints */
if(!hints_lookup_root(hints, LDNS_RR_CLASS_IN)) {
struct delegpt* dp = compile_time_root_prime(hints->region,
cfg->do_ip4, cfg->do_ip6);
verbose(VERB_ALGO, "no config, using builtin root hints.");
if(!dp)
return 0;
if(!hints_insert(hints, LDNS_RR_CLASS_IN, dp, 0))
return 0;
}
name_tree_init_parents(&hints->tree);
return 1;
}
struct delegpt*
hints_lookup_root(struct iter_hints* hints, uint16_t qclass)
{
uint8_t rootlab = 0;
struct iter_hints_stub *stub;
stub = (struct iter_hints_stub*)name_tree_find(&hints->tree,
&rootlab, 1, 1, qclass);
if(!stub)
return NULL;
return stub->dp;
}
struct iter_hints_stub*
hints_lookup_stub(struct iter_hints* hints, uint8_t* qname,
uint16_t qclass, struct delegpt* cache_dp)
{
size_t len;
int labs;
struct iter_hints_stub *r;
/* first lookup the stub */
labs = dname_count_size_labels(qname, &len);
r = (struct iter_hints_stub*)name_tree_lookup(&hints->tree, qname,
len, labs, qclass);
if(!r) return NULL;
/*
* If the stub is same as the delegation we got
* And has noprime set, we need to 'prime' to use this stub instead.
*/
if(r->noprime && query_dname_compare(cache_dp->name, r->dp->name)==0)
return r; /* use this stub instead of cached dp */
/*
* If our cached delegation point is above the hint, we need to prime.
*/
if(dname_strict_subdomain(r->dp->name, r->dp->namelabs,
cache_dp->name, cache_dp->namelabs))
return r; /* need to prime this stub */
return NULL;
}
size_t
hints_get_mem(struct iter_hints* hints)
{
if(!hints) return 0;
return sizeof(*hints) + regional_get_mem(hints->region);
}
+130
View File
@@ -0,0 +1,130 @@
/*
* iterator/iter_hints.h - iterative resolver module stub and root hints.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of stub and root hints, and read those from config.
*/
#ifndef ITERATOR_ITER_HINTS_H
#define ITERATOR_ITER_HINTS_H
#include "util/storage/dnstree.h"
struct iter_env;
struct config_file;
struct delegpt;
struct regional;
/**
* Iterator hints structure
*/
struct iter_hints {
/** regional where hints are allocated */
struct regional* region;
/**
* Hints are stored in this tree. Sort order is specially chosen.
* first sorted on qtype. Then on dname in nsec-like order, so that
* a lookup on class, name will return an exact match or the closest
* match which gives the ancestor needed.
* contents of type iter_hints_stub. The class IN root is in here.
* uses name_tree_node from dnstree.h.
*/
rbtree_t tree;
};
/**
* Iterator hints for a particular stub.
*/
struct iter_hints_stub {
/** tree sorted by name, class */
struct name_tree_node node;
/** delegation point with hint information for this stub. */
struct delegpt* dp;
/** does the stub need to forego priming (like on other ports) */
uint8_t noprime;
};
/**
* Create hints
* @return new hints or NULL on error.
*/
struct iter_hints* hints_create();
/**
* Delete hints.
* @param hints: to delete.
*/
void hints_delete(struct iter_hints* hints);
/**
* Process hints config. Sets default values for root hints if no config.
* @param hints: where to store.
* @param cfg: config options.
* @return 0 on error.
*/
int hints_apply_cfg(struct iter_hints* hints, struct config_file* cfg);
/**
* Find root hints for the given class.
* @param hints: hint storage.
* @param qclass: class for which root hints are requested. host order.
* @return: NULL if no hints, or a ptr to stored hints.
*/
struct delegpt* hints_lookup_root(struct iter_hints* hints, uint16_t qclass);
/**
* Given a qname/qclass combination, and the delegation point from the cache
* for this qname/qclass, determine if this combination indicates that a
* stub hint exists and must be primed.
*
* @param hints: hint storage.
* @param qname: The qname that generated the delegation point.
* @param qclass: The qclass that generated the delegation point.
* @param dp: The cache generated delegation point.
* @return: A priming delegation point if there is a stub hint that must
* be primed, otherwise null.
*/
struct iter_hints_stub* hints_lookup_stub(struct iter_hints* hints,
uint8_t* qname, uint16_t qclass, struct delegpt* dp);
/**
* Get memory in use by hints
* @param hints: hint storage.
* @return bytes in use
*/
size_t hints_get_mem(struct iter_hints* hints);
#endif /* ITERATOR_ITER_HINTS_H */
+262
View File
@@ -0,0 +1,262 @@
/*
* iterator/iter_priv.c - iterative resolver private address and domain store
*
* Copyright (c) 2008, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of the private addresses and lookup fast.
*/
#include "config.h"
#include "iterator/iter_priv.h"
#include "util/regional.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/data/dname.h"
#include "util/data/msgparse.h"
#include "util/net_help.h"
#include "util/storage/dnstree.h"
struct iter_priv* priv_create()
{
struct iter_priv* priv = (struct iter_priv*)calloc(1, sizeof(*priv));
if(!priv)
return NULL;
priv->region = regional_create();
if(!priv->region) {
priv_delete(priv);
return NULL;
}
addr_tree_init(&priv->a);
name_tree_init(&priv->n);
return priv;
}
void priv_delete(struct iter_priv* priv)
{
if(!priv) return;
regional_destroy(priv->region);
free(priv);
}
/** Read private-addr declarations from config */
static int read_addrs(struct iter_priv* priv, struct config_file* cfg)
{
/* parse addresses, report errors, insert into tree */
struct config_strlist* p;
struct addr_tree_node* n;
struct sockaddr_storage addr;
int net;
socklen_t addrlen;
for(p = cfg->private_address; p; p = p->next) {
log_assert(p->str);
if(!netblockstrtoaddr(p->str, UNBOUND_DNS_PORT, &addr,
&addrlen, &net)) {
log_err("cannot parse private-address: %s", p->str);
return 0;
}
n = (struct addr_tree_node*)regional_alloc(priv->region,
sizeof(*n));
if(!n) {
log_err("out of memory");
return 0;
}
if(!addr_tree_insert(&priv->a, n, &addr, addrlen, net)) {
verbose(VERB_QUERY, "ignoring duplicate "
"private-address: %s", p->str);
}
}
return 1;
}
/** Read private-domain declarations from config */
static int read_names(struct iter_priv* priv, struct config_file* cfg)
{
/* parse names, report errors, insert into tree */
struct config_strlist* p;
struct name_tree_node* n;
uint8_t* nm;
size_t nm_len;
int nm_labs;
ldns_rdf* rdf;
for(p = cfg->private_domain; p; p = p->next) {
log_assert(p->str);
rdf = ldns_dname_new_frm_str(p->str);
if(!rdf) {
log_err("cannot parse private-domain: %s", p->str);
return 0;
}
nm = ldns_rdf_data(rdf);
nm_labs = dname_count_size_labels(nm, &nm_len);
nm = (uint8_t*)regional_alloc_init(priv->region, nm, nm_len);
ldns_rdf_deep_free(rdf);
if(!nm) {
log_err("out of memory");
return 0;
}
n = (struct name_tree_node*)regional_alloc(priv->region,
sizeof(*n));
if(!n) {
log_err("out of memory");
return 0;
}
if(!name_tree_insert(&priv->n, n, nm, nm_len, nm_labs,
LDNS_RR_CLASS_IN)) {
verbose(VERB_QUERY, "ignoring duplicate "
"private-domain: %s", p->str);
}
}
return 1;
}
int priv_apply_cfg(struct iter_priv* priv, struct config_file* cfg)
{
/* empty the current contents */
regional_free_all(priv->region);
addr_tree_init(&priv->a);
name_tree_init(&priv->n);
/* read new contents */
if(!read_addrs(priv, cfg))
return 0;
if(!read_names(priv, cfg))
return 0;
/* prepare for lookups */
addr_tree_init_parents(&priv->a);
name_tree_init_parents(&priv->n);
return 1;
}
/**
* See if an address is blocked.
* @param priv: structure for address storage.
* @param addr: address to check
* @param addrlen: length of addr.
* @return: true if the address must not be queried. false if unlisted.
*/
static int
priv_lookup_addr(struct iter_priv* priv, struct sockaddr_storage* addr,
socklen_t addrlen)
{
return addr_tree_lookup(&priv->a, addr, addrlen) != NULL;
}
/**
* See if a name is whitelisted.
* @param priv: structure for address storage.
* @param pkt: the packet (for compression ptrs).
* @param name: name to check.
* @param name_len: uncompressed length of the name to check.
* @param dclass: class to check.
* @return: true if the name is OK. false if unlisted.
*/
static int
priv_lookup_name(struct iter_priv* priv, ldns_buffer* pkt,
uint8_t* name, size_t name_len, uint16_t dclass)
{
size_t len;
uint8_t decomp[256];
int labs;
if(name_len >= sizeof(decomp))
return 0;
dname_pkt_copy(pkt, decomp, name);
labs = dname_count_size_labels(decomp, &len);
log_assert(name_len == len);
return name_tree_lookup(&priv->n, decomp, len, labs, dclass) != NULL;
}
size_t priv_get_mem(struct iter_priv* priv)
{
if(!priv) return 0;
return sizeof(*priv) + regional_get_mem(priv->region);
}
int priv_rrset_bad(struct iter_priv* priv, ldns_buffer* pkt,
struct rrset_parse* rrset)
{
if(priv->a.count == 0)
return 0; /* there are no blocked addresses */
/* see if it is a private name, that is allowed to have any */
if(priv_lookup_name(priv, pkt, rrset->dname, rrset->dname_len,
ntohs(rrset->rrset_class))) {
return 0;
} else {
/* so its a public name, check the address */
socklen_t len;
struct rr_parse* rr;
if(rrset->type == LDNS_RR_TYPE_A) {
struct sockaddr_storage addr;
struct sockaddr_in sa;
len = (socklen_t)sizeof(sa);
memset(&sa, 0, len);
sa.sin_family = AF_INET;
sa.sin_port = (in_port_t)htons(UNBOUND_DNS_PORT);
for(rr = rrset->rr_first; rr; rr = rr->next) {
if(ldns_read_uint16(rr->ttl_data+4)
!= INET_SIZE)
continue;
memmove(&sa.sin_addr, rr->ttl_data+4+2,
INET_SIZE);
memmove(&addr, &sa, len);
if(priv_lookup_addr(priv, &addr, len))
return 1;
}
} else if(rrset->type == LDNS_RR_TYPE_AAAA) {
struct sockaddr_storage addr;
struct sockaddr_in6 sa;
len = (socklen_t)sizeof(sa);
memset(&sa, 0, len);
sa.sin6_family = AF_INET6;
sa.sin6_port = (in_port_t)htons(UNBOUND_DNS_PORT);
for(rr = rrset->rr_first; rr; rr = rr->next) {
if(ldns_read_uint16(rr->ttl_data+4)
!= INET6_SIZE)
continue;
memmove(&sa.sin6_addr, rr->ttl_data+4+2,
INET6_SIZE);
memmove(&addr, &sa, len);
if(priv_lookup_addr(priv, &addr, len))
return 1;
}
}
}
return 0;
}
+109
View File
@@ -0,0 +1,109 @@
/*
* iterator/iter_priv.h - iterative resolver private address and domain store
*
* Copyright (c) 2008, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Keep track of the private addresses and lookup fast.
*/
#ifndef ITERATOR_ITER_PRIV_H
#define ITERATOR_ITER_PRIV_H
#include "util/rbtree.h"
struct iter_env;
struct config_file;
struct regional;
struct rrset_parse;
/**
* Iterator priv structure
*/
struct iter_priv {
/** regional for allocation */
struct regional* region;
/**
* Tree of the address spans that are blocked.
* contents of type addr_tree_node.
* No further data need, only presence or absence.
*/
rbtree_t a;
/**
* Tree of the domains spans that are allowed to contain
* the blocked address spans.
* contents of type name_tree_node.
* No further data need, only presence or absence.
*/
rbtree_t n;
};
/**
* Create priv structure
* @return new structure or NULL on error.
*/
struct iter_priv* priv_create();
/**
* Delete priv structure.
* @param priv: to delete.
*/
void priv_delete(struct iter_priv* priv);
/**
* Process priv config.
* @param priv: where to store.
* @param cfg: config options.
* @return 0 on error.
*/
int priv_apply_cfg(struct iter_priv* priv, struct config_file* cfg);
/**
* See if rrset is bad.
* @param priv: structure for private address storage.
* @param pkt: packet to decompress rrset name in.
* @param rrset: the rrset to examine, A or AAAA.
* @return true if the rrset is bad and should be removed.
*/
int priv_rrset_bad(struct iter_priv* priv, ldns_buffer* pkt,
struct rrset_parse* rrset);
/**
* Get memory used by priv structure.
* @param priv: structure for address storage.
* @return bytes in use.
*/
size_t priv_get_mem(struct iter_priv* priv);
#endif /* ITERATOR_ITER_PRIV_H */
+264
View File
@@ -0,0 +1,264 @@
/*
* iterator/iter_resptype.c - response type information and classification.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file defines the response type. DNS Responses can be classified as
* one of the response types.
*/
#include "config.h"
#include "iterator/iter_resptype.h"
#include "iterator/iter_delegpt.h"
#include "services/cache/dns.h"
#include "util/net_help.h"
#include "util/data/dname.h"
enum response_type
response_type_from_cache(struct dns_msg* msg,
struct query_info* request)
{
/* If the message is NXDOMAIN, then it is an ANSWER. */
if(FLAGS_GET_RCODE(msg->rep->flags) == LDNS_RCODE_NXDOMAIN)
return RESPONSE_TYPE_ANSWER;
/* First we look at the answer section. This can tell us if this is
* CNAME or positive ANSWER. */
if(msg->rep->an_numrrsets > 0) {
/* Now look at the answer section first. 3 states:
* o our answer is there directly,
* o our answer is there after a cname,
* o or there is just a cname. */
uint8_t* mname = request->qname;
size_t mname_len = request->qname_len;
size_t i;
for(i=0; i<msg->rep->an_numrrsets; i++) {
struct ub_packed_rrset_key* s = msg->rep->rrsets[i];
/* If we have encountered an answer (before or
* after a CNAME), then we are done! Note that
* if qtype == CNAME then this will be noted as
* an ANSWER before it gets treated as a CNAME,
* as it should */
if(ntohs(s->rk.type) == request->qtype &&
ntohs(s->rk.rrset_class) == request->qclass &&
query_dname_compare(mname, s->rk.dname) == 0) {
return RESPONSE_TYPE_ANSWER;
}
/* If we have encountered a CNAME, make sure that
* it is relevant. */
if(ntohs(s->rk.type) == LDNS_RR_TYPE_CNAME &&
query_dname_compare(mname, s->rk.dname) == 0) {
get_cname_target(s, &mname, &mname_len);
}
}
/* if we encountered a CNAME (or a bunch of CNAMEs), and
* still got to here, then it is a CNAME response. (i.e.,
* the CNAME chain didn't terminate in an answer rrset.) */
if(mname != request->qname) {
return RESPONSE_TYPE_CNAME;
}
}
/* At this point, since we don't need to detect REFERRAL or LAME
* messages, it can only be an ANSWER. */
return RESPONSE_TYPE_ANSWER;
}
enum response_type
response_type_from_server(int rdset,
struct dns_msg* msg, struct query_info* request, struct delegpt* dp)
{
uint8_t* origzone = (uint8_t*)"\000"; /* the default */
struct ub_packed_rrset_key* s;
size_t origzonelen = 1;
size_t i;
if(!msg || !request)
return RESPONSE_TYPE_THROWAWAY;
/* If the message is NXDOMAIN, then it answers the question. */
if(FLAGS_GET_RCODE(msg->rep->flags) == LDNS_RCODE_NXDOMAIN) {
/* make sure its not recursive when we don't want it to */
if( (msg->rep->flags&BIT_RA) &&
!(msg->rep->flags&BIT_AA) && !rdset)
return RESPONSE_TYPE_REC_LAME;
return RESPONSE_TYPE_ANSWER;
}
/* Other response codes mean (so far) to throw the response away as
* meaningless and move on to the next nameserver. */
if(FLAGS_GET_RCODE(msg->rep->flags) != LDNS_RCODE_NOERROR)
return RESPONSE_TYPE_THROWAWAY;
/* Note: TC bit has already been handled */
if(dp) {
origzone = dp->name;
origzonelen = dp->namelen;
}
/* First we look at the answer section. This can tell us if this is a
* CNAME or ANSWER or (provisional) ANSWER. */
if(msg->rep->an_numrrsets > 0) {
uint8_t* mname = request->qname;
size_t mname_len = request->qname_len;
/* Now look at the answer section first. 3 states: our
* answer is there directly, our answer is there after
* a cname, or there is just a cname. */
for(i=0; i<msg->rep->an_numrrsets; i++) {
struct ub_packed_rrset_key* s = msg->rep->rrsets[i];
/* if the answer section has NS rrset, and qtype ANY
* and the delegation is lower, and no CNAMEs followed,
* this is a referral where the NS went to AN section */
if((request->qtype == LDNS_RR_TYPE_ANY ||
request->qtype == LDNS_RR_TYPE_NS) &&
ntohs(s->rk.type) == LDNS_RR_TYPE_NS &&
ntohs(s->rk.rrset_class) == request->qclass &&
dname_strict_subdomain_c(s->rk.dname,
origzone)) {
return RESPONSE_TYPE_REFERRAL;
}
/* If we have encountered an answer (before or
* after a CNAME), then we are done! Note that
* if qtype == CNAME then this will be noted as an
* ANSWER before it gets treated as a CNAME, as
* it should. */
if(ntohs(s->rk.type) == request->qtype &&
ntohs(s->rk.rrset_class) == request->qclass &&
query_dname_compare(mname, s->rk.dname) == 0) {
if((msg->rep->flags&BIT_AA))
return RESPONSE_TYPE_ANSWER;
/* If the AA bit isn't on, and we've seen
* the answer, we only provisionally say
* 'ANSWER' -- it very well could be a
* REFERRAL. */
break;
}
/* If we have encountered a CNAME, make sure that
* it is relevant. */
if(ntohs(s->rk.type) == LDNS_RR_TYPE_CNAME &&
query_dname_compare(mname, s->rk.dname) == 0) {
get_cname_target(s, &mname, &mname_len);
}
}
/* if we encountered a CNAME (or a bunch of CNAMEs), and
* still got to here, then it is a CNAME response.
* (This is regardless of the AA bit at this point) */
if(mname != request->qname) {
return RESPONSE_TYPE_CNAME;
}
}
/* Looking at the authority section, we just look and see if
* there is a SOA record, that means a NOERROR/NODATA */
for(i = msg->rep->an_numrrsets; i < (msg->rep->an_numrrsets +
msg->rep->ns_numrrsets); i++) {
s = msg->rep->rrsets[i];
/* The normal way of detecting NOERROR/NODATA. */
if(ntohs(s->rk.type) == LDNS_RR_TYPE_SOA &&
dname_subdomain_c(request->qname, s->rk.dname)) {
/* we do our own recursion, thank you */
if( (msg->rep->flags&BIT_RA) &&
!(msg->rep->flags&BIT_AA) && !rdset)
return RESPONSE_TYPE_REC_LAME;
return RESPONSE_TYPE_ANSWER;
}
}
/* Looking at the authority section, we just look and see if
* there is a delegation NS set, turning it into a delegation.
* Otherwise, we will have to conclude ANSWER (either it is
* NOERROR/NODATA, or an non-authoritative answer). */
for(i = msg->rep->an_numrrsets; i < (msg->rep->an_numrrsets +
msg->rep->ns_numrrsets); i++) {
s = msg->rep->rrsets[i];
/* Detect REFERRAL/LAME/ANSWER based on the relationship
* of the NS set to the originating zone name. */
if(ntohs(s->rk.type) == LDNS_RR_TYPE_NS) {
/* If we are getting an NS set for the zone we
* thought we were contacting, then it is an answer.*/
if(query_dname_compare(s->rk.dname, origzone) == 0) {
/* see if mistakenly a recursive server was
* deployed and is responding nonAA */
if( (msg->rep->flags&BIT_RA) &&
!(msg->rep->flags&BIT_AA) && !rdset)
return RESPONSE_TYPE_REC_LAME;
/* Or if a lame server is deployed,
* which gives ns==zone delegation from cache
* without AA bit as well, with nodata nosoa*/
if(msg->rep->an_numrrsets==0 &&
!(msg->rep->flags&BIT_AA) && !rdset)
return RESPONSE_TYPE_REC_LAME;
return RESPONSE_TYPE_ANSWER;
}
/* If we are getting a referral upwards (or to
* the same zone), then the server is 'lame'. */
if(dname_subdomain_c(origzone, s->rk.dname)) {
return RESPONSE_TYPE_LAME;
}
/* If the NS set is below the delegation point we
* are on, and it is non-authoritative, then it is
* a referral, otherwise it is an answer. */
if(dname_subdomain_c(s->rk.dname, origzone)) {
/* NOTE: I no longer remember in what case
* we would like this to be an answer.
* NODATA should have a SOA or nothing,
* not an NS rrset.
* True, referrals should not have the AA
* bit set, but... */
/* if((msg->rep->flags&BIT_AA))
return RESPONSE_TYPE_ANSWER; */
return RESPONSE_TYPE_REFERRAL;
}
/* Otherwise, the NS set is irrelevant. */
}
}
/* If we've gotten this far, this is NOERROR/NODATA (which could
* be an entirely empty message) */
/* check if recursive answer; saying it has empty cache */
if( (msg->rep->flags&BIT_RA) && !(msg->rep->flags&BIT_AA) && !rdset)
return RESPONSE_TYPE_REC_LAME;
return RESPONSE_TYPE_ANSWER;
}
+127
View File
@@ -0,0 +1,127 @@
/*
* iterator/iter_resptype.h - response type information and classification.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file defines the response type. DNS Responses can be classified as
* one of the response types.
*/
#ifndef ITERATOR_ITER_RESPTYPE_H
#define ITERATOR_ITER_RESPTYPE_H
struct dns_msg;
struct query_info;
struct delegpt;
/**
* The response type is used to interpret the response.
*/
enum response_type {
/**
* 'untyped' means that the type of this response hasn't been
* assigned.
*/
RESPONSE_TYPE_UNTYPED = 0,
/**
* 'answer' means that the response terminates the resolution
* process.
*/
RESPONSE_TYPE_ANSWER,
/** 'delegation' means that the response is a delegation. */
RESPONSE_TYPE_REFERRAL,
/**
* 'cname' means that the response is a cname without the final
* answer, and thus must be restarted.
*/
RESPONSE_TYPE_CNAME,
/**
* 'throwaway' means that this particular response should be
* discarded and the next nameserver should be contacted
*/
RESPONSE_TYPE_THROWAWAY,
/**
* 'lame' means that this particular response indicates that
* the nameserver knew nothing about the question.
*/
RESPONSE_TYPE_LAME,
/**
* Recursion lame means that the nameserver is some sort of
* open recursor, and not authoritative for the question.
* It may know something, but not authoritatively.
*/
RESPONSE_TYPE_REC_LAME
};
/**
* Classifies a response message from cache based on the current request.
* Note that this routine assumes that THROWAWAY or LAME responses will not
* occur. Also, it will not detect REFERRAL type messages, since those are
* (currently) automatically classified based on how they came from the
* cache (findDelegation() instead of lookup()).
*
* @param msg: the message from the cache.
* @param request: the request that generated the response.
* @return the response type (CNAME or ANSWER).
*/
enum response_type response_type_from_cache(struct dns_msg* msg,
struct query_info* request);
/**
* Classifies a response message (from the wire) based on the current
* request.
*
* NOTE: currently this routine uses the AA bit in the response to help
* distinguish between some non-standard referrals and answers. It also
* relies somewhat on the originating zone to be accurate (for lameness
* detection, mostly).
*
* @param rdset: if RD bit was sent in query sent by unbound.
* @param msg: the message from the cache.
* @param request: the request that generated the response.
* @param dp: The delegation point that was being queried
* when the response was returned.
* @return the response type (CNAME or ANSWER).
*/
enum response_type response_type_from_server(int rdset,
struct dns_msg* msg, struct query_info* request, struct delegpt* dp);
#endif /* ITERATOR_ITER_RESPTYPE_H */
+704
View File
@@ -0,0 +1,704 @@
/*
* iterator/iter_scrub.c - scrubbing, normalization, sanitization of DNS msgs.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file has routine(s) for cleaning up incoming DNS messages from
* possible useless or malicious junk in it.
*/
#include "config.h"
#include "iterator/iter_scrub.h"
#include "iterator/iterator.h"
#include "iterator/iter_priv.h"
#include "services/cache/rrset.h"
#include "util/log.h"
#include "util/net_help.h"
#include "util/regional.h"
#include "util/config_file.h"
#include "util/module.h"
#include "util/data/msgparse.h"
#include "util/data/dname.h"
#include "util/data/msgreply.h"
#include "util/alloc.h"
/** RRset flag used during scrubbing. The RRset is OK. */
#define RRSET_SCRUB_OK 0x80
/** remove rrset, update loop variables */
static void
remove_rrset(const char* str, ldns_buffer* pkt, struct msg_parse* msg,
struct rrset_parse* prev, struct rrset_parse** rrset)
{
if(verbosity >= VERB_QUERY
&& (*rrset)->dname_len <= LDNS_MAX_DOMAINLEN) {
uint8_t buf[LDNS_MAX_DOMAINLEN+1];
dname_pkt_copy(pkt, buf, (*rrset)->dname);
log_nametypeclass(VERB_QUERY, str, buf,
(*rrset)->type, ntohs((*rrset)->rrset_class));
}
if(prev)
prev->rrset_all_next = (*rrset)->rrset_all_next;
else msg->rrset_first = (*rrset)->rrset_all_next;
if(msg->rrset_last == *rrset)
msg->rrset_last = prev;
msg->rrset_count --;
switch((*rrset)->section) {
case LDNS_SECTION_ANSWER: msg->an_rrsets--; break;
case LDNS_SECTION_AUTHORITY: msg->ns_rrsets--; break;
case LDNS_SECTION_ADDITIONAL: msg->ar_rrsets--; break;
default: log_assert(0);
}
msgparse_bucket_remove(msg, *rrset);
*rrset = (*rrset)->rrset_all_next;
}
/** return true if rr type has additional names in it */
static int
has_additional(uint16_t t)
{
switch(t) {
case LDNS_RR_TYPE_MB:
case LDNS_RR_TYPE_MD:
case LDNS_RR_TYPE_MF:
case LDNS_RR_TYPE_NS:
case LDNS_RR_TYPE_MX:
case LDNS_RR_TYPE_KX:
case LDNS_RR_TYPE_SRV:
return 1;
case LDNS_RR_TYPE_NAPTR:
/* TODO: NAPTR not supported, glue stripped off */
return 0;
}
return 0;
}
/** get additional name from rrset RR, return false if no name present */
static int
get_additional_name(struct rrset_parse* rrset, struct rr_parse* rr,
uint8_t** nm, size_t* nmlen, ldns_buffer* pkt)
{
size_t offset = 0;
size_t len, oldpos;
switch(rrset->type) {
case LDNS_RR_TYPE_MB:
case LDNS_RR_TYPE_MD:
case LDNS_RR_TYPE_MF:
case LDNS_RR_TYPE_NS:
offset = 0;
break;
case LDNS_RR_TYPE_MX:
case LDNS_RR_TYPE_KX:
offset = 2;
break;
case LDNS_RR_TYPE_SRV:
offset = 6;
break;
case LDNS_RR_TYPE_NAPTR:
/* TODO: NAPTR not supported, glue stripped off */
return 0;
default:
return 0;
}
len = ldns_read_uint16(rr->ttl_data+sizeof(uint32_t));
if(len < offset+1)
return 0; /* rdata field too small */
*nm = rr->ttl_data+sizeof(uint32_t)+sizeof(uint16_t)+offset;
oldpos = ldns_buffer_position(pkt);
ldns_buffer_set_position(pkt, (size_t)(*nm - ldns_buffer_begin(pkt)));
*nmlen = pkt_dname_len(pkt);
ldns_buffer_set_position(pkt, oldpos);
if(*nmlen == 0)
return 0;
return 1;
}
/** Place mark on rrsets in additional section they are OK */
static void
mark_additional_rrset(ldns_buffer* pkt, struct msg_parse* msg,
struct rrset_parse* rrset)
{
/* Mark A and AAAA for NS as appropriate additional section info. */
uint8_t* nm = NULL;
size_t nmlen = 0;
struct rr_parse* rr;
if(!has_additional(rrset->type))
return;
for(rr = rrset->rr_first; rr; rr = rr->next) {
if(get_additional_name(rrset, rr, &nm, &nmlen, pkt)) {
/* mark A */
hashvalue_t h = pkt_hash_rrset(pkt, nm, LDNS_RR_TYPE_A,
rrset->rrset_class, 0);
struct rrset_parse* r = msgparse_hashtable_lookup(
msg, pkt, h, 0, nm, nmlen,
LDNS_RR_TYPE_A, rrset->rrset_class);
if(r && r->section == LDNS_SECTION_ADDITIONAL) {
r->flags |= RRSET_SCRUB_OK;
}
/* mark AAAA */
h = pkt_hash_rrset(pkt, nm, LDNS_RR_TYPE_AAAA,
rrset->rrset_class, 0);
r = msgparse_hashtable_lookup(msg, pkt, h, 0, nm,
nmlen, LDNS_RR_TYPE_AAAA, rrset->rrset_class);
if(r && r->section == LDNS_SECTION_ADDITIONAL) {
r->flags |= RRSET_SCRUB_OK;
}
}
}
}
/** Get target name of a CNAME */
static int
parse_get_cname_target(struct rrset_parse* rrset, uint8_t** sname,
size_t* snamelen)
{
if(rrset->rr_count != 1) {
verbose(VERB_ALGO, "Found CNAME rrset with "
"size > 1: %u", (unsigned)rrset->rr_count);
/* use the first CNAME! */
rrset->rr_count = 1;
rrset->size = rrset->rr_first->size;
rrset->rr_last = rrset->rr_first;
rrset->rr_first->next = NULL;
}
if(rrset->rr_first->size < sizeof(uint16_t)+1)
return 0; /* CNAME rdata too small */
*sname = rrset->rr_first->ttl_data + sizeof(uint32_t)
+ sizeof(uint16_t); /* skip ttl, rdatalen */
*snamelen = rrset->rr_first->size - sizeof(uint16_t);
return 1;
}
/** Synthesize CNAME from DNAME, false if too long */
static int
synth_cname(uint8_t* qname, size_t qnamelen, struct rrset_parse* dname_rrset,
uint8_t* alias, size_t* aliaslen, ldns_buffer* pkt)
{
/* we already know that sname is a strict subdomain of DNAME owner */
uint8_t* dtarg = NULL;
size_t dtarglen;
if(!parse_get_cname_target(dname_rrset, &dtarg, &dtarglen))
return 0;
log_assert(qnamelen > dname_rrset->dname_len);
/* DNAME from com. to net. with qname example.com. -> example.net. */
/* so: \3com\0 to \3net\0 and qname \7example\3com\0 */
*aliaslen = qnamelen + dtarglen - dname_rrset->dname_len;
if(*aliaslen > LDNS_MAX_DOMAINLEN)
return 0; /* should have been RCODE YXDOMAIN */
/* decompress dnames into buffer, we know it fits */
dname_pkt_copy(pkt, alias, qname);
dname_pkt_copy(pkt, alias+(qnamelen-dname_rrset->dname_len), dtarg);
return 1;
}
/** synthesize a CNAME rrset */
static struct rrset_parse*
synth_cname_rrset(uint8_t** sname, size_t* snamelen, uint8_t* alias,
size_t aliaslen, struct regional* region, struct msg_parse* msg,
struct rrset_parse* rrset, struct rrset_parse* prev,
struct rrset_parse* nx, ldns_buffer* pkt)
{
struct rrset_parse* cn = (struct rrset_parse*)regional_alloc(region,
sizeof(struct rrset_parse));
if(!cn)
return NULL;
memset(cn, 0, sizeof(*cn));
cn->rr_first = (struct rr_parse*)regional_alloc(region,
sizeof(struct rr_parse));
if(!cn->rr_first)
return NULL;
cn->rr_last = cn->rr_first;
/* CNAME from sname to alias */
cn->dname = (uint8_t*)regional_alloc(region, *snamelen);
if(!cn->dname)
return NULL;
dname_pkt_copy(pkt, cn->dname, *sname);
cn->dname_len = *snamelen;
cn->type = LDNS_RR_TYPE_CNAME;
cn->section = rrset->section;
cn->rrset_class = rrset->rrset_class;
cn->rr_count = 1;
cn->size = sizeof(uint16_t) + aliaslen;
cn->hash=pkt_hash_rrset(pkt, cn->dname, cn->type, cn->rrset_class, 0);
/* allocate TTL + rdatalen + uncompressed dname */
memset(cn->rr_first, 0, sizeof(struct rr_parse));
cn->rr_first->outside_packet = 1;
cn->rr_first->ttl_data = (uint8_t*)regional_alloc(region,
sizeof(uint32_t)+sizeof(uint16_t)+aliaslen);
if(!cn->rr_first->ttl_data)
return NULL;
ldns_write_uint32(cn->rr_first->ttl_data, 0); /* TTL = 0 */
ldns_write_uint16(cn->rr_first->ttl_data+4, aliaslen);
memmove(cn->rr_first->ttl_data+6, alias, aliaslen);
cn->rr_first->size = sizeof(uint16_t)+aliaslen;
/* link it in */
cn->rrset_all_next = nx;
if(prev)
prev->rrset_all_next = cn;
else msg->rrset_first = cn;
if(nx == NULL)
msg->rrset_last = cn;
msg->rrset_count ++;
msg->an_rrsets++;
/* it is not inserted in the msg hashtable. */
*sname = cn->rr_first->ttl_data + sizeof(uint32_t)+sizeof(uint16_t);
*snamelen = aliaslen;
return cn;
}
/** check if DNAME applies to a name */
static int
pkt_strict_sub(ldns_buffer* pkt, uint8_t* sname, uint8_t* dr)
{
uint8_t buf1[LDNS_MAX_DOMAINLEN+1];
uint8_t buf2[LDNS_MAX_DOMAINLEN+1];
/* decompress names */
dname_pkt_copy(pkt, buf1, sname);
dname_pkt_copy(pkt, buf2, dr);
return dname_strict_subdomain_c(buf1, buf2);
}
/** check subdomain with decompression */
static int
pkt_sub(ldns_buffer* pkt, uint8_t* comprname, uint8_t* zone)
{
uint8_t buf[LDNS_MAX_DOMAINLEN+1];
dname_pkt_copy(pkt, buf, comprname);
return dname_subdomain_c(buf, zone);
}
/**
* This routine normalizes a response. This includes removing "irrelevant"
* records from the answer and additional sections and (re)synthesizing
* CNAMEs from DNAMEs, if present.
*
* @param pkt: packet.
* @param msg: msg to normalize.
* @param qinfo: original query.
* @param region: where to allocate synthesized CNAMEs.
* @return 0 on error.
*/
static int
scrub_normalize(ldns_buffer* pkt, struct msg_parse* msg,
struct query_info* qinfo, struct regional* region)
{
uint8_t* sname = qinfo->qname;
size_t snamelen = qinfo->qname_len;
struct rrset_parse* rrset, *prev, *nsset=NULL;
if(FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NOERROR &&
FLAGS_GET_RCODE(msg->flags) != LDNS_RCODE_NXDOMAIN)
return 1;
/* For the ANSWER section, remove all "irrelevant" records and add
* synthesized CNAMEs from DNAMEs
* This will strip out-of-order CNAMEs as well. */
/* walk through the parse packet rrset list, keep track of previous
* for insert and delete ease, and examine every RRset */
prev = NULL;
rrset = msg->rrset_first;
while(rrset && rrset->section == LDNS_SECTION_ANSWER) {
if(rrset->type == LDNS_RR_TYPE_DNAME &&
pkt_strict_sub(pkt, sname, rrset->dname)) {
/* check if next rrset is correct CNAME. else,
* synthesize a CNAME */
struct rrset_parse* nx = rrset->rrset_all_next;
uint8_t alias[LDNS_MAX_DOMAINLEN+1];
size_t aliaslen = 0;
if(rrset->rr_count != 1) {
verbose(VERB_ALGO, "Found DNAME rrset with "
"size > 1: %u",
(unsigned)rrset->rr_count);
return 0;
}
if(!synth_cname(sname, snamelen, rrset, alias,
&aliaslen, pkt)) {
verbose(VERB_ALGO, "synthesized CNAME "
"too long");
return 0;
}
/* internally we have CNAME'd/DNAME'd chains ending
* in nxdomain with NOERROR rcode, change rcode
* to reflect this (if needed) */
FLAGS_SET_RCODE(msg->flags, LDNS_RCODE_NOERROR);
if(nx && nx->type == LDNS_RR_TYPE_CNAME &&
dname_pkt_compare(pkt, sname, nx->dname) == 0) {
/* check next cname */
uint8_t* t = NULL;
size_t tlen = 0;
if(!parse_get_cname_target(rrset, &t, &tlen))
return 0;
if(dname_pkt_compare(pkt, alias, t) == 0) {
/* it's OK and better capitalized */
prev = rrset;
rrset = nx;
continue;
}
/* synth ourselves */
}
/* synth a CNAME rrset */
prev = synth_cname_rrset(&sname, &snamelen, alias,
aliaslen, region, msg, rrset, rrset, nx, pkt);
if(!prev) {
log_err("out of memory synthesizing CNAME");
return 0;
}
/* FIXME: resolve the conflict between synthesized
* CNAME ttls and the cache. */
rrset = nx;
continue;
}
/* The only records in the ANSWER section not allowed to */
if(dname_pkt_compare(pkt, sname, rrset->dname) != 0) {
remove_rrset("normalize: removing irrelevant RRset:",
pkt, msg, prev, &rrset);
continue;
}
/* Follow the CNAME chain. */
if(rrset->type == LDNS_RR_TYPE_CNAME) {
if(!parse_get_cname_target(rrset, &sname, &snamelen))
return 0;
prev = rrset;
rrset = rrset->rrset_all_next;
/* internally we have CNAME'd/DNAME'd chains ending
* in nxdomain with NOERROR rcode, change rcode
* to reflect this (if needed) */
FLAGS_SET_RCODE(msg->flags, LDNS_RCODE_NOERROR);
continue;
}
/* Otherwise, make sure that the RRset matches the qtype. */
if(qinfo->qtype != LDNS_RR_TYPE_ANY &&
qinfo->qtype != rrset->type) {
remove_rrset("normalize: removing irrelevant RRset:",
pkt, msg, prev, &rrset);
continue;
}
/* Mark the additional names from relevant rrset as OK. */
/* only for RRsets that match the query name, other ones
* will be removed by sanitize, so no additional for them */
if(dname_pkt_compare(pkt, qinfo->qname, rrset->dname) == 0)
mark_additional_rrset(pkt, msg, rrset);
prev = rrset;
rrset = rrset->rrset_all_next;
}
/* Mark additional names from AUTHORITY */
while(rrset && rrset->section == LDNS_SECTION_AUTHORITY) {
if(rrset->type==LDNS_RR_TYPE_DNAME ||
rrset->type==LDNS_RR_TYPE_CNAME ||
rrset->type==LDNS_RR_TYPE_A ||
rrset->type==LDNS_RR_TYPE_AAAA) {
remove_rrset("normalize: removing irrelevant "
"RRset:", pkt, msg, prev, &rrset);
continue;
}
/* only one NS set allowed in authority section */
if(rrset->type==LDNS_RR_TYPE_NS) {
if(nsset == NULL) {
nsset = rrset;
} else {
remove_rrset("normalize: removing irrelevant "
"RRset:", pkt, msg, prev, &rrset);
continue;
}
}
mark_additional_rrset(pkt, msg, rrset);
prev = rrset;
rrset = rrset->rrset_all_next;
}
/* For each record in the additional section, remove it if it is an
* address record and not in the collection of additional names
* found in ANSWER and AUTHORITY. */
/* These records have not been marked OK previously */
while(rrset && rrset->section == LDNS_SECTION_ADDITIONAL) {
/* FIXME: what about other types? */
if(rrset->type==LDNS_RR_TYPE_A ||
rrset->type==LDNS_RR_TYPE_AAAA)
{
if((rrset->flags & RRSET_SCRUB_OK)) {
/* remove flag to clean up flags variable */
rrset->flags &= ~RRSET_SCRUB_OK;
} else {
remove_rrset("normalize: removing irrelevant "
"RRset:", pkt, msg, prev, &rrset);
continue;
}
}
if(rrset->type==LDNS_RR_TYPE_DNAME ||
rrset->type==LDNS_RR_TYPE_CNAME ||
rrset->type==LDNS_RR_TYPE_NS) {
remove_rrset("normalize: removing irrelevant "
"RRset:", pkt, msg, prev, &rrset);
continue;
}
prev = rrset;
rrset = rrset->rrset_all_next;
}
return 1;
}
/**
* Store potential poison in the cache (only if hardening disabled).
* The rrset is stored in the cache but removed from the message.
* So that it will be used for infrastructure purposes, but not be
* returned to the client.
* @param pkt: packet
* @param msg: message parsed
* @param env: environment with cache
* @param rrset: to store.
*/
static void
store_rrset(ldns_buffer* pkt, struct msg_parse* msg, struct module_env* env,
struct rrset_parse* rrset)
{
struct ub_packed_rrset_key* k;
struct packed_rrset_data* d;
struct rrset_ref ref;
uint32_t now = *env->now;
k = alloc_special_obtain(env->alloc);
if(!k)
return;
k->entry.data = NULL;
if(!parse_copy_decompress_rrset(pkt, msg, rrset, NULL, k)) {
alloc_special_release(env->alloc, k);
return;
}
d = (struct packed_rrset_data*)k->entry.data;
packed_rrset_ttl_add(d, now);
ref.key = k;
ref.id = k->id;
/*ignore ret: it was in the cache, ref updated */
(void)rrset_cache_update(env->rrset_cache, &ref,
env->alloc, now);
}
/**
* Check if right hand name in NSEC is within zone
* @param rrset: the NSEC rrset
* @param zonename: the zone name.
* @return true if BAD.
*/
static int sanitize_nsec_is_overreach(struct rrset_parse* rrset,
uint8_t* zonename)
{
struct rr_parse* rr;
uint8_t* rhs;
size_t len;
log_assert(rrset->type == LDNS_RR_TYPE_NSEC);
for(rr = rrset->rr_first; rr; rr = rr->next) {
rhs = rr->ttl_data+4+2;
len = ldns_read_uint16(rr->ttl_data+4);
if(!(len=dname_valid(rhs, len))) {
/* malformed domain name in rdata */
return 1;
}
if(!dname_subdomain_c(rhs, zonename)) {
/* overreaching */
return 1;
}
}
/* all NSEC RRs OK */
return 0;
}
/**
* Given a response event, remove suspect RRsets from the response.
* "Suspect" rrsets are potentially poison. Note that this routine expects
* the response to be in a "normalized" state -- that is, all "irrelevant"
* RRsets have already been removed, CNAMEs are in order, etc.
*
* @param pkt: packet.
* @param msg: msg to normalize.
* @param qinfo: the question originally asked.
* @param zonename: name of server zone.
* @param env: module environment with config and cache.
* @param ie: iterator environment with private address data.
* @return 0 on error.
*/
static int
scrub_sanitize(ldns_buffer* pkt, struct msg_parse* msg,
struct query_info* qinfo, uint8_t* zonename, struct module_env* env,
struct iter_env* ie)
{
struct rrset_parse* rrset, *prev;
prev = NULL;
rrset = msg->rrset_first;
/* the first DNAME is allowed to stay. It needs checking before
* it can be used from the cache. After normalization, an initial
* DNAME will have a correctly synthesized CNAME after it. */
if(rrset && rrset->type == LDNS_RR_TYPE_DNAME &&
rrset->section == LDNS_SECTION_ANSWER &&
pkt_strict_sub(pkt, qinfo->qname, rrset->dname) &&
pkt_sub(pkt, rrset->dname, zonename)) {
prev = rrset; /* DNAME allowed to stay in answer section */
rrset = rrset->rrset_all_next;
}
/* remove all records from the answer section that are
* not the same domain name as the query domain name.
* The answer section should contain rrsets with the same name
* as the question. For DNAMEs a CNAME has been synthesized.
* Wildcards have the query name in answer section.
* ANY queries get query name in answer section.
* Remainders of CNAME chains are cut off and resolved by iterator. */
while(rrset && rrset->section == LDNS_SECTION_ANSWER) {
if(dname_pkt_compare(pkt, qinfo->qname, rrset->dname) != 0) {
remove_rrset("sanitize: removing extraneous answer "
"RRset:", pkt, msg, prev, &rrset);
continue;
}
prev = rrset;
rrset = rrset->rrset_all_next;
}
/* At this point, we brutally remove ALL rrsets that aren't
* children of the originating zone. The idea here is that,
* as far as we know, the server that we contacted is ONLY
* authoritative for the originating zone. It, of course, MAY
* be authoriative for any other zones, and of course, MAY
* NOT be authoritative for some subdomains of the originating
* zone. */
prev = NULL;
rrset = msg->rrset_first;
while(rrset) {
/* remove private addresses */
if( (rrset->type == LDNS_RR_TYPE_A ||
rrset->type == LDNS_RR_TYPE_AAAA) &&
priv_rrset_bad(ie->priv, pkt, rrset)) {
/* set servfail, so the classification becomes
* THROWAWAY, instead of LAME or other unwanted */
FLAGS_SET_RCODE(msg->flags, LDNS_RCODE_SERVFAIL);
remove_rrset("sanitize: removing public name with "
"private address", pkt, msg, prev, &rrset);
continue;
}
/* skip DNAME records -- they will always be followed by a
* synthesized CNAME, which will be relevant.
* FIXME: should this do something differently with DNAME
* rrsets NOT in Section.ANSWER? */
/* But since DNAME records are also subdomains of the zone,
* same check can be used */
if(!pkt_sub(pkt, rrset->dname, zonename)) {
if(msg->an_rrsets == 0 &&
rrset->type == LDNS_RR_TYPE_NS &&
rrset->section == LDNS_SECTION_AUTHORITY &&
FLAGS_GET_RCODE(msg->flags) ==
LDNS_RCODE_NOERROR) {
/* noerror, nodata and this NS rrset is above
* the zone. This is LAME!
* Leave in the NS for lame classification. */
} else if(!env->cfg->harden_glue) {
/* store in cache! Since it is relevant
* (from normalize) it will be picked up
* from the cache to be used later */
store_rrset(pkt, msg, env, rrset);
remove_rrset("sanitize: storing potential "
"poison RRset:", pkt, msg, prev, &rrset);
continue;
} else {
remove_rrset("sanitize: removing potential "
"poison RRset:", pkt, msg, prev, &rrset);
continue;
}
}
/* check if right hand side of NSEC is within zone */
if(rrset->type == LDNS_RR_TYPE_NSEC &&
sanitize_nsec_is_overreach(rrset, zonename)) {
remove_rrset("sanitize: removing overreaching NSEC "
"RRset:", pkt, msg, prev, &rrset);
continue;
}
prev = rrset;
rrset = rrset->rrset_all_next;
}
return 1;
}
int
scrub_message(ldns_buffer* pkt, struct msg_parse* msg,
struct query_info* qinfo, uint8_t* zonename, struct regional* region,
struct module_env* env, struct iter_env* ie)
{
/* basic sanity checks */
log_nametypeclass(VERB_ALGO, "scrub for", zonename, LDNS_RR_TYPE_NS,
qinfo->qclass);
if(msg->qdcount > 1)
return 0;
if( !(msg->flags&BIT_QR) )
return 0;
/* make sure that a query is echoed back when NOERROR or NXDOMAIN */
/* this is not required for basic operation but is a forgery
* resistance (security) feature */
if((FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NOERROR ||
FLAGS_GET_RCODE(msg->flags) == LDNS_RCODE_NXDOMAIN) &&
msg->qdcount == 0)
return 0;
/* if a query is echoed back, make sure it is correct. Otherwise,
* this may be not a reply to our query. */
if(msg->qdcount == 1) {
if(dname_pkt_compare(pkt, msg->qname, qinfo->qname) != 0)
return 0;
if(msg->qtype != qinfo->qtype || msg->qclass != qinfo->qclass)
return 0;
}
/* normalize the response, this cleans up the additional. */
if(!scrub_normalize(pkt, msg, qinfo, region))
return 0;
/* delete all out-of-zone information */
if(!scrub_sanitize(pkt, msg, qinfo, zonename, env, ie))
return 0;
return 1;
}
+68
View File
@@ -0,0 +1,68 @@
/*
* iterator/iter_scrub.h - scrubbing, normalization, sanitization of DNS msgs.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file has routine(s) for cleaning up incoming DNS messages from
* possible useless or malicious junk in it.
*/
#ifndef ITERATOR_ITER_SCRUB_H
#define ITERATOR_ITER_SCRUB_H
struct msg_parse;
struct query_info;
struct regional;
struct module_env;
struct iter_env;
/**
* Cleanup the passed dns message.
* @param pkt: the packet itself, for resolving name compression pointers.
* the packet buffer is unaltered.
* @param msg: the parsed packet, this structure is cleaned up.
* @param qinfo: the query info that was sent to the server. Checked.
* @param zonename: the name of the last delegation point.
* Used to determine out of bailiwick information.
* @param regional: where to allocate (new) parts of the message.
* @param env: module environment with config settings and cache.
* @param ie: iterator module environment data.
* @return: false if the message is total waste. true if scrubbed with success.
*/
int scrub_message(ldns_buffer* pkt, struct msg_parse* msg,
struct query_info* qinfo, uint8_t* zonename, struct regional* regional,
struct module_env* env, struct iter_env* ie);
#endif /* ITERATOR_ITER_SCRUB_H */
+680
View File
@@ -0,0 +1,680 @@
/*
* iterator/iter_utils.c - iterative resolver module utility functions.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Configuration options. Forward zones.
*/
#include "config.h"
#include "iterator/iter_utils.h"
#include "iterator/iterator.h"
#include "iterator/iter_hints.h"
#include "iterator/iter_fwd.h"
#include "iterator/iter_donotq.h"
#include "iterator/iter_delegpt.h"
#include "iterator/iter_priv.h"
#include "services/cache/infra.h"
#include "services/cache/dns.h"
#include "services/cache/rrset.h"
#include "util/net_help.h"
#include "util/module.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/regional.h"
#include "util/data/msgparse.h"
#include "util/data/dname.h"
#include "util/random.h"
#include "util/fptr_wlist.h"
#include "validator/val_anchor.h"
/** time when nameserver glue is said to be 'recent' */
#define SUSPICION_RECENT_EXPIRY 86400
/** penalty to validation failed blacklisted IPs */
#define BLACKLIST_PENALTY (USEFUL_SERVER_TOP_TIMEOUT*3)
/** fillup fetch policy array */
static void
fetch_fill(struct iter_env* ie, const char* str)
{
char* s = (char*)str, *e;
int i;
for(i=0; i<ie->max_dependency_depth+1; i++) {
ie->target_fetch_policy[i] = strtol(s, &e, 10);
if(s == e)
fatal_exit("cannot parse fetch policy number %s", s);
s = e;
}
}
/** Read config string that represents the target fetch policy */
static int
read_fetch_policy(struct iter_env* ie, const char* str)
{
int count = cfg_count_numbers(str);
if(count < 1) {
log_err("Cannot parse target fetch policy: \"%s\"", str);
return 0;
}
ie->max_dependency_depth = count - 1;
ie->target_fetch_policy = (int*)calloc(
(size_t)ie->max_dependency_depth+1, sizeof(int));
if(!ie->target_fetch_policy) {
log_err("alloc fetch policy: out of memory");
return 0;
}
fetch_fill(ie, str);
return 1;
}
int
iter_apply_cfg(struct iter_env* iter_env, struct config_file* cfg)
{
int i;
/* target fetch policy */
if(!read_fetch_policy(iter_env, cfg->target_fetch_policy))
return 0;
for(i=0; i<iter_env->max_dependency_depth+1; i++)
verbose(VERB_QUERY, "target fetch policy for level %d is %d",
i, iter_env->target_fetch_policy[i]);
if(!iter_env->hints)
iter_env->hints = hints_create();
if(!iter_env->hints || !hints_apply_cfg(iter_env->hints, cfg)) {
log_err("Could not set root or stub hints");
return 0;
}
if(!iter_env->donotq)
iter_env->donotq = donotq_create();
if(!iter_env->donotq || !donotq_apply_cfg(iter_env->donotq, cfg)) {
log_err("Could not set donotqueryaddresses");
return 0;
}
if(!iter_env->priv)
iter_env->priv = priv_create();
if(!iter_env->priv || !priv_apply_cfg(iter_env->priv, cfg)) {
log_err("Could not set private addresses");
return 0;
}
iter_env->supports_ipv6 = cfg->do_ip6;
return 1;
}
/** filter out unsuitable targets
* @param iter_env: iterator environment with ipv6-support flag.
* @param env: module environment with infra cache.
* @param name: zone name
* @param namelen: length of name
* @param qtype: query type (host order).
* @param now: current time
* @param a: address in delegation point we are examining.
* @return an integer that signals the target suitability.
* as follows:
* -1: The address should be omitted from the list.
* Because:
* o The address is bogus (DNSSEC validation failure).
* o Listed as donotquery
* o is ipv6 but no ipv6 support (in operating system).
* o is lame
* Otherwise, an rtt in milliseconds.
* 0 .. USEFUL_SERVER_TOP_TIMEOUT-1
* The roundtrip time timeout estimate. less than 2 minutes.
* Note that util/rtt.c has a MIN_TIMEOUT of 50 msec, thus
* values 0 .. 49 are not used, unless that is changed.
* USEFUL_SERVER_TOP_TIMEOUT
* This value exactly is given for unresponsive blacklisted.
* USEFUL_SERVER_TOP_TIMEOUT+1
* For non-blacklisted servers: huge timeout, but has traffic.
* USEFUL_SERVER_TOP_TIMEOUT ..
* dnsseclame servers get penalty
* USEFUL_SERVER_TOP_TIMEOUT*2 ..
* recursion lame servers get penalty
* UNKNOWN_SERVER_NICENESS
* If no information is known about the server, this is
* returned. 376 msec or so.
* +BLACKLIST_PENALTY (of USEFUL_TOP_TIMEOUT*3) for dnssec failed IPs.
*
* When a final value is chosen that is dnsseclame ; dnsseclameness checking
* is turned off (so we do not discard the reply).
* When a final value is chosen that is recursionlame; RD bit is set on query.
* Because of the numbers this means recursionlame also have dnssec lameness
* checking turned off.
*/
static int
iter_filter_unsuitable(struct iter_env* iter_env, struct module_env* env,
uint8_t* name, size_t namelen, uint16_t qtype, uint32_t now,
struct delegpt_addr* a)
{
int rtt, lame, reclame, dnsseclame, lost;
if(a->bogus)
return -1; /* address of server is bogus */
if(donotq_lookup(iter_env->donotq, &a->addr, a->addrlen)) {
return -1; /* server is on the donotquery list */
}
if(!iter_env->supports_ipv6 && addr_is_ip6(&a->addr, a->addrlen)) {
return -1; /* there is no ip6 available */
}
/* check lameness - need zone , class info */
if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen,
name, namelen, qtype, &lame, &dnsseclame, &reclame,
&rtt, &lost, now)) {
log_addr(VERB_ALGO, "servselect", &a->addr, a->addrlen);
verbose(VERB_ALGO, " rtt=%d%s%s%s", rtt,
lame?" LAME":"",
dnsseclame?" DNSSEC_LAME":"",
reclame?" REC_LAME":"");
if(lame)
return -1; /* server is lame */
else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT &&
lost >= USEFUL_SERVER_MAX_LOST)
/* server is unresponsive */
return USEFUL_SERVER_TOP_TIMEOUT;
else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT) /* not blacklisted*/
return USEFUL_SERVER_TOP_TIMEOUT+1;
else if(reclame)
return rtt+USEFUL_SERVER_TOP_TIMEOUT*2; /* nonpref */
else if(dnsseclame )
return rtt+USEFUL_SERVER_TOP_TIMEOUT; /* nonpref */
else return rtt;
}
/* no server information present */
return UNKNOWN_SERVER_NICENESS;
}
/** lookup RTT information, and also store fastest rtt (if any) */
static int
iter_fill_rtt(struct iter_env* iter_env, struct module_env* env,
uint8_t* name, size_t namelen, uint16_t qtype, uint32_t now,
struct delegpt* dp, int* best_rtt, struct sock_list* blacklist)
{
int got_it = 0;
struct delegpt_addr* a;
if(dp->bogus)
return 0; /* NS bogus, all bogus, nothing found */
for(a=dp->result_list; a; a = a->next_result) {
a->sel_rtt = iter_filter_unsuitable(iter_env, env,
name, namelen, qtype, now, a);
if(a->sel_rtt != -1) {
if(sock_list_find(blacklist, &a->addr, a->addrlen))
a->sel_rtt += BLACKLIST_PENALTY;
if(!got_it) {
*best_rtt = a->sel_rtt;
got_it = 1;
} else if(a->sel_rtt < *best_rtt) {
*best_rtt = a->sel_rtt;
}
}
}
return got_it;
}
/** filter the addres list, putting best targets at front,
* returns number of best targets (or 0, no suitable targets) */
static int
iter_filter_order(struct iter_env* iter_env, struct module_env* env,
uint8_t* name, size_t namelen, uint16_t qtype, uint32_t now,
struct delegpt* dp, int* selected_rtt, int open_target,
struct sock_list* blacklist)
{
int got_num = 0, low_rtt = 0, swap_to_front;
struct delegpt_addr* a, *n, *prev=NULL;
/* fillup sel_rtt and find best rtt in the bunch */
got_num = iter_fill_rtt(iter_env, env, name, namelen, qtype, now, dp,
&low_rtt, blacklist);
if(got_num == 0)
return 0;
if(low_rtt >= USEFUL_SERVER_TOP_TIMEOUT &&
(delegpt_count_missing_targets(dp) > 0 || open_target > 0)) {
verbose(VERB_ALGO, "Bad choices, trying to get more choice");
return 0; /* we want more choice. The best choice is a bad one.
return 0 to force the caller to fetch more */
}
got_num = 0;
a = dp->result_list;
while(a) {
/* skip unsuitable targets */
if(a->sel_rtt == -1) {
prev = a;
a = a->next_result;
continue;
}
/* classify the server address and determine what to do */
swap_to_front = 0;
if(a->sel_rtt >= low_rtt && a->sel_rtt - low_rtt <= RTT_BAND) {
got_num++;
swap_to_front = 1;
} else if(a->sel_rtt<low_rtt && low_rtt-a->sel_rtt<=RTT_BAND) {
got_num++;
swap_to_front = 1;
}
/* swap to front if necessary, or move to next result */
if(swap_to_front && prev) {
n = a->next_result;
prev->next_result = n;
a->next_result = dp->result_list;
dp->result_list = a;
a = n;
} else {
prev = a;
a = a->next_result;
}
}
*selected_rtt = low_rtt;
return got_num;
}
struct delegpt_addr*
iter_server_selection(struct iter_env* iter_env,
struct module_env* env, struct delegpt* dp,
uint8_t* name, size_t namelen, uint16_t qtype, int* dnssec_expected,
int* chase_to_rd, int open_target, struct sock_list* blacklist)
{
int sel;
int selrtt;
struct delegpt_addr* a, *prev;
int num = iter_filter_order(iter_env, env, name, namelen, qtype,
*env->now, dp, &selrtt, open_target, blacklist);
if(num == 0)
return NULL;
verbose(VERB_ALGO, "selrtt %d", selrtt);
if(selrtt > USEFUL_SERVER_TOP_TIMEOUT*2) {
verbose(VERB_ALGO, "chase to recursion lame server");
*chase_to_rd = 1;
}
if(selrtt > USEFUL_SERVER_TOP_TIMEOUT) {
verbose(VERB_ALGO, "chase to dnssec lame server");
*dnssec_expected = 0;
}
if(selrtt == USEFUL_SERVER_TOP_TIMEOUT) {
verbose(VERB_ALGO, "chase to blacklisted lame server");
/* the best choice is a blacklisted, unresponsive server,
* we need to throttle down our traffic towards it */
if(ub_random(env->rnd) % 100 != 1) {
/* 99% of the time, drop query */
return NULL;
}
}
if(num == 1) {
a = dp->result_list;
if(++a->attempts < OUTBOUND_MSG_RETRY)
return a;
dp->result_list = a->next_result;
return a;
}
/* randomly select a target from the list */
log_assert(num > 1);
/* we do not need secure random numbers here, but
* we do need it to be threadsafe, so we use this */
sel = ub_random(env->rnd) % num;
a = dp->result_list;
prev = NULL;
while(sel > 0 && a) {
prev = a;
a = a->next_result;
sel--;
}
if(!a) /* robustness */
return NULL;
if(++a->attempts < OUTBOUND_MSG_RETRY)
return a;
/* remove it from the delegation point result list */
if(prev)
prev->next_result = a->next_result;
else dp->result_list = a->next_result;
return a;
}
struct dns_msg*
dns_alloc_msg(ldns_buffer* pkt, struct msg_parse* msg,
struct regional* region)
{
struct dns_msg* m = (struct dns_msg*)regional_alloc(region,
sizeof(struct dns_msg));
if(!m)
return NULL;
memset(m, 0, sizeof(*m));
if(!parse_create_msg(pkt, msg, NULL, &m->qinfo, &m->rep, region)) {
log_err("malloc failure: allocating incoming dns_msg");
return NULL;
}
return m;
}
struct dns_msg*
dns_copy_msg(struct dns_msg* from, struct regional* region)
{
struct dns_msg* m = (struct dns_msg*)regional_alloc(region,
sizeof(struct dns_msg));
if(!m)
return NULL;
m->qinfo = from->qinfo;
if(!(m->qinfo.qname = regional_alloc_init(region, from->qinfo.qname,
from->qinfo.qname_len)))
return NULL;
if(!(m->rep = reply_info_copy(from->rep, NULL, region)))
return NULL;
return m;
}
int
iter_dns_store(struct module_env* env, struct query_info* msgqinf,
struct reply_info* msgrep, int is_referral)
{
return dns_cache_store(env, msgqinf, msgrep, is_referral);
}
int
iter_ns_probability(struct ub_randstate* rnd, int n, int m)
{
int sel;
if(n == m) /* 100% chance */
return 1;
/* we do not need secure random numbers here, but
* we do need it to be threadsafe, so we use this */
sel = ub_random(rnd) % m;
return (sel < n);
}
int iter_suspect_exists(struct query_info* qinfo, struct delegpt* dp,
struct module_env* env)
{
struct ub_packed_rrset_key* r;
if(qinfo->qtype != LDNS_RR_TYPE_A && qinfo->qtype != LDNS_RR_TYPE_AAAA)
return 0; /* not glue type */
if(!dname_subdomain_c(qinfo->qname, dp->name))
return 0; /* not in-zone */
if(!delegpt_find_ns(dp, qinfo->qname, qinfo->qname_len))
return 0; /* not glue */
/* do we suspect that it exists? lookup with time=0 */
r = rrset_cache_lookup(env->rrset_cache, qinfo->qname,
qinfo->qname_len, qinfo->qtype, qinfo->qclass, 0, 0, 0);
if(r) {
struct packed_rrset_data* d = (struct packed_rrset_data*)
r->entry.data;
/* if it is valid, no need for queries to parent zone */
if(*env->now <= d->ttl) {
lock_rw_unlock(&r->entry.lock);
return 0;
}
/* was it recently expired? */
if( (*env->now - d->ttl) <= SUSPICION_RECENT_EXPIRY) {
verbose(VERB_ALGO, "suspect glue at parent: "
"rrset recently expired");
lock_rw_unlock(&r->entry.lock);
return 1;
}
lock_rw_unlock(&r->entry.lock);
}
/* so, qinfo not there, does the other A/AAAA type exist in cache? */
r=rrset_cache_lookup(env->rrset_cache, qinfo->qname, qinfo->qname_len,
(qinfo->qtype==LDNS_RR_TYPE_A)?LDNS_RR_TYPE_AAAA:LDNS_RR_TYPE_A,
qinfo->qclass, 0, *env->now, 0);
if(r) {
/* it exists and explains why the glue is there */
lock_rw_unlock(&r->entry.lock);
return 0;
}
/* neither exist, so logically, one should exist for a nameserver */
verbose(VERB_ALGO, "suspect glue at parent: "
"neither A nor AAAA exist in cache");
return 1;
}
/** detect dependency cycle for query and target */
static int
causes_cycle(struct module_qstate* qstate, uint8_t* name, size_t namelen,
uint16_t t, uint16_t c)
{
struct query_info qinf;
qinf.qname = name;
qinf.qname_len = namelen;
qinf.qtype = t;
qinf.qclass = c;
fptr_ok(fptr_whitelist_modenv_detect_cycle(
qstate->env->detect_cycle));
return (*qstate->env->detect_cycle)(qstate, &qinf,
(uint16_t)(BIT_RD|BIT_CD), qstate->is_priming);
}
void
iter_mark_cycle_targets(struct module_qstate* qstate, struct delegpt* dp)
{
struct delegpt_ns* ns;
for(ns = dp->nslist; ns; ns = ns->next) {
if(ns->resolved)
continue;
/* see if this ns as target causes dependency cycle */
if(causes_cycle(qstate, ns->name, ns->namelen,
LDNS_RR_TYPE_AAAA, qstate->qinfo.qclass) ||
causes_cycle(qstate, ns->name, ns->namelen,
LDNS_RR_TYPE_A, qstate->qinfo.qclass)) {
log_nametypeclass(VERB_QUERY, "skipping target due "
"to dependency cycle (harden-glue: no may "
"fix some of the cycles)",
ns->name, LDNS_RR_TYPE_A,
qstate->qinfo.qclass);
ns->resolved = 1;
}
}
}
int
iter_dp_is_useless(struct query_info* qinfo, uint16_t qflags,
struct delegpt* dp)
{
struct delegpt_ns* ns;
/* check:
* o RD qflag is off.
* o no addresses are provided.
* o all NS items are required glue.
* OR
* o RD qflag is off.
* o no addresses are provided.
* o the query is for one of the nameservers in dp,
* and that nameserver is a glue-name for this dp.
*/
if(!(qflags&BIT_RD))
return 0;
/* either available or unused targets */
if(dp->usable_list || dp->result_list)
return 0;
/* see if query is for one of the nameservers, which is glue */
if( (qinfo->qtype == LDNS_RR_TYPE_A ||
qinfo->qtype == LDNS_RR_TYPE_AAAA) &&
dname_subdomain_c(qinfo->qname, dp->name) &&
delegpt_find_ns(dp, qinfo->qname, qinfo->qname_len))
return 1;
for(ns = dp->nslist; ns; ns = ns->next) {
if(ns->resolved) /* skip failed targets */
continue;
if(!dname_subdomain_c(ns->name, dp->name))
return 0; /* one address is not required glue */
}
return 1;
}
int
iter_indicates_dnssec(struct module_env* env, struct delegpt* dp,
struct dns_msg* msg, uint16_t dclass)
{
struct trust_anchor* a;
/* information not available, !env->anchors can be common */
if(!env || !env->anchors || !dp || !dp->name)
return 0;
/* a trust anchor exists with this name, RRSIGs expected */
if((a=anchor_find(env->anchors, dp->name, dp->namelabs, dp->namelen,
dclass))) {
lock_basic_unlock(&a->lock);
return 1;
}
/* see if DS rrset was given, in AUTH section */
if(msg && msg->rep &&
reply_find_rrset_section_ns(msg->rep, dp->name, dp->namelen,
LDNS_RR_TYPE_DS, dclass))
return 1;
return 0;
}
int
iter_msg_has_dnssec(struct dns_msg* msg)
{
size_t i;
if(!msg || !msg->rep)
return 0;
for(i=0; i<msg->rep->an_numrrsets + msg->rep->ns_numrrsets; i++) {
if(((struct packed_rrset_data*)msg->rep->rrsets[i]->
entry.data)->rrsig_count > 0)
return 1;
}
/* empty message has no DNSSEC info, with DNSSEC the reply is
* not empty (NSEC) */
return 0;
}
int iter_msg_from_zone(struct dns_msg* msg, struct delegpt* dp,
enum response_type type, uint16_t dclass)
{
if(!msg || !dp || !msg->rep || !dp->name)
return 0;
/* SOA RRset - always from reply zone */
if(reply_find_rrset_section_an(msg->rep, dp->name, dp->namelen,
LDNS_RR_TYPE_SOA, dclass) ||
reply_find_rrset_section_ns(msg->rep, dp->name, dp->namelen,
LDNS_RR_TYPE_SOA, dclass))
return 1;
if(type == RESPONSE_TYPE_REFERRAL) {
size_t i;
/* if it adds a single label, i.e. we expect .com,
* and referral to example.com. NS ... , then origin zone
* is .com. For a referral to sub.example.com. NS ... then
* we do not know, since example.com. may be in between. */
for(i=0; i<msg->rep->an_numrrsets+msg->rep->ns_numrrsets;
i++) {
struct ub_packed_rrset_key* s = msg->rep->rrsets[i];
if(ntohs(s->rk.type) == LDNS_RR_TYPE_NS &&
ntohs(s->rk.rrset_class) == dclass) {
int l = dname_count_labels(s->rk.dname);
if(l == dp->namelabs + 1 &&
dname_strict_subdomain(s->rk.dname,
l, dp->name, dp->namelabs))
return 1;
}
}
return 0;
}
log_assert(type==RESPONSE_TYPE_ANSWER || type==RESPONSE_TYPE_CNAME);
/* not a referral, and not lame delegation (upwards), so,
* any NS rrset must be from the zone itself */
if(reply_find_rrset_section_an(msg->rep, dp->name, dp->namelen,
LDNS_RR_TYPE_NS, dclass) ||
reply_find_rrset_section_ns(msg->rep, dp->name, dp->namelen,
LDNS_RR_TYPE_NS, dclass))
return 1;
/* a DNSKEY set is expected at the zone apex as well */
/* this is for 'minimal responses' for DNSKEYs */
if(reply_find_rrset_section_an(msg->rep, dp->name, dp->namelen,
LDNS_RR_TYPE_DNSKEY, dclass))
return 1;
return 0;
}
/**
* check equality of two rrsets
* @param k1: rrset
* @param k2: rrset
* @return true if equal
*/
static int
rrset_equal(struct ub_packed_rrset_key* k1, struct ub_packed_rrset_key* k2)
{
struct packed_rrset_data* d1 = (struct packed_rrset_data*)
k1->entry.data;
struct packed_rrset_data* d2 = (struct packed_rrset_data*)
k2->entry.data;
size_t i, t;
if(k1->rk.dname_len != k2->rk.dname_len ||
k1->rk.flags != k2->rk.flags ||
k1->rk.type != k2->rk.type ||
k1->rk.rrset_class != k2->rk.rrset_class ||
query_dname_compare(k1->rk.dname, k2->rk.dname) != 0)
return 0;
if(d1->ttl != d2->ttl ||
d1->count != d2->count ||
d1->rrsig_count != d2->rrsig_count ||
d1->trust != d2->trust ||
d1->security != d2->security)
return 0;
t = d1->count + d1->rrsig_count;
for(i=0; i<t; i++) {
if(d1->rr_len[i] != d2->rr_len[i] ||
d1->rr_ttl[i] != d2->rr_ttl[i] ||
memcmp(d1->rr_data[i], d2->rr_data[i],
d1->rr_len[i]) != 0)
return 0;
}
return 1;
}
int
reply_equal(struct reply_info* p, struct reply_info* q)
{
size_t i;
if(p->flags != q->flags ||
p->qdcount != q->qdcount ||
p->ttl != q->ttl ||
p->security != q->security ||
p->an_numrrsets != q->an_numrrsets ||
p->ns_numrrsets != q->ns_numrrsets ||
p->ar_numrrsets != q->ar_numrrsets ||
p->rrset_count != q->rrset_count)
return 0;
for(i=0; i<p->rrset_count; i++) {
if(!rrset_equal(p->rrsets[i], q->rrsets[i]))
return 0;
}
return 1;
}
+213
View File
@@ -0,0 +1,213 @@
/*
* iterator/iter_utils.h - iterative resolver module utility functions.
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains functions to assist the iterator module.
* Configuration options. Forward zones.
*/
#ifndef ITERATOR_ITER_UTILS_H
#define ITERATOR_ITER_UTILS_H
#include "iterator/iter_resptype.h"
struct iter_env;
struct config_file;
struct module_env;
struct delegpt_addr;
struct delegpt;
struct regional;
struct msg_parse;
struct ub_randstate;
struct query_info;
struct reply_info;
struct module_qstate;
struct sock_list;
/**
* Process config options and set iterator module state.
* Sets default values if no config is found.
* @param iter_env: iterator module state.
* @param cfg: config options.
* @return 0 on error.
*/
int iter_apply_cfg(struct iter_env* iter_env, struct config_file* cfg);
/**
* Select a valid, nice target to send query to.
* Sorting and removing unsuitable targets is combined.
*
* @param iter_env: iterator module global state, with ip6 enabled and
* do-not-query-addresses.
* @param env: environment with infra cache (lameness, rtt info).
* @param dp: delegation point with result list.
* @param name: zone name (for lameness check).
* @param namelen: length of name.
* @param qtype: query type that we want to send.
* @param dnssec_expected: set to 0, if a known dnssec-lame server is selected
* these are not preferred, but are used as a last resort.
* @param chase_to_rd: set to 1 if a known recursion lame server is selected
* these are not preferred, but are used as a last resort.
* @param open_target: number of currently outstanding target queries.
* If we wait for these, perhaps more server addresses become available.
* @param blacklist: the IP blacklist to use.
* @return best target or NULL if no target.
* if not null, that target is removed from the result list in the dp.
*/
struct delegpt_addr* iter_server_selection(struct iter_env* iter_env,
struct module_env* env, struct delegpt* dp, uint8_t* name,
size_t namelen, uint16_t qtype, int* dnssec_expected,
int* chase_to_rd, int open_target, struct sock_list* blacklist);
/**
* Allocate dns_msg from parsed msg, in regional.
* @param pkt: packet.
* @param msg: parsed message (cleaned and ready for regional allocation).
* @param regional: regional to use for allocation.
* @return newly allocated dns_msg, or NULL on memory error.
*/
struct dns_msg* dns_alloc_msg(ldns_buffer* pkt, struct msg_parse* msg,
struct regional* regional);
/**
* Copy a dns_msg to this regional.
* @param from: dns message, also in regional.
* @param regional: regional to use for allocation.
* @return newly allocated dns_msg, or NULL on memory error.
*/
struct dns_msg* dns_copy_msg(struct dns_msg* from, struct regional* regional);
/**
* Allocate a dns_msg with malloc/alloc structure and store in dns cache.
* @param env: environment, with alloc structure and dns cache.
* @param qinf: query info, the query for which answer is stored.
* @param rep: reply in dns_msg from dns_alloc_msg for example.
* @param is_referral: If true, then the given message to be stored is a
* referral. The cache implementation may use this as a hint.
* @return 0 on alloc error (out of memory).
*/
int iter_dns_store(struct module_env* env, struct query_info* qinf,
struct reply_info* rep, int is_referral);
/**
* Select randomly with n/m probability.
* For shuffle NS records for address fetching.
* @param rnd: random table
* @param n: probability.
* @param m: divisor for probability.
* @return true with n/m probability.
*/
int iter_ns_probability(struct ub_randstate* rnd, int n, int m);
/**
* Mark targets that result in a dependency cycle as done, so they
* will not get selected as targets.
* @param qstate: query state.
* @param dp: delegpt to mark ns in.
*/
void iter_mark_cycle_targets(struct module_qstate* qstate, struct delegpt* dp);
/**
* See if query is in-zone glue and we suspect that it exists.
* Suspicion that it exists, is if there is no A or AAAA in cache (since
* one of them is expected for an NS record) or the qtype is in cache but
* was recently expired (so we have seen this data recently).
* @param qinfo: query info.
* @param dp: delegation point we are at.
* @param env: environment with rrset cache.
* @return true if suspect that this glue exists.
*/
int iter_suspect_exists(struct query_info* qinfo, struct delegpt* dp,
struct module_env* env);
/**
* See if delegation is useful or offers immediately no targets for
* further recursion.
* @param qinfo: query name and type
* @param qflags: query flags with RD flag
* @param dp: delegpt to check.
*/
int iter_dp_is_useless(struct query_info* qinfo, uint16_t qflags,
struct delegpt* dp);
/**
* See if delegation is expected to have DNSSEC information (RRSIGs) in
* its answers, or not. Inspects delegation point (name), trust anchors,
* and delegation message (DS RRset) to determine this.
* @param env: module env with trust anchors.
* @param dp: delegation point.
* @param msg: delegation message, with DS if a secure referral.
* @param dclass: class of query.
* @return 1 if dnssec is expected, 0 if not.
*/
int iter_indicates_dnssec(struct module_env* env, struct delegpt* dp,
struct dns_msg* msg, uint16_t dclass);
/**
* See if a message contains DNSSEC.
* This is examined by looking for RRSIGs. With DNSSEC a valid answer,
* nxdomain, nodata, referral or cname reply has RRSIGs in answer or auth
* sections, sigs on answer data, SOA, DS, or NSEC/NSEC3 records.
* @param msg: message to examine.
* @return true if DNSSEC information was found.
*/
int iter_msg_has_dnssec(struct dns_msg* msg);
/**
* See if a message is known to be from a certain zone.
* This looks for SOA or NS rrsets, for answers.
* For referrals, when one label is delegated, the zone is detected.
* Does not look at signatures.
* @param msg: the message to inspect.
* @param dp: delegation point with zone name to look for.
* @param type: type of message.
* @param dclass: class of query.
* @return true if message is certain to be from zone in dp->name.
* false if not sure (empty msg), or not from the zone.
*/
int iter_msg_from_zone(struct dns_msg* msg, struct delegpt* dp,
enum response_type type, uint16_t dclass);
/**
* Check if two replies are equal
* For fallback procedures
* @param p: reply one. The reply has rrset data pointers in region.
* Does not check rrset-IDs
* @param q: reply two
* @return if one and two are equal.
*/
int reply_equal(struct reply_info* p, struct reply_info* q);
#endif /* ITERATOR_ITER_UTILS_H */
+2265
View File
File diff suppressed because it is too large Load Diff
+332
View File
@@ -0,0 +1,332 @@
/*
* iterator/iterator.h - iterative resolver DNS query response module
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains a module that performs recusive iterative DNS query
* processing.
*/
#ifndef ITERATOR_ITERATOR_H
#define ITERATOR_ITERATOR_H
#include "services/outbound_list.h"
#include "util/data/msgreply.h"
#include "util/module.h"
struct delegpt;
struct iter_hints;
struct iter_forwards;
struct iter_donotq;
struct iter_prep_list;
struct iter_priv;
/** max number of query restarts. Determines max number of CNAME chain. */
#define MAX_RESTART_COUNT 8
/** max number of referrals. Makes sure resolver does not run away */
#define MAX_REFERRAL_COUNT 30
/** how nice is a server without further information, in msec
* Equals rtt initial timeout value.
*/
#define UNKNOWN_SERVER_NICENESS 376
/** maximum timeout before a host is deemed unsuitable, in msec.
* After host_ttl this will be timed out and the host will be tried again.
* Equals RTT_MAX_TIMEOUT
*/
#define USEFUL_SERVER_TOP_TIMEOUT 120000
/** Number of lost messages in a row that get a host blacklisted.
* With 16, a couple different queries have to time out and no working
* queries are happening */
#define USEFUL_SERVER_MAX_LOST 16
/** number of retries on outgoing queries */
#define OUTBOUND_MSG_RETRY 5
/** RTT band, within this amount from the best, servers are chosen randomly.
* Chosen so that the UNKNOWN_SERVER_NICENESS falls within the band of a
* fast server, this causes server exploration as a side benefit. msec. */
#define RTT_BAND 400
/**
* Global state for the iterator.
*/
struct iter_env {
/**
* The hints -- these aren't stored in the cache because they don't
* expire. The hints are always used to "prime" the cache. Note
* that both root hints and stub zone "hints" are stored in this
* data structure.
*/
struct iter_hints* hints;
/** A flag to indicate whether or not we have an IPv6 route */
int supports_ipv6;
/** A set of inetaddrs that should never be queried. */
struct iter_donotq* donotq;
/** private address space and private domains */
struct iter_priv* priv;
/** The maximum dependency depth that this resolver will pursue. */
int max_dependency_depth;
/**
* The target fetch policy for each dependency level. This is
* described as a simple number (per dependency level):
* negative numbers (usually just -1) mean fetch-all,
* 0 means only fetch on demand, and
* positive numbers mean to fetch at most that many targets.
* array of max_dependency_depth+1 size.
*/
int* target_fetch_policy;
};
/**
* State of the iterator for a query.
*/
enum iter_state {
/**
* Externally generated queries start at this state. Query restarts are
* reset to this state.
*/
INIT_REQUEST_STATE = 0,
/**
* Root priming events reactivate here, most other events pass
* through this naturally as the 2nd part of the INIT_REQUEST_STATE.
*/
INIT_REQUEST_2_STATE,
/**
* Stub priming events reactivate here, most other events pass
* through this naturally as the 3rd part of the INIT_REQUEST_STATE.
*/
INIT_REQUEST_3_STATE,
/**
* Each time a delegation point changes for a given query or a
* query times out and/or wakes up, this state is (re)visited.
* This state is reponsible for iterating through a list of
* nameserver targets.
*/
QUERYTARGETS_STATE,
/**
* Responses to queries start at this state. This state handles
* the decision tree associated with handling responses.
*/
QUERY_RESP_STATE,
/** Responses to priming queries finish at this state. */
PRIME_RESP_STATE,
/** Responses that are to be returned upstream end at this state.
* As well as responses to target queries. */
FINISHED_STATE
};
/**
* Per query state for the iterator module.
*/
struct iter_qstate {
/**
* State of the iterator module.
* This is the state that event is in or should sent to -- all
* requests should start with the INIT_REQUEST_STATE. All
* responses should start with QUERY_RESP_STATE. Subsequent
* processing of the event will change this state.
*/
enum iter_state state;
/**
* Final state for the iterator module.
* This is the state that responses should be routed to once the
* response is final. For externally initiated queries, this
* will be FINISHED_STATE, locally initiated queries will have
* different final states.
*/
enum iter_state final_state;
/**
* The depth of this query, this means the depth of recursion.
* This address is needed for another query, which is an address
* needed for another query, etc. Original client query has depth 0.
*/
int depth;
/**
* The response
*/
struct dns_msg* response;
/**
* This is a list of RRsets that must be prepended to the
* ANSWER section of a response before being sent upstream.
*/
struct iter_prep_list* an_prepend_list;
/** Last element of the prepend list */
struct iter_prep_list* an_prepend_last;
/**
* This is the list of RRsets that must be prepended to the
* AUTHORITY section of the response before being sent upstream.
*/
struct iter_prep_list* ns_prepend_list;
/** Last element of the authority prepend list */
struct iter_prep_list* ns_prepend_last;
/** query name used for chasing the results. Initially the same as
* the state qinfo, but after CNAMEs this will be different.
* The query info used to elicit the results needed. */
struct query_info qchase;
/** query flags to use when chasing the answer (i.e. RD flag) */
uint16_t chase_flags;
/** true if we set RD bit because of last resort recursion lame query*/
int chase_to_rd;
/**
* This is the current delegation point for an in-progress query. This
* object retains state as to which delegation targets need to be
* (sub)queried for vs which ones have already been visited.
*/
struct delegpt* dp;
/** state for 0x20 fallback when capsfail happens, 0 not a fallback */
int caps_fallback;
/** state for capsfail: current server number to try */
size_t caps_server;
/** state for capsfail: stored query for comparisons */
struct reply_info* caps_reply;
/** Current delegation message - returned for non-RD queries */
struct dns_msg* deleg_msg;
/** number of outstanding target sub queries */
int num_target_queries;
/** outstanding direct queries */
int num_current_queries;
/** the number of times this query has been restarted. */
int query_restart_count;
/** the number of times this query as followed a referral. */
int referral_count;
/**
* expected dnssec information for this iteration step.
* If dnssec rrsigs are expected and not given, the server is marked
* lame (dnssec-lame).
*/
int dnssec_expected;
/**
* This is flag that, if true, means that this event is
* waiting for a stub priming query.
*/
int wait_priming_stub;
/**
* This is a flag that, if true, means that this query is
* for (re)fetching glue from a zone. Since the address should
* have been glue, query again to the servers that should have
* been returning it as glue.
* The delegation point must be set to the one that should *not*
* be used when creating the state. A higher one will be attempted.
*/
int refetch_glue;
/** list of pending queries to authoritative servers. */
struct outbound_list outlist;
};
/**
* List of prepend items
*/
struct iter_prep_list {
/** next in list */
struct iter_prep_list* next;
/** rrset */
struct ub_packed_rrset_key* rrset;
};
/**
* Get the iterator function block.
* @return: function block with function pointers to iterator methods.
*/
struct module_func_block* iter_get_funcblock();
/**
* Get iterator state as a string
* @param state: to convert
* @return constant string that is printable.
*/
const char* iter_state_to_string(enum iter_state state);
/**
* See if iterator state is a response state
* @param s: to inspect
* @return true if response state.
*/
int iter_state_is_responsestate(enum iter_state s);
/** iterator init */
int iter_init(struct module_env* env, int id);
/** iterator deinit */
void iter_deinit(struct module_env* env, int id);
/** iterator operate on a query */
void iter_operate(struct module_qstate* qstate, enum module_ev event, int id,
struct outbound_entry* outbound);
/**
* Return priming query results to interestes super querystates.
*
* Sets the delegation point and delegation message (not nonRD queries).
* This is a callback from walk_supers.
*
* @param qstate: query state that finished.
* @param id: module id.
* @param super: the qstate to inform.
*/
void iter_inform_super(struct module_qstate* qstate, int id,
struct module_qstate* super);
/** iterator cleanup query state */
void iter_clear(struct module_qstate* qstate, int id);
/** iterator alloc size routine */
size_t iter_get_mem(struct module_env* env, int id);
#endif /* ITERATOR_ITERATOR_H */
BIN
View File
Binary file not shown.
+400
View File
@@ -0,0 +1,400 @@
/*
* libunbound/context.c - validating context for unbound internal use
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains the validator context structure.
*/
#include "config.h"
#include "libunbound/context.h"
#include "util/module.h"
#include "util/config_file.h"
#include "util/net_help.h"
#include "services/modstack.h"
#include "services/localzone.h"
#include "services/cache/rrset.h"
#include "services/cache/infra.h"
#include "util/data/msgreply.h"
#include "util/storage/slabhash.h"
int
context_finalize(struct ub_ctx* ctx)
{
struct config_file* cfg = ctx->env->cfg;
verbosity = cfg->verbosity;
if(ctx->logfile_override)
log_file(ctx->log_out);
else log_init(cfg->logfile, cfg->use_syslog, NULL);
config_apply(cfg);
if(!modstack_setup(&ctx->mods, cfg->module_conf, ctx->env))
return UB_INITFAIL;
ctx->local_zones = local_zones_create();
if(!ctx->local_zones)
return UB_NOMEM;
if(!local_zones_apply_cfg(ctx->local_zones, cfg))
return UB_INITFAIL;
if(!ctx->env->msg_cache ||
cfg->msg_cache_size != slabhash_get_size(ctx->env->msg_cache) ||
cfg->msg_cache_slabs != ctx->env->msg_cache->size) {
slabhash_delete(ctx->env->msg_cache);
ctx->env->msg_cache = slabhash_create(cfg->msg_cache_slabs,
HASH_DEFAULT_STARTARRAY, cfg->msg_cache_size,
msgreply_sizefunc, query_info_compare,
query_entry_delete, reply_info_delete, NULL);
if(!ctx->env->msg_cache)
return UB_NOMEM;
}
ctx->env->rrset_cache = rrset_cache_adjust(ctx->env->rrset_cache,
ctx->env->cfg, ctx->env->alloc);
if(!ctx->env->rrset_cache)
return UB_NOMEM;
ctx->env->infra_cache = infra_adjust(ctx->env->infra_cache, cfg);
if(!ctx->env->infra_cache)
return UB_NOMEM;
ctx->finalized = 1;
return UB_NOERROR;
}
int context_query_cmp(const void* a, const void* b)
{
if( *(int*)a < *(int*)b )
return -1;
if( *(int*)a > *(int*)b )
return 1;
return 0;
}
void
context_query_delete(struct ctx_query* q)
{
if(!q) return;
ub_resolve_free(q->res);
free(q->msg);
free(q);
}
/** How many times to try to find an unused query-id-number for async */
#define NUM_ID_TRIES 100000
/** find next useful id number of 0 on error */
static int
find_id(struct ub_ctx* ctx, int* id)
{
size_t tries = 0;
ctx->next_querynum++;
while(rbtree_search(&ctx->queries, &ctx->next_querynum)) {
ctx->next_querynum++; /* numerical wraparound is fine */
if(tries++ > NUM_ID_TRIES)
return 0;
}
*id = ctx->next_querynum;
return 1;
}
struct ctx_query*
context_new(struct ub_ctx* ctx, char* name, int rrtype, int rrclass,
ub_callback_t cb, void* cbarg)
{
struct ctx_query* q = (struct ctx_query*)calloc(1, sizeof(*q));
if(!q) return NULL;
lock_basic_lock(&ctx->cfglock);
if(!find_id(ctx, &q->querynum)) {
lock_basic_unlock(&ctx->cfglock);
free(q);
return NULL;
}
lock_basic_unlock(&ctx->cfglock);
q->node.key = &q->querynum;
q->async = (cb != NULL);
q->cb = cb;
q->cb_arg = cbarg;
q->res = (struct ub_result*)calloc(1, sizeof(*q->res));
if(!q->res) {
free(q);
return NULL;
}
q->res->qname = strdup(name);
if(!q->res->qname) {
free(q->res);
free(q);
return NULL;
}
q->res->qtype = rrtype;
q->res->qclass = rrclass;
/* add to query list */
lock_basic_lock(&ctx->cfglock);
if(q->async)
ctx->num_async ++;
(void)rbtree_insert(&ctx->queries, &q->node);
lock_basic_unlock(&ctx->cfglock);
return q;
}
struct alloc_cache*
context_obtain_alloc(struct ub_ctx* ctx, int locking)
{
struct alloc_cache* a;
int tnum = 0;
if(locking) {
lock_basic_lock(&ctx->cfglock);
}
a = ctx->alloc_list;
if(a)
ctx->alloc_list = a->super; /* snip off list */
else tnum = ctx->thr_next_num++;
if(locking) {
lock_basic_unlock(&ctx->cfglock);
}
if(a) {
a->super = &ctx->superalloc;
return a;
}
a = (struct alloc_cache*)calloc(1, sizeof(*a));
if(!a)
return NULL;
alloc_init(a, &ctx->superalloc, tnum);
return a;
}
void
context_release_alloc(struct ub_ctx* ctx, struct alloc_cache* alloc,
int locking)
{
if(!ctx || !alloc)
return;
if(locking) {
lock_basic_lock(&ctx->cfglock);
}
alloc->super = ctx->alloc_list;
ctx->alloc_list = alloc;
if(locking) {
lock_basic_unlock(&ctx->cfglock);
}
}
uint8_t*
context_serialize_new_query(struct ctx_query* q, uint32_t* len)
{
/* format for new query is
* o uint32 cmd
* o uint32 id
* o uint32 type
* o uint32 class
* o rest queryname (string)
*/
uint8_t* p;
size_t slen = strlen(q->res->qname) + 1/*end of string*/;
*len = sizeof(uint32_t)*4 + slen;
p = (uint8_t*)malloc(*len);
if(!p) return NULL;
ldns_write_uint32(p, UB_LIBCMD_NEWQUERY);
ldns_write_uint32(p+sizeof(uint32_t), (uint32_t)q->querynum);
ldns_write_uint32(p+2*sizeof(uint32_t), (uint32_t)q->res->qtype);
ldns_write_uint32(p+3*sizeof(uint32_t), (uint32_t)q->res->qclass);
memmove(p+4*sizeof(uint32_t), q->res->qname, slen);
return p;
}
struct ctx_query*
context_deserialize_new_query(struct ub_ctx* ctx, uint8_t* p, uint32_t len)
{
struct ctx_query* q = (struct ctx_query*)calloc(1, sizeof(*q));
if(!q) return NULL;
if(len < 4*sizeof(uint32_t)+1) {
free(q);
return NULL;
}
log_assert( ldns_read_uint32(p) == UB_LIBCMD_NEWQUERY);
q->querynum = (int)ldns_read_uint32(p+sizeof(uint32_t));
q->node.key = &q->querynum;
q->async = 1;
q->res = (struct ub_result*)calloc(1, sizeof(*q->res));
if(!q->res) {
free(q);
return NULL;
}
q->res->qtype = (int)ldns_read_uint32(p+2*sizeof(uint32_t));
q->res->qclass = (int)ldns_read_uint32(p+3*sizeof(uint32_t));
q->res->qname = strdup((char*)(p+4*sizeof(uint32_t)));
if(!q->res->qname) {
free(q->res);
free(q);
return NULL;
}
/** add to query list */
ctx->num_async++;
(void)rbtree_insert(&ctx->queries, &q->node);
return q;
}
struct ctx_query*
context_lookup_new_query(struct ub_ctx* ctx, uint8_t* p, uint32_t len)
{
struct ctx_query* q;
int querynum;
if(len < 4*sizeof(uint32_t)+1) {
return NULL;
}
log_assert( ldns_read_uint32(p) == UB_LIBCMD_NEWQUERY);
querynum = (int)ldns_read_uint32(p+sizeof(uint32_t));
q = (struct ctx_query*)rbtree_search(&ctx->queries, &querynum);
if(!q) {
return NULL;
}
log_assert(q->async);
return q;
}
uint8_t*
context_serialize_answer(struct ctx_query* q, int err, ldns_buffer* pkt,
uint32_t* len)
{
/* answer format
* o uint32 cmd
* o uint32 id
* o uint32 error_code
* o uint32 msg_security
* o uint32 length of why_bogus string (+1 for eos); 0 absent.
* o why_bogus_string
* o the remainder is the answer msg from resolver lookup.
* remainder can be length 0.
*/
size_t pkt_len = pkt?ldns_buffer_remaining(pkt):0;
size_t wlen = (pkt&&q->res->why_bogus)?strlen(q->res->why_bogus)+1:0;
uint8_t* p;
*len = sizeof(uint32_t)*5 + pkt_len + wlen;
p = (uint8_t*)malloc(*len);
if(!p) return NULL;
ldns_write_uint32(p, UB_LIBCMD_ANSWER);
ldns_write_uint32(p+sizeof(uint32_t), (uint32_t)q->querynum);
ldns_write_uint32(p+2*sizeof(uint32_t), (uint32_t)err);
ldns_write_uint32(p+3*sizeof(uint32_t), (uint32_t)q->msg_security);
ldns_write_uint32(p+4*sizeof(uint32_t), (uint32_t)wlen);
if(wlen > 0)
memmove(p+5*sizeof(uint32_t), q->res->why_bogus, wlen);
if(pkt_len > 0)
memmove(p+5*sizeof(uint32_t)+wlen,
ldns_buffer_begin(pkt), pkt_len);
return p;
}
struct ctx_query*
context_deserialize_answer(struct ub_ctx* ctx,
uint8_t* p, uint32_t len, int* err)
{
struct ctx_query* q = NULL ;
int id;
size_t wlen;
if(len < 5*sizeof(uint32_t)) return NULL;
log_assert( ldns_read_uint32(p) == UB_LIBCMD_ANSWER);
id = (int)ldns_read_uint32(p+sizeof(uint32_t));
q = (struct ctx_query*)rbtree_search(&ctx->queries, &id);
if(!q) return NULL;
*err = (int)ldns_read_uint32(p+2*sizeof(uint32_t));
q->msg_security = ldns_read_uint32(p+3*sizeof(uint32_t));
wlen = (size_t)ldns_read_uint32(p+4*sizeof(uint32_t));
if(len > 5*sizeof(uint32_t) && wlen > 0) {
if(len >= 5*sizeof(uint32_t)+wlen)
q->res->why_bogus = (char*)memdup(
p+5*sizeof(uint32_t), wlen);
if(!q->res->why_bogus) {
/* pass malloc failure to the user callback */
q->msg_len = 0;
*err = UB_NOMEM;
return q;
}
q->res->why_bogus[wlen-1] = 0; /* zero terminated for sure */
}
if(len > 5*sizeof(uint32_t)+wlen) {
q->msg_len = len - 5*sizeof(uint32_t) - wlen;
q->msg = (uint8_t*)memdup(p+5*sizeof(uint32_t)+wlen,
q->msg_len);
if(!q->msg) {
/* pass malloc failure to the user callback */
q->msg_len = 0;
*err = UB_NOMEM;
return q;
}
}
return q;
}
uint8_t*
context_serialize_cancel(struct ctx_query* q, uint32_t* len)
{
/* format of cancel:
* o uint32 cmd
* o uint32 async-id */
uint8_t* p = (uint8_t*)malloc(2*sizeof(uint32_t));
if(!p) return NULL;
*len = 2*sizeof(uint32_t);
ldns_write_uint32(p, UB_LIBCMD_CANCEL);
ldns_write_uint32(p+sizeof(uint32_t), (uint32_t)q->querynum);
return p;
}
struct ctx_query* context_deserialize_cancel(struct ub_ctx* ctx,
uint8_t* p, uint32_t len)
{
struct ctx_query* q;
int id;
if(len != 2*sizeof(uint32_t)) return NULL;
log_assert( ldns_read_uint32(p) == UB_LIBCMD_CANCEL);
id = (int)ldns_read_uint32(p+sizeof(uint32_t));
q = (struct ctx_query*)rbtree_search(&ctx->queries, &id);
return q;
}
uint8_t*
context_serialize_quit(uint32_t* len)
{
uint8_t* p = (uint8_t*)malloc(sizeof(uint32_t));
if(!p)
return NULL;
*len = sizeof(uint32_t);
ldns_write_uint32(p, UB_LIBCMD_QUIT);
return p;
}
enum ub_ctx_cmd context_serial_getcmd(uint8_t* p, uint32_t len)
{
uint32_t v;
if((size_t)len < sizeof(v))
return UB_LIBCMD_QUIT;
v = ldns_read_uint32(p);
return v;
}
+345
View File
@@ -0,0 +1,345 @@
/*
* libunbound/context.h - validating context for unbound internal use
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains the validator context structure.
*/
#ifndef LIBUNBOUND_CONTEXT_H
#define LIBUNBOUND_CONTEXT_H
#include "util/locks.h"
#include "util/alloc.h"
#include "util/rbtree.h"
#include "services/modstack.h"
#include "libunbound/unbound.h"
#include "util/data/packed_rrset.h"
struct libworker;
struct tube;
/**
* The context structure
*
* Contains two pipes for async service
* qq : write queries to the async service pid/tid.
* rr : read results from the async service pid/tid.
*/
struct ub_ctx {
/* --- pipes --- */
/** mutex on query write pipe */
lock_basic_t qqpipe_lock;
/** the query write pipe */
struct tube* qq_pipe;
/** mutex on result read pipe */
lock_basic_t rrpipe_lock;
/** the result read pipe */
struct tube* rr_pipe;
/* --- shared data --- */
/** mutex for access to env.cfg, finalized and dothread */
lock_basic_t cfglock;
/**
* The context has been finalized
* This is after config when the first resolve is done.
* The modules are inited (module-init()) and shared caches created.
*/
int finalized;
/** is bg worker created yet ? */
int created_bg;
/** pid of bg worker process */
pid_t bg_pid;
/** tid of bg worker thread */
ub_thread_t bg_tid;
/** do threading (instead of forking) for async resolution */
int dothread;
/** next thread number for new threads */
int thr_next_num;
/** if logfile is overriden */
int logfile_override;
/** what logfile to use instead */
FILE* log_out;
/**
* List of alloc-cache-id points per threadnum for notinuse threads.
* Simply the entire struct alloc_cache with the 'super' member used
* to link a simply linked list. Reset super member to the superalloc
* before use.
*/
struct alloc_cache* alloc_list;
/** shared caches, and so on */
struct alloc_cache superalloc;
/** module env master value */
struct module_env* env;
/** module stack */
struct module_stack mods;
/** local authority zones */
struct local_zones* local_zones;
/** random state used to seed new random state structures */
struct ub_randstate* seed_rnd;
/** next query number (to try) to use */
int next_querynum;
/** number of async queries outstanding */
size_t num_async;
/**
* Tree of outstanding queries. Indexed by querynum
* Used when results come in for async to lookup.
* Used when cancel is done for lookup (and delete).
* Used to see if querynum is free for use.
* Content of type ctx_query.
*/
rbtree_t queries;
};
/**
* The queries outstanding for the libunbound resolver.
* These are outstanding for async resolution.
* But also, outstanding for sync resolution by one of the threads that
* has joined the threadpool.
*/
struct ctx_query {
/** node in rbtree, must be first entry, key is ptr to the querynum */
struct rbnode_t node;
/** query id number, key for node */
int querynum;
/** was this an async query? */
int async;
/** was this query cancelled (for bg worker) */
int cancelled;
/** for async query, the callback function */
ub_callback_t cb;
/** for async query, the callback user arg */
void* cb_arg;
/** answer message, result from resolver lookup. */
uint8_t* msg;
/** resulting message length. */
size_t msg_len;
/** validation status on security */
enum sec_status msg_security;
/** store libworker that is handling this query */
struct libworker* w;
/** result structure, also contains original query, type, class.
* malloced ptr ready to hand to the client. */
struct ub_result* res;
};
/**
* The error constants
*/
enum ub_ctx_err {
/** no error */
UB_NOERROR = 0,
/** socket operation. Set to -1, so that if an error from _fd() is
* passed (-1) it gives a socket error. */
UB_SOCKET = -1,
/** alloc failure */
UB_NOMEM = -2,
/** syntax error */
UB_SYNTAX = -3,
/** DNS service failed */
UB_SERVFAIL = -4,
/** fork() failed */
UB_FORKFAIL = -5,
/** cfg change after finalize() */
UB_AFTERFINAL = -6,
/** initialization failed (bad settings) */
UB_INITFAIL = -7,
/** error in pipe communication with async bg worker */
UB_PIPE = -8,
/** error reading from file (resolv.conf) */
UB_READFILE = -9,
/** error async_id does not exist or result already been delivered */
UB_NOID = -10
};
/**
* Command codes for libunbound pipe.
*
* Serialization looks like this:
* o length (of remainder) uint32.
* o uint32 command code.
* o per command format.
*/
enum ub_ctx_cmd {
/** QUIT */
UB_LIBCMD_QUIT = 0,
/** New query, sent to bg worker */
UB_LIBCMD_NEWQUERY,
/** Cancel query, sent to bg worker */
UB_LIBCMD_CANCEL,
/** Query result, originates from bg worker */
UB_LIBCMD_ANSWER
};
/**
* finalize a context.
* @param ctx: context to finalize. creates shared data.
* @return 0 if OK, or errcode.
*/
int context_finalize(struct ub_ctx* ctx);
/** compare two ctx_query elements */
int context_query_cmp(const void* a, const void* b);
/**
* delete context query
* @param q: query to delete, including message packet and prealloc result
*/
void context_query_delete(struct ctx_query* q);
/**
* Create new query in context, add to querynum list.
* @param ctx: context
* @param name: query name
* @param rrtype: type
* @param rrclass: class
* @param cb: callback for async, or NULL for sync.
* @param cbarg: user arg for async queries.
* @return new ctx_query or NULL for malloc failure.
*/
struct ctx_query* context_new(struct ub_ctx* ctx, char* name, int rrtype,
int rrclass, ub_callback_t cb, void* cbarg);
/**
* Get a new alloc. Creates a new one or uses a cached one.
* @param ctx: context
* @param locking: if true, cfglock is locked while getting alloc.
* @return an alloc, or NULL on mem error.
*/
struct alloc_cache* context_obtain_alloc(struct ub_ctx* ctx, int locking);
/**
* Release an alloc. Puts it into the cache.
* @param ctx: context
* @param locking: if true, cfglock is locked while releasing alloc.
* @param alloc: alloc to relinquish.
*/
void context_release_alloc(struct ub_ctx* ctx, struct alloc_cache* alloc,
int locking);
/**
* Serialize a context query that questions data.
* This serializes the query name, type, ...
* As well as command code 'new_query'.
* @param q: context query
* @param len: the length of the allocation is returned.
* @return: an alloc, or NULL on mem error.
*/
uint8_t* context_serialize_new_query(struct ctx_query* q, uint32_t* len);
/**
* Serialize a context_query result to hand back to user.
* This serializes the query name, type, ..., and result.
* As well as command code 'answer'.
* @param q: context query
* @param err: error code to pass to client.
* @param pkt: the packet to add, can be NULL.
* @param len: the length of the allocation is returned.
* @return: an alloc, or NULL on mem error.
*/
uint8_t* context_serialize_answer(struct ctx_query* q, int err,
ldns_buffer* pkt, uint32_t* len);
/**
* Serialize a query cancellation. Serializes query async id
* as well as command code 'cancel'
* @param q: context query
* @param len: the length of the allocation is returned.
* @return: an alloc, or NULL on mem error.
*/
uint8_t* context_serialize_cancel(struct ctx_query* q, uint32_t* len);
/**
* Serialize a 'quit' command.
* @param len: the length of the allocation is returned.
* @return: an alloc, or NULL on mem error.
*/
uint8_t* context_serialize_quit(uint32_t* len);
/**
* Obtain command code from serialized buffer
* @param p: buffer serialized.
* @param len: length of buffer.
* @return command code or QUIT on error.
*/
enum ub_ctx_cmd context_serial_getcmd(uint8_t* p, uint32_t len);
/**
* Lookup query from new_query buffer.
* @param ctx: context
* @param p: buffer serialized.
* @param len: length of buffer.
* @return looked up ctx_query or NULL for malloc failure.
*/
struct ctx_query* context_lookup_new_query(struct ub_ctx* ctx,
uint8_t* p, uint32_t len);
/**
* Deserialize a new_query buffer.
* @param ctx: context
* @param p: buffer serialized.
* @param len: length of buffer.
* @return new ctx_query or NULL for malloc failure.
*/
struct ctx_query* context_deserialize_new_query(struct ub_ctx* ctx,
uint8_t* p, uint32_t len);
/**
* Deserialize an answer buffer.
* @param ctx: context
* @param p: buffer serialized.
* @param len: length of buffer.
* @param err: error code to be returned to client is passed.
* @return ctx_query with answer added or NULL for malloc failure.
*/
struct ctx_query* context_deserialize_answer(struct ub_ctx* ctx,
uint8_t* p, uint32_t len, int* err);
/**
* Deserialize a cancel buffer.
* @param ctx: context
* @param p: buffer serialized.
* @param len: length of buffer.
* @return ctx_query to cancel or NULL for failure.
*/
struct ctx_query* context_deserialize_cancel(struct ub_ctx* ctx,
uint8_t* p, uint32_t len);
#endif /* LIBUNBOUND_CONTEXT_H */
File diff suppressed because it is too large Load Diff
+883
View File
@@ -0,0 +1,883 @@
/*
* libunbound/worker.c - worker thread or process that resolves
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains the worker process or thread that performs
* the DNS resolving and validation. The worker is called by a procedure
* and if in the background continues until exit, if in the foreground
* returns from the procedure when done.
*/
#include "config.h"
#include "libunbound/libworker.h"
#include "libunbound/context.h"
#include "libunbound/unbound.h"
#include "services/outside_network.h"
#include "services/mesh.h"
#include "services/localzone.h"
#include "services/cache/rrset.h"
#include "services/outbound_list.h"
#include "util/module.h"
#include "util/regional.h"
#include "util/random.h"
#include "util/config_file.h"
#include "util/netevent.h"
#include "util/storage/slabhash.h"
#include "util/net_help.h"
#include "util/data/dname.h"
#include "util/data/msgreply.h"
#include "util/data/msgencode.h"
#include "util/tube.h"
#include "iterator/iter_fwd.h"
/** handle new query command for bg worker */
static void handle_newq(struct libworker* w, uint8_t* buf, uint32_t len);
/** delete libworker struct */
static void
libworker_delete(struct libworker* w)
{
if(!w) return;
if(w->env) {
outside_network_quit_prepare(w->back);
mesh_delete(w->env->mesh);
context_release_alloc(w->ctx, w->env->alloc,
!w->is_bg || w->is_bg_thread);
ldns_buffer_free(w->env->scratch_buffer);
regional_destroy(w->env->scratch);
forwards_delete(w->env->fwds);
ub_randfree(w->env->rnd);
free(w->env);
}
outside_network_delete(w->back);
comm_base_delete(w->base);
free(w);
}
/** setup fresh libworker struct */
static struct libworker*
libworker_setup(struct ub_ctx* ctx, int is_bg)
{
unsigned int seed;
struct libworker* w = (struct libworker*)calloc(1, sizeof(*w));
struct config_file* cfg = ctx->env->cfg;
int* ports;
int numports;
if(!w) return NULL;
w->is_bg = is_bg;
w->ctx = ctx;
w->env = (struct module_env*)malloc(sizeof(*w->env));
if(!w->env) {
free(w);
return NULL;
}
*w->env = *ctx->env;
w->env->alloc = context_obtain_alloc(ctx, !w->is_bg || w->is_bg_thread);
if(!w->env->alloc) {
libworker_delete(w);
return NULL;
}
w->thread_num = w->env->alloc->thread_num;
alloc_set_id_cleanup(w->env->alloc, &libworker_alloc_cleanup, w);
if(!w->is_bg || w->is_bg_thread) {
lock_basic_lock(&ctx->cfglock);
}
w->env->scratch = regional_create_custom(cfg->msg_buffer_size);
w->env->scratch_buffer = ldns_buffer_new(cfg->msg_buffer_size);
w->env->fwds = forwards_create();
if(w->env->fwds && !forwards_apply_cfg(w->env->fwds, cfg)) {
forwards_delete(w->env->fwds);
w->env->fwds = NULL;
}
if(!w->is_bg || w->is_bg_thread) {
lock_basic_unlock(&ctx->cfglock);
}
if(!w->env->scratch || !w->env->scratch_buffer || !w->env->fwds) {
libworker_delete(w);
return NULL;
}
w->env->worker = (struct worker*)w;
w->env->probe_timer = NULL;
seed = (unsigned int)time(NULL) ^ (unsigned int)getpid() ^
(((unsigned int)w->thread_num)<<17);
seed ^= (unsigned int)w->env->alloc->next_id;
if(!w->is_bg || w->is_bg_thread) {
lock_basic_lock(&ctx->cfglock);
}
if(!(w->env->rnd = ub_initstate(seed, ctx->seed_rnd))) {
if(!w->is_bg || w->is_bg_thread) {
lock_basic_unlock(&ctx->cfglock);
}
seed = 0;
libworker_delete(w);
return NULL;
}
if(!w->is_bg || w->is_bg_thread) {
lock_basic_unlock(&ctx->cfglock);
}
seed = 0;
w->base = comm_base_create(0);
if(!w->base) {
libworker_delete(w);
return NULL;
}
if(!w->is_bg || w->is_bg_thread) {
lock_basic_lock(&ctx->cfglock);
}
numports = cfg_condense_ports(cfg, &ports);
if(numports == 0) {
libworker_delete(w);
return NULL;
}
w->back = outside_network_create(w->base, cfg->msg_buffer_size,
(size_t)cfg->outgoing_num_ports, cfg->out_ifs,
cfg->num_out_ifs, cfg->do_ip4, cfg->do_ip6,
cfg->do_tcp?cfg->outgoing_num_tcp:0,
w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
ports, numports, cfg->unwanted_threshold,
&libworker_alloc_cleanup, w, cfg->do_udp);
if(!w->is_bg || w->is_bg_thread) {
lock_basic_unlock(&ctx->cfglock);
}
free(ports);
if(!w->back) {
libworker_delete(w);
return NULL;
}
w->env->mesh = mesh_create(&ctx->mods, w->env);
if(!w->env->mesh) {
libworker_delete(w);
return NULL;
}
w->env->send_packet = &libworker_send_packet;
w->env->send_query = &libworker_send_query;
w->env->detach_subs = &mesh_detach_subs;
w->env->attach_sub = &mesh_attach_sub;
w->env->kill_sub = &mesh_state_delete;
w->env->detect_cycle = &mesh_detect_cycle;
comm_base_timept(w->base, &w->env->now, &w->env->now_tv);
return w;
}
/** handle cancel command for bg worker */
static void
handle_cancel(struct libworker* w, uint8_t* buf, uint32_t len)
{
struct ctx_query* q;
if(w->is_bg_thread) {
lock_basic_lock(&w->ctx->cfglock);
q = context_deserialize_cancel(w->ctx, buf, len);
lock_basic_unlock(&w->ctx->cfglock);
} else {
q = context_deserialize_cancel(w->ctx, buf, len);
}
if(!q) {
/* probably simply lookup failed, i.e. the message had been
* processed and answered before the cancel arrived */
return;
}
q->cancelled = 1;
free(buf);
}
/** do control command coming into bg server */
static void
libworker_do_cmd(struct libworker* w, uint8_t* msg, uint32_t len)
{
switch(context_serial_getcmd(msg, len)) {
default:
case UB_LIBCMD_ANSWER:
log_err("unknown command for bg worker %d",
(int)context_serial_getcmd(msg, len));
/* and fall through to quit */
case UB_LIBCMD_QUIT:
free(msg);
comm_base_exit(w->base);
break;
case UB_LIBCMD_NEWQUERY:
handle_newq(w, msg, len);
break;
case UB_LIBCMD_CANCEL:
handle_cancel(w, msg, len);
break;
}
}
/** handle control command coming into server */
void
libworker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
uint8_t* msg, size_t len, int err, void* arg)
{
struct libworker* w = (struct libworker*)arg;
if(err != 0) {
free(msg);
/* it is of no use to go on, exit */
comm_base_exit(w->base);
return;
}
libworker_do_cmd(w, msg, len); /* also frees the buf */
}
/** the background thread func */
static void*
libworker_dobg(void* arg)
{
/* setup */
uint32_t m;
struct libworker* w = (struct libworker*)arg;
struct ub_ctx* ctx = w->ctx;
log_thread_set(&w->thread_num);
#ifdef THREADS_DISABLED
/* we are forked */
w->is_bg_thread = 0;
/* close non-used parts of the pipes */
tube_close_write(ctx->qq_pipe);
tube_close_read(ctx->rr_pipe);
#endif
if(!w) {
log_err("libunbound bg worker init failed, nomem");
return NULL;
}
if(!tube_setup_bg_listen(ctx->qq_pipe, w->base,
libworker_handle_control_cmd, w)) {
log_err("libunbound bg worker init failed, no bglisten");
return NULL;
}
if(!tube_setup_bg_write(ctx->rr_pipe, w->base)) {
log_err("libunbound bg worker init failed, no bgwrite");
return NULL;
}
/* do the work */
comm_base_dispatch(w->base);
/* cleanup */
m = UB_LIBCMD_QUIT;
tube_remove_bg_listen(w->ctx->qq_pipe);
tube_remove_bg_write(w->ctx->rr_pipe);
libworker_delete(w);
(void)tube_write_msg(ctx->rr_pipe, (uint8_t*)&m,
(uint32_t)sizeof(m), 0);
#ifdef THREADS_DISABLED
/* close pipes from forked process before exit */
tube_close_read(ctx->qq_pipe);
tube_close_write(ctx->rr_pipe);
#endif
return NULL;
}
int libworker_bg(struct ub_ctx* ctx)
{
struct libworker* w;
/* fork or threadcreate */
lock_basic_lock(&ctx->cfglock);
if(ctx->dothread) {
lock_basic_unlock(&ctx->cfglock);
w = libworker_setup(ctx, 1);
w->is_bg_thread = 1;
#ifdef ENABLE_LOCK_CHECKS
w->thread_num = 1; /* for nicer DEBUG checklocks */
#endif
if(!w) return UB_NOMEM;
ub_thread_create(&ctx->bg_tid, libworker_dobg, w);
} else {
lock_basic_unlock(&ctx->cfglock);
#ifndef HAVE_FORK
/* no fork on windows */
return UB_FORKFAIL;
#else /* HAVE_FORK */
switch((ctx->bg_pid=fork())) {
case 0:
w = libworker_setup(ctx, 1);
if(!w) fatal_exit("out of memory");
/* close non-used parts of the pipes */
tube_close_write(ctx->qq_pipe);
tube_close_read(ctx->rr_pipe);
(void)libworker_dobg(w);
exit(0);
break;
case -1:
return UB_FORKFAIL;
default:
break;
}
#endif /* HAVE_FORK */
}
return UB_NOERROR;
}
/** get msg reply struct (in temp region) */
static struct reply_info*
parse_reply(ldns_buffer* pkt, struct regional* region, struct query_info* qi)
{
struct reply_info* rep;
struct msg_parse* msg;
if(!(msg = regional_alloc(region, sizeof(*msg)))) {
return NULL;
}
memset(msg, 0, sizeof(*msg));
ldns_buffer_set_position(pkt, 0);
if(parse_packet(pkt, msg, region) != 0)
return 0;
if(!parse_create_msg(pkt, msg, NULL, qi, &rep, region)) {
return 0;
}
return rep;
}
/** insert canonname */
static int
fill_canon(struct ub_result* res, uint8_t* s)
{
char buf[255+2];
dname_str(s, buf);
res->canonname = strdup(buf);
return res->canonname != 0;
}
/** fill data into result */
static int
fill_res(struct ub_result* res, struct ub_packed_rrset_key* answer,
uint8_t* finalcname, struct query_info* rq)
{
size_t i;
struct packed_rrset_data* data;
if(!answer) {
if(finalcname) {
if(!fill_canon(res, finalcname))
return 0; /* out of memory */
}
res->data = (char**)calloc(1, sizeof(char*));
res->len = (int*)calloc(1, sizeof(int));
return (res->data && res->len);
}
data = (struct packed_rrset_data*)answer->entry.data;
if(query_dname_compare(rq->qname, answer->rk.dname) != 0) {
if(!fill_canon(res, answer->rk.dname))
return 0; /* out of memory */
} else res->canonname = NULL;
res->data = (char**)calloc(data->count+1, sizeof(char*));
res->len = (int*)calloc(data->count+1, sizeof(int));
if(!res->data || !res->len)
return 0; /* out of memory */
for(i=0; i<data->count; i++) {
/* remove rdlength from rdata */
res->len[i] = (int)(data->rr_len[i] - 2);
res->data[i] = memdup(data->rr_data[i]+2, (size_t)res->len[i]);
if(!res->data[i])
return 0; /* out of memory */
}
res->data[data->count] = NULL;
res->len[data->count] = 0;
return 1;
}
/** fill result from parsed message, on error fills servfail */
void
libworker_enter_result(struct ub_result* res, ldns_buffer* buf,
struct regional* temp, enum sec_status msg_security)
{
struct query_info rq;
struct reply_info* rep;
res->rcode = LDNS_RCODE_SERVFAIL;
rep = parse_reply(buf, temp, &rq);
if(!rep) {
log_err("cannot parse buf");
return; /* error parsing buf, or out of memory */
}
if(!fill_res(res, reply_find_answer_rrset(&rq, rep),
reply_find_final_cname_target(&rq, rep), &rq))
return; /* out of memory */
/* rcode, havedata, nxdomain, secure, bogus */
res->rcode = (int)FLAGS_GET_RCODE(rep->flags);
if(res->data && res->data[0])
res->havedata = 1;
if(res->rcode == LDNS_RCODE_NXDOMAIN)
res->nxdomain = 1;
if(msg_security == sec_status_secure)
res->secure = 1;
if(msg_security == sec_status_bogus)
res->bogus = 1;
}
/** fillup fg results */
static void
libworker_fillup_fg(struct ctx_query* q, int rcode, ldns_buffer* buf,
enum sec_status s, char* why_bogus)
{
if(why_bogus)
q->res->why_bogus = strdup(why_bogus);
if(rcode != 0) {
q->res->rcode = rcode;
q->msg_security = s;
return;
}
q->res->rcode = LDNS_RCODE_SERVFAIL;
q->msg_security = 0;
q->msg = memdup(ldns_buffer_begin(buf), ldns_buffer_limit(buf));
q->msg_len = ldns_buffer_limit(buf);
if(!q->msg) {
return; /* the error is in the rcode */
}
/* canonname and results */
q->msg_security = s;
libworker_enter_result(q->res, buf, q->w->env->scratch, s);
}
void
libworker_fg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s,
char* why_bogus)
{
struct ctx_query* q = (struct ctx_query*)arg;
/* fg query is done; exit comm base */
comm_base_exit(q->w->base);
libworker_fillup_fg(q, rcode, buf, s, why_bogus);
}
/** setup qinfo and edns */
static int
setup_qinfo_edns(struct libworker* w, struct ctx_query* q,
struct query_info* qinfo, struct edns_data* edns)
{
ldns_rdf* rdf;
qinfo->qtype = (uint16_t)q->res->qtype;
qinfo->qclass = (uint16_t)q->res->qclass;
rdf = ldns_dname_new_frm_str(q->res->qname);
if(!rdf) {
return 0;
}
qinfo->qname = ldns_rdf_data(rdf);
qinfo->qname_len = ldns_rdf_size(rdf);
edns->edns_present = 1;
edns->ext_rcode = 0;
edns->edns_version = 0;
edns->bits = EDNS_DO;
if(ldns_buffer_capacity(w->back->udp_buff) < 65535)
edns->udp_size = (uint16_t)ldns_buffer_capacity(
w->back->udp_buff);
else edns->udp_size = 65535;
ldns_rdf_free(rdf);
return 1;
}
int libworker_fg(struct ub_ctx* ctx, struct ctx_query* q)
{
struct libworker* w = libworker_setup(ctx, 0);
uint16_t qflags, qid;
struct query_info qinfo;
struct edns_data edns;
if(!w)
return UB_INITFAIL;
if(!setup_qinfo_edns(w, q, &qinfo, &edns)) {
libworker_delete(w);
return UB_SYNTAX;
}
qid = 0;
qflags = BIT_RD;
q->w = w;
/* see if there is a fixed answer */
ldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
ldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
if(local_zones_answer(ctx->local_zones, &qinfo, &edns,
w->back->udp_buff, w->env->scratch)) {
regional_free_all(w->env->scratch);
libworker_fillup_fg(q, LDNS_RCODE_NOERROR,
w->back->udp_buff, sec_status_insecure, NULL);
libworker_delete(w);
free(qinfo.qname);
return UB_NOERROR;
}
/* process new query */
if(!mesh_new_callback(w->env->mesh, &qinfo, qflags, &edns,
w->back->udp_buff, qid, libworker_fg_done_cb, q)) {
free(qinfo.qname);
return UB_NOMEM;
}
free(qinfo.qname);
/* wait for reply */
comm_base_dispatch(w->base);
libworker_delete(w);
return UB_NOERROR;
}
/** add result to the bg worker result queue */
static void
add_bg_result(struct libworker* w, struct ctx_query* q, ldns_buffer* pkt,
int err, char* reason)
{
uint8_t* msg = NULL;
uint32_t len = 0;
/* serialize and delete unneeded q */
if(w->is_bg_thread) {
lock_basic_lock(&w->ctx->cfglock);
if(reason)
q->res->why_bogus = strdup(reason);
if(pkt) {
q->msg_len = ldns_buffer_remaining(pkt);
q->msg = memdup(ldns_buffer_begin(pkt), q->msg_len);
if(!q->msg)
msg = context_serialize_answer(q, UB_NOMEM,
NULL, &len);
else msg = context_serialize_answer(q, err,
NULL, &len);
} else msg = context_serialize_answer(q, err, NULL, &len);
lock_basic_unlock(&w->ctx->cfglock);
} else {
if(reason)
q->res->why_bogus = strdup(reason);
msg = context_serialize_answer(q, err, pkt, &len);
(void)rbtree_delete(&w->ctx->queries, q->node.key);
w->ctx->num_async--;
context_query_delete(q);
}
if(!msg) {
log_err("out of memory for async answer");
return;
}
if(!tube_queue_item(w->ctx->rr_pipe, msg, len)) {
log_err("out of memory for async answer");
return;
}
}
void
libworker_bg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s,
char* why_bogus)
{
struct ctx_query* q = (struct ctx_query*)arg;
if(q->cancelled) {
if(q->w->is_bg_thread) {
/* delete it now */
struct ub_ctx* ctx = q->w->ctx;
lock_basic_lock(&ctx->cfglock);
(void)rbtree_delete(&ctx->queries, q->node.key);
ctx->num_async--;
context_query_delete(q);
lock_basic_unlock(&ctx->cfglock);
}
/* cancelled, do not give answer */
return;
}
q->msg_security = s;
if(rcode != 0) {
error_encode(buf, rcode, NULL, 0, BIT_RD, NULL);
}
add_bg_result(q->w, q, buf, UB_NOERROR, why_bogus);
}
/** handle new query command for bg worker */
static void
handle_newq(struct libworker* w, uint8_t* buf, uint32_t len)
{
uint16_t qflags, qid;
struct query_info qinfo;
struct edns_data edns;
struct ctx_query* q;
if(w->is_bg_thread) {
lock_basic_lock(&w->ctx->cfglock);
q = context_lookup_new_query(w->ctx, buf, len);
lock_basic_unlock(&w->ctx->cfglock);
} else {
q = context_deserialize_new_query(w->ctx, buf, len);
}
free(buf);
if(!q) {
log_err("failed to deserialize newq");
return;
}
if(!setup_qinfo_edns(w, q, &qinfo, &edns)) {
add_bg_result(w, q, NULL, UB_SYNTAX, NULL);
return;
}
qid = 0;
qflags = BIT_RD;
/* see if there is a fixed answer */
ldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
ldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
if(local_zones_answer(w->ctx->local_zones, &qinfo, &edns,
w->back->udp_buff, w->env->scratch)) {
regional_free_all(w->env->scratch);
q->msg_security = sec_status_insecure;
add_bg_result(w, q, w->back->udp_buff, UB_NOERROR, NULL);
free(qinfo.qname);
return;
}
q->w = w;
/* process new query */
if(!mesh_new_callback(w->env->mesh, &qinfo, qflags, &edns,
w->back->udp_buff, qid, libworker_bg_done_cb, q)) {
add_bg_result(w, q, NULL, UB_NOMEM, NULL);
}
free(qinfo.qname);
}
void libworker_alloc_cleanup(void* arg)
{
struct libworker* w = (struct libworker*)arg;
slabhash_clear(&w->env->rrset_cache->table);
slabhash_clear(w->env->msg_cache);
}
int libworker_send_packet(ldns_buffer* pkt, struct sockaddr_storage* addr,
socklen_t addrlen, int timeout, struct module_qstate* q, int use_tcp)
{
struct libworker* w = (struct libworker*)q->env->worker;
if(use_tcp) {
return pending_tcp_query(w->back, pkt, addr, addrlen,
timeout, libworker_handle_reply, q) != 0;
}
return pending_udp_query(w->back, pkt, addr, addrlen,
timeout*1000, libworker_handle_reply, q) != 0;
}
/** compare outbound entry qstates */
static int
outbound_entry_compare(void* a, void* b)
{
struct outbound_entry* e1 = (struct outbound_entry*)a;
struct outbound_entry* e2 = (struct outbound_entry*)b;
if(e1->qstate == e2->qstate)
return 1;
return 0;
}
struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
struct sockaddr_storage* addr, socklen_t addrlen,
struct module_qstate* q)
{
struct libworker* w = (struct libworker*)q->env->worker;
struct outbound_entry* e = (struct outbound_entry*)regional_alloc(
q->region, sizeof(*e));
if(!e)
return NULL;
e->qstate = q;
e->qsent = outnet_serviced_query(w->back, qname,
qnamelen, qtype, qclass, flags, dnssec, addr, addrlen,
libworker_handle_service_reply, e, w->back->udp_buff,
&outbound_entry_compare);
if(!e->qsent) {
return NULL;
}
return e;
}
int
libworker_handle_reply(struct comm_point* c, void* arg, int error,
struct comm_reply* reply_info)
{
struct module_qstate* q = (struct module_qstate*)arg;
struct libworker* lw = (struct libworker*)q->env->worker;
struct outbound_entry e;
e.qstate = q;
e.qsent = NULL;
if(error != 0) {
mesh_report_reply(lw->env->mesh, &e, reply_info, error);
return 0;
}
/* sanity check. */
if(!LDNS_QR_WIRE(ldns_buffer_begin(c->buffer))
|| LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) !=
LDNS_PACKET_QUERY
|| LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1) {
/* error becomes timeout for the module as if this reply
* never arrived. */
mesh_report_reply(lw->env->mesh, &e, reply_info,
NETEVENT_TIMEOUT);
return 0;
}
mesh_report_reply(lw->env->mesh, &e, reply_info, NETEVENT_NOERROR);
return 0;
}
int
libworker_handle_service_reply(struct comm_point* c, void* arg, int error,
struct comm_reply* reply_info)
{
struct outbound_entry* e = (struct outbound_entry*)arg;
struct libworker* lw = (struct libworker*)e->qstate->env->worker;
if(error != 0) {
mesh_report_reply(lw->env->mesh, e, reply_info, error);
return 0;
}
/* sanity check. */
if(!LDNS_QR_WIRE(ldns_buffer_begin(c->buffer))
|| LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) !=
LDNS_PACKET_QUERY
|| LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1) {
/* error becomes timeout for the module as if this reply
* never arrived. */
mesh_report_reply(lw->env->mesh, e, reply_info,
NETEVENT_TIMEOUT);
return 0;
}
mesh_report_reply(lw->env->mesh, e, reply_info, NETEVENT_NOERROR);
return 0;
}
/* --- fake callbacks for fptr_wlist to work --- */
void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
{
log_assert(0);
}
int worker_handle_request(struct comm_point* ATTR_UNUSED(c),
void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
struct comm_reply* ATTR_UNUSED(repinfo))
{
log_assert(0);
return 0;
}
int worker_handle_reply(struct comm_point* ATTR_UNUSED(c),
void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
struct comm_reply* ATTR_UNUSED(reply_info))
{
log_assert(0);
return 0;
}
int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
struct comm_reply* ATTR_UNUSED(reply_info))
{
log_assert(0);
return 0;
}
int remote_accept_callback(struct comm_point* ATTR_UNUSED(c),
void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
struct comm_reply* ATTR_UNUSED(repinfo))
{
log_assert(0);
return 0;
}
int remote_control_callback(struct comm_point* ATTR_UNUSED(c),
void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
struct comm_reply* ATTR_UNUSED(repinfo))
{
log_assert(0);
return 0;
}
void worker_sighandler(int ATTR_UNUSED(sig), void* ATTR_UNUSED(arg))
{
log_assert(0);
}
int worker_send_packet(ldns_buffer* ATTR_UNUSED(pkt),
struct sockaddr_storage* ATTR_UNUSED(addr),
socklen_t ATTR_UNUSED(addrlen), int ATTR_UNUSED(timeout),
struct module_qstate* ATTR_UNUSED(q), int ATTR_UNUSED(use_tcp))
{
log_assert(0);
return 0;
}
struct outbound_entry* worker_send_query(uint8_t* ATTR_UNUSED(qname),
size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
int ATTR_UNUSED(dnssec), struct sockaddr_storage* ATTR_UNUSED(addr),
socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
{
log_assert(0);
return 0;
}
void
worker_alloc_cleanup(void* ATTR_UNUSED(arg))
{
log_assert(0);
}
void worker_stat_timer_cb(void* ATTR_UNUSED(arg))
{
log_assert(0);
}
void worker_probe_timer_cb(void* ATTR_UNUSED(arg))
{
log_assert(0);
}
int order_lock_cmp(const void* ATTR_UNUSED(e1), const void* ATTR_UNUSED(e2))
{
log_assert(0);
return 0;
}
int
codeline_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
{
log_assert(0);
return 0;
}
int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
{
log_assert(0);
return 0;
}
#ifdef UB_ON_WINDOWS
void
worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
ATTR_UNUSED(arg)) {
log_assert(0);
}
void
wsvc_cron_cb(void* ATTR_UNUSED(arg))
{
log_assert(0);
}
#endif /* UB_ON_WINDOWS */
+179
View File
@@ -0,0 +1,179 @@
/*
* libunbound/worker.h - worker thread or process that resolves
*
* Copyright (c) 2007, NLnet Labs. All rights reserved.
*
* This software is open source.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the NLNET LABS nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \file
*
* This file contains the worker process or thread that performs
* the DNS resolving and validation. The worker is called by a procedure
* and if in the background continues until exit, if in the foreground
* returns from the procedure when done.
*/
#ifndef LIBUNBOUND_WORKER_H
#define LIBUNBOUND_WORKER_H
#include "util/data/packed_rrset.h"
struct ub_ctx;
struct ub_result;
struct module_env;
struct comm_base;
struct outside_network;
struct ub_randstate;
struct ctx_query;
struct outbound_entry;
struct module_qstate;
struct comm_point;
struct comm_reply;
struct regional;
struct tube;
/**
* The library-worker status structure
* Internal to the worker.
*/
struct libworker {
/** every worker has a unique thread_num. (first in struct) */
int thread_num;
/** context we are operating under */
struct ub_ctx* ctx;
/** is this the bg worker? */
int is_bg;
/** is this a bg worker that is threaded (not forked)? */
int is_bg_thread;
/** copy of the module environment with worker local entries. */
struct module_env* env;
/** the event base this worker works with */
struct comm_base* base;
/** the backside outside network interface to the auth servers */
struct outside_network* back;
/** random() table for this worker. */
struct ub_randstate* rndstate;
};
/**
* Create a background worker
* @param ctx: is updated with pid/tid of the background worker.
* a new allocation cache is obtained from ctx. It contains the
* threadnumber and unique id for further (shared) cache insertions.
* @return 0 if OK, else error.
* Further communication is done via the pipes in ctx.
*/
int libworker_bg(struct ub_ctx* ctx);
/**
* Create a foreground worker.
* This worker will join the threadpool of resolver threads.
* It exits when the query answer has been obtained (or error).
* This routine blocks until the worker is finished.
* @param ctx: new allocation cache obtained and returned to it.
* @param q: query (result is stored in here).
* @return 0 if finished OK, else error.
*/
int libworker_fg(struct ub_ctx* ctx, struct ctx_query* q);
/** cleanup the cache to remove all rrset IDs from it, arg is libworker */
void libworker_alloc_cleanup(void* arg);
/**
* Worker service routine to send udp messages for modules.
* @param pkt: packet to send.
* @param addr: where to.
* @param addrlen: length of addr.
* @param timeout: seconds to wait until timeout.
* @param q: wich query state to reactivate upon return.
* @param use_tcp: true to use TCP, false for UDP.
* @return: false on failure (memory or socket related). no query was
* sent.
*/
int libworker_send_packet(ldns_buffer* pkt, struct sockaddr_storage* addr,
socklen_t addrlen, int timeout, struct module_qstate* q, int use_tcp);
/**
* Worker service routine to send serviced queries to authoritative servers.
* @param qname: query name. (host order)
* @param qnamelen: length in bytes of qname, including trailing 0.
* @param qtype: query type. (host order)
* @param qclass: query class. (host order)
* @param flags: host order flags word, with opcode and CD bit.
* @param dnssec: if set, EDNS record will have DO bit set.
* @param addr: where to.
* @param addrlen: length of addr.
* @param q: wich query state to reactivate upon return.
* @return: false on failure (memory or socket related). no query was
* sent.
*/
struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
struct sockaddr_storage* addr, socklen_t addrlen,
struct module_qstate* q);
/** process incoming replies from the network */
int libworker_handle_reply(struct comm_point* c, void* arg, int error,
struct comm_reply* reply_info);
/** process incoming serviced query replies from the network */
int libworker_handle_service_reply(struct comm_point* c, void* arg, int error,
struct comm_reply* reply_info);
/** handle control command coming into server */
void libworker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len,
int err, void* arg);
/** handle opportunity to write result back */
void libworker_handle_result_write(struct tube* tube, uint8_t* msg, size_t len,
int err, void* arg);
/** mesh callback with fg results */
void libworker_fg_done_cb(void* arg, int rcode, ldns_buffer* buf,
enum sec_status s, char* why_bogus);
/** mesh callback with bg results */
void libworker_bg_done_cb(void* arg, int rcode, ldns_buffer* buf,
enum sec_status s, char* why_bogus);
/**
* fill result from parsed message, on error fills servfail
* @param res: is clear at start, filled in at end.
* @param buf: contains DNS message.
* @param temp: temporary buffer for parse.
* @param msg_security: security status of the DNS message.
* On error, the res may contain a different status
* (out of memory is not secure, not bogus).
*/
void libworker_enter_result(struct ub_result* res, ldns_buffer* buf,
struct regional* temp, enum sec_status msg_security);
#endif /* LIBUNBOUND_WORKER_H */
+28
View File
@@ -0,0 +1,28 @@
Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz)
Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the organization nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+75
View File
@@ -0,0 +1,75 @@
#
# Makefile: compilation of pyUnbound and documentation, testing
#
# Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz)
# Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz)
#
# This software is open source.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the organization nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " testenv to make test environment and run bash "
@echo " usefull in case you don't want to install unbound but want to test examples"
@echo " doc to make documentation"
@echo " clean clean all"
.PHONY: testenv clean doc swig
#_unbound.so: ../../Makefile
#$(MAKE) -C ../..
#../../.libs/libunbound.so.0: ../../Makefile
#$(MAKE) -C ../..
#../../ldns-src/lib/libldns.so: ../../ldns-src/Makefile
#$(MAKE) -C ../../ldns-src
clean:
rm -rdf examples/unbound
rm -f _unbound.so libunbound_wrap.o
$(MAKE) -C ../.. clean
testenv: ../../.libs/libunbound.so.1 ../../ldns-src/lib/libldns.so ../../.libs/_unbound.so
rm -rdf examples/unbound
cd examples && mkdir unbound && ln -s ../../unbound.py unbound/__init__.py && ln -s ../../_unbound.so unbound/_unbound.so && ln -s ../../../../.libs/libunbound.so.1 unbound/libunbound.so.1 && ln -s ../../../../ldns-src/lib/libldns.so.1 unbound/libldns.so.1 && ls -la
cd examples && if test -f ../../../.libs/_unbound.so; then cp ../../../.libs/_unbound.so . ; fi
@echo "Run a script by typing ./script_name.py"
cd examples && LD_LIBRARY_PATH=unbound bash
rm -rdf examples/unbound examples/_unbound.so
doc: ../../.libs/libunbound.so.0 _unbound.so
$(MAKE) -C docs html
#for development only
swig: libunbound.i
swig -python -o libunbound_wrap.c -I../.. libunbound.i
gcc -c libunbound_wrap.c -O9 -fPIC -I../.. -I/usr/include/python2.5 -I. -o libunbound_wrap.o
gcc -shared libunbound_wrap.o -L../../.libs -lunbound -o _unbound.so
+1
View File
@@ -0,0 +1 @@
this directory exists to pacify sphinx-build.
+181
View File
@@ -0,0 +1,181 @@
# -*- coding: utf-8 -*-
#
# Unbound documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
#
# All configuration values have a default value; values that are commented out
# serve to show the default value.
import sys, os
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'../')))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'../../../')))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'../../../.libs/')))
#print sys.path
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General substitutions.
project = 'pyUnbound'
copyright = '2009, Zdenek Vasicek, Marek Vavrusa'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
#
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.0'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directories, that shouldn't be searched
# for source files.
#exclude_dirs = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# Options for HTML output
# -----------------------
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
html_style = 'default.css'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (within the static path) to place at the top of
# the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
html_use_modindex = False
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, the reST sources are included in the HTML build as _sources/<name>.
html_copy_source = False
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'Unbounddoc'
# Options for LaTeX output
# ------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
('index', 'Unbound.tex', 'Unbound Documentation',
'Zdenek Vasicek, Marek Vavrusa', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True
@@ -0,0 +1,26 @@
.. _example_resolve_name:
==============================
Resolve a name
==============================
This basic example shows how to create a context and resolve a host address (DNS record of A type).
::
#!/usr/bin/python
import unbound
ctx = unbound.ub_ctx()
ctx.resolvconf("/etc/resolv.conf")
status, result = ctx.resolve("www.google.com")
if status == 0 and result.havedata:
print "Result.data:", result.data.address_list
elif status != 0:
print "Resolve error:", unbound.ub_strerror(status)
In contrast with C API, the source code is more compact while the performance of C implementation is preserved.
The main advantage is that you need not take care about the deallocation and allocation of context and result structures; pyUnbound module do it automatically for you.
If only domain name is given, the :meth:`unbound.ub_ctx.resolve` looks for A records in IN class.
@@ -0,0 +1,33 @@
.. _example_reverse_lookup:
==============================
Reverse DNS lookup
==============================
Reverse DNS lookup involves determining the hostname associated with a given IP address.
This example shows how reverse lookup can be done using unbound module.
For the reverse DNS records, the special domain in-addr.arpa is reserved.
For example, a host name for the IP address 74.125.43.147 can be obtained by issuing a DNS query for the PTR record for address 147.43.125.74.in-addr.arpa.
::
#!/usr/bin/python
import unbound
ctx = unbound.ub_ctx()
ctx.resolvconf("/etc/resolv.conf")
status, result = ctx.resolve(unbound.reverse("74.125.43.147") + ".in-addr.arpa.", unbound.RR_TYPE_PTR, unbound.RR_CLASS_IN)
if status == 0 and result.havedata:
print "Result.data:", result.data.domain_list
elif status != 0:
print "Resolve error:", unbound.ub_strerror(status)
In order to simplify the python code, unbound module contains function which reverses the hostname components.
This function is defined as follows::
def reverse(domain):
return '.'.join([a for a in domain.split(".")][::-1])

Some files were not shown because too many files have changed in this diff Show More