Commit Graph

3191 Commits

Author SHA1 Message Date
Peter M. Goldstein 9ef29b5646 Export UDP interfaces 2015-03-09 15:00:21 -07:00
Miek Gieben d5c6e55eed Merge pull request #191 from ValiMail/bugfix/off_by_1_in_max_size
Fix off by one error in MaxMsgSize
2015-03-09 21:55:54 +00:00
Peter M. Goldstein 34a9377404 Update the value of MaxMsgSize 2015-03-09 13:51:11 -07:00
Miek Gieben 12197b977e In TXT records break up large chunks in 255 bytes
TXT records consist out of multiple 255 byte chunk. When parsing
a chunk that is too large, Go DNS would happily add it. This would
only fail when packing the message.

Change this to auto-chunking when reading the TXT records from file
into 255 byte sized chunks.
2015-03-04 09:33:37 +00:00
Michael Haro 6b54d9f863 Revert "Use gofmt to simplify code"
This reverts commit 48dce403d5.
2015-02-26 01:48:30 -08:00
Michael Haro eb9bd9895b Revert "Run gofmt -s on zscan_rr.go"
This reverts commit eaabc3fc5d.
2015-02-26 01:48:21 -08:00
Michael Haro 7f051930ff Use %v as the format arg for errors 2015-02-26 00:49:59 -08:00
Michael Haro eaabc3fc5d Run gofmt -s on zscan_rr.go 2015-02-26 00:41:21 -08:00
Michael Haro 48dce403d5 Use gofmt to simplify code 2015-02-26 00:38:33 -08:00
Michael Haro 4437868b75 Replace t.Logf("%s", var) with t.Log(var) 2015-02-26 00:30:40 -08:00
Michael Haro 3cfc96a979 Add a missing 'f' in t.Errorf 2015-02-25 22:23:47 -08:00
Michael Haro 2fb2a25e84 More test clean up
Remove trailing \n from t.Log and t.Error messages as it's unnecessary.

In some instances, combine multiple t.Error()s into one

To provide more consistency across the tests, rename e to err and use %v
as the format arg for errors.

Replace Logf and Errorf with Log and Error when it made sense.  For
example t.Errorf("%v", err) to t.Error(err)
2015-02-25 22:14:21 -08:00
Miek Gieben c78310fc5e Merge pull request #189 from michaelharo/copyto
Split Copy into Copy and CopyTo
2015-02-25 06:54:54 +00:00
Michael Haro 5013a655f4 Merge branch 'master' of github.com:miekg/dns into copyto 2015-02-24 13:59:26 -08:00
Miek Gieben 6427527bba Check EDNS0 bufsize in Exchange()
In client.Exchange we *did* check for this size, to the same in the
function Exchange(). This bug surfaced in issue #184, this sort of
fixes it.

Closes #184.
2015-02-24 18:16:58 +00:00
Miek Gieben 841e5ac162 Merge pull request #188 from fobser/matchingtype
If the Matching Type is 1 or 2 we need to return a hash.
2015-02-24 15:54:35 +00:00
Miek Gieben 7698225860 Merge pull request #187 from flebarbe/master
Fix TSig check on second DNS message (TCP) #180
2015-02-24 15:14:24 +00:00
Florian Obser 3d1b778699 If the Matching Type is 1 or 2 we need to return a hash. 2015-02-24 16:04:59 +01:00
Flavien Lebarbe 11bd0d5a09 Fix TSig check on second DNS message (TCP) #180
The next chunk needs to use the previous MAC
Using this fix, I can successfully verify the signatures of not
only the first but the subsequent envelopes as well.

Patch was proposed by andrewtj in a comment. Kudos !
2015-02-24 15:45:03 +01:00
Miek Gieben 3ec344b2c8 Merge pull request #186 from michaelharo/tests
Convert tests from being t.Log(..) then t.Fail() to just t.Error(...)
2015-02-24 07:27:32 +00:00
Michael Haro f1f17ffdbc Split Copy into Copy and CopyTo.
CopyTo allows bypassing allocating a new Msg to work towards less
allocation GC churn.
2015-02-23 23:11:31 -08:00
Michael Haro f995f1aff3 Convert tests from being t.Log(..) then t.Fail() to just t.Error(...) as
t.Error(...) does both and makes it more clear which messages are errors
vs information log messages.
2015-02-23 17:43:07 -08:00
Miek Gieben 0bd3fb7026 Match docs with constants 2015-02-20 21:16:49 +00:00
Miek Gieben adbd535787 Small doc update 2015-02-20 11:42:29 +00:00
Miek Gieben 574544eb08 Documentation updates 2015-02-20 11:39:15 +00:00
Miek Gieben 34ac642c72 Golint cleanups
This cleans up zscan_rr.go's if-then-else blocks. Except the ones
in LOC parsing because that needs slightly more than a mechanical
change.
2015-02-20 11:33:10 +00:00
Miek Gieben 126ee2f0c5 Documentation update 2015-02-19 22:09:30 +00:00
Miek Gieben 64fea017a2 Move all docs to docs.go
Another golint change.
2015-02-19 13:47:50 +00:00
Miek Gieben 1f764075b6 Golint find, remove float64 2015-02-19 11:41:12 +00:00
Miek Gieben 56f8fd4c29 Drop the uselss else blocks as indicated by golint 2015-02-19 11:36:40 +00:00
Miek Gieben faa311bf55 golint: more docs 2015-02-19 11:26:46 +00:00
Miek Gieben bf8a652f64 Make golint shut the f.ck up 2015-02-19 10:59:15 +00:00
Miek Gieben b02ae55fbe golint changes, lose the underscores 2015-02-19 10:45:59 +00:00
Miek Gieben acee6af0bc Merge branch 'master' of github.com:miekg/dns 2015-02-19 09:59:37 +00:00
Miek Gieben 67945c119e A bunch of golint fixes
The proposed vars names are a nono, because they break the API.
Things left: document each RR and zscan_rr.go has some funcky if-then-elses.
2015-02-19 09:58:33 +00:00
Miek Gieben da4558a998 Merge pull request #183 from michaelharo/vet
Fix problems noted by 'go vet'
2015-02-19 08:55:00 +00:00
Michael Haro 9e96f28311 Fix problems noted by 'go vet' 2015-02-19 00:08:28 -08:00
Miek Gieben bd61ec4278 Merge pull request #182 from mattf/tpyo
fix spelling of separate
2015-02-18 22:09:11 +00:00
Matthew Farrellee 24ccdb3008 fix spelling of separate 2015-02-18 17:04:12 -05:00
Miek Gieben b5baec579b Cleanup travis.yml 2015-02-18 09:27:35 +00:00
Miek Gieben c7458158f0 Fix travis, gvm is gone? 2015-02-18 09:23:34 +00:00
Miek Gieben 48ba40204d Add some more binary tests in TestMsgPackBuffer 2015-02-18 09:17:00 +00:00
Miek Gieben b65f52f3f0 Merge pull request #179 from DanielMorsing/copyarr
Used shared backing array for Msg.Copy
2015-02-05 14:19:54 +00:00
Daniel Morsing a4af4dd14e Used shared backing array for Msg.Copy
If you have a system with large amounts of copies, these slice
allocations start stacking up. Use a shared slice and then subslice
them with a cap limit so that append works properly.

Also, add a benchmark and test for Msg.Copy

Benchcmp:
benchmark         old ns/op     new ns/op     delta
BenchmarkCopy     1880          1672          -11.06%

benchmark         old allocs     new allocs     delta
BenchmarkCopy     13             11             -15.38%

benchmark         old bytes     new bytes     delta
BenchmarkCopy     528           528           +0.00%
2015-02-05 13:07:07 +00:00
Miek Gieben dfa09b604c Very small cleanups 2015-02-04 06:55:03 +00:00
Yann Kerhervé 80d2db2e86 Fix ignored last line of resolv.conf
When ClientConfigFromFile is given a file that is missing a newline
before EOF, then the last directive is completely ignored.

This also adds a very basic test for a normal resolv.conf parsing.
2015-02-03 16:27:39 -08:00
Miek Gieben a76c0a363d Merge branch 'master' of github.com:miekg/dns 2015-01-27 08:20:08 +00:00
Miek Gieben 50890090cb Merge branch 'ipseckey'
Tentatively merging.
2015-01-27 08:17:50 +00:00
Miek Gieben ca7706307e Merge pull request #177 from StalkR/dns-reverse-proxy
README: update Users: StalkR/misc/dns/proxy moved to its own repo
2015-01-26 10:29:39 +00:00
StalkR 48aa88a987 README: update Users: StalkR/misc/dns/proxy moved to its own repo at StalkR/dns-reverse-proxy 2015-01-25 18:39:30 +01:00