Comments (20)
This appears to have something to do with the number of responses I send as well. If I send fewer records, the issue goes away.
from dns.
[ Quoting [email protected] in "[dns] Getting "dns: overflow unpack..." ]
I'm getting an error decoding a response with the client "dns: overflow unpacking uint32". The response is being generated with the same library, and contains a combination of SRV and A records. Nothing crazy as far as I can tell. Below is the binary buffer after packing that is being sent:
Can send some code? Or a test?
A did some work on msg.Len() this week, to make it fit better, but this might
have led to a buffer that is too small.
grtz Miek
from dns.
[ Quoting [email protected] in "[dns] Getting "dns: overflow unpack..." ]
I'm getting an error decoding a response with the client "dns: overflow unpacking uint32". The response is being generated with the same library, and contains a combination of SRV and A records. Nothing crazy as far as I can tell. Below is the binary buffer after packing that is being sent:
Haven't decoded the buffer you sent, but is Compress true?
Grtz Miek
from dns.
Here is a minimal test case: https://gist.github.com/armon/9008541
If MAXREC is 3, then it works. Setting it to numbers above 3 causes different errors.
from dns.
I don't explicitly enable Compress, not sure if it defaults to true
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
Here is a minimal test case: https://gist.github.com/armon/9008541
If MAXREC is 3, then it works. Setting it to numbers above 3 causes different errors.
Yeah, then it runs out of its buffer. Btw, can you pull the lastest master I
reverted some commits I wasn't too happy with.
I'll checkout your gist.
grtz Miek
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
I don't explicitly enable Compress, not sure if it defaults to true
No default is false.
grtz Miek
from dns.
I tried latest master with the reverts now. Still breaks if MAXRECS is 4 or 5, but 6 is somehow okay.
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
I tried latest master with the reverts now. Still breaks if MAXRECS is 4 or 5, but 6 is somehow okay.
Yeah, I'm checking your code. Don't know yet where the mistake is...
grtz Miek
from dns.
It would be great if we could add this sample as a regression test as well to guard against future changes
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
I tried latest master with the reverts now. Still breaks if MAXRECS is 4 or 5, but 6 is somehow okay.
Ok, I've added this to the tests but I'm not sure if its worth adding, albeit I
might return more descriptive errors.
You're returning more than 512 bytes in an udp message, that breaks your client. It
might be worth to allow a client to set this directly instead of using EDNS0.
If you use "tcp" for the client and server it "just" works.
Pondering what to change and what to fix.
- error reporting can be better, adding this
- client UDPSize might be worthwhile to add
- ... ?
grtz Miek
from dns.
[ Quoting [email protected] in "[dns] Getting "dns: overflow unpack..." ]
I'm getting an error decoding a response with the client "dns: overflow unpacking uint32". The response is being generated with the same library, and contains a combination of SRV and A records. Nothing crazy as far as I can tell. Below is the binary buffer after packing that is being sent:
Basically you have written an evil server :)
Miek Gieben
from dns.
Is there a reason the client does not attempt to receive a 64K packet? Even with standard MTU, 1500 bytes should be okay
from dns.
I restrict the number of responses, but I thought up to 1500 bytes would've worked fine (unless there is something more subtle about DNS I'm missing)
from dns.
Or even better, the client could at least return a useful message about truncation which makes it clear what the issue is
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
I restrict the number of responses, but I thought up to 1500 bytes would've worked fine (unless there is something more subtle about DNS I'm missing)
Uh, yeah :) DNS is from 1983 and then 512 was considered big, so the default
limit is still 512, unless you use something like EDNS0 which allows larger
sizes. On the internet 4096 bytes is usually in use.
Your other options is "tcp".
Miek Gieben
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
Or even better, the client could at least return a useful message about truncation which makes it clear what the issue is
Yes, adding that now, because this also send me on a wild goose chase.
Miek Gieben
from dns.
Thanks! Sorry about the false positive.
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
Thanks! Sorry about the false positive.
no worries! A difficult to use library is not a good library, so thanks for
your report.
Miek Gieben
from dns.
[ Quoting [email protected] in "Re: [dns] Getting "dns: overflow un..." ]
Or even better, the client could at least return a useful message about truncation which makes it clear what the issue is
There is one snag with this... with udp I don't now there is more data to come.
So... I can work around this, but it becomes ugly and I don't think it is worth
adding it.
I will keep the new test case. Thanks for that.
grtz Miek
from dns.
Related Issues (20)
- $INCLUDE and relative paths HOT 2
- Some question on rndc command
- Decoding of some "special" characters results in \DDD+ HOT 1
- Optional interface for a ResponseWriter to expose Conns HOT 3
- Expose SVCB Service Params fully to clients HOT 2
- Corner case where offset is equal to len(msg), response is truncated without TC bit set and no error is raised HOT 1
- Method for creating wire-format dns.Header from *dns.Msg? HOT 2
- [Query] Type65 aka HTTPS HOT 2
- RFC 2136: Dynamic updates HOT 3
- Add isdn record HOT 1
- Message pack and unpack fails with an empty name in a RR header HOT 1
- Duplicate DNS rCode? HOT 2
- dns: overflow unpacking uint16 HOT 2
- Can't retrieve TXT records for some domains HOT 1
- Trailing backslash results in non-FQDN targets HOT 6
- RFC: Parsing record contents directly HOT 6
- Wildcard domains as per RFC-4592 HOT 10
- digest type 3 (GOST94) HOT 2
- Forwarding DNS Queries to other Handler in TCP Connections HOT 6
- Request timeout middleware dns.HandlerFunc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dns.