forked from siderolabs/talos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly handle dns messages in our dns implementation
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - Another thing we do is increasing CoreDNS dns request payload limit to 4096 from the default 1232 bytes. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
- Loading branch information
Showing
3 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ data: | |
loop | ||
reload | ||
loadbalance | ||
bufsize 4096 | ||
} | ||
--- | ||
apiVersion: apps/v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters