Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
d6743531
Commit
d6743531
authored
Feb 10, 2022
by
Chris O'Haver
Committed by
GitHub
Feb 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix healthy proxy error case (#5168)
Signed-off-by:
Chris O'Haver
<
cohaver@infoblox.com
>
parent
4064430f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
plugin/grpc/grpc.go
plugin/grpc/grpc.go
+8
-8
No files found.
plugin/grpc/grpc.go
View file @
d6743531
...
@@ -37,10 +37,10 @@ func (g *GRPC) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
...
@@ -37,10 +37,10 @@ func (g *GRPC) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
}
}
var
(
var
(
span
,
child
ot
.
Span
span
,
child
ot
.
Span
ret
*
dns
.
Msg
ret
*
dns
.
Msg
upstreamErr
,
err
error
err
error
i
int
i
int
)
)
span
=
ot
.
SpanFromContext
(
ctx
)
span
=
ot
.
SpanFromContext
(
ctx
)
list
:=
g
.
list
()
list
:=
g
.
list
()
...
@@ -74,8 +74,6 @@ func (g *GRPC) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
...
@@ -74,8 +74,6 @@ func (g *GRPC) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
child
.
Finish
()
child
.
Finish
()
}
}
upstreamErr
=
err
// Check if the reply is correct; if not return FormErr.
// Check if the reply is correct; if not return FormErr.
if
!
state
.
Match
(
ret
)
{
if
!
state
.
Match
(
ret
)
{
debug
.
Hexdumpf
(
ret
,
"Wrong reply for id: %d, %s %d"
,
ret
.
Id
,
state
.
QName
(),
state
.
QType
())
debug
.
Hexdumpf
(
ret
,
"Wrong reply for id: %d, %s %d"
,
ret
.
Id
,
state
.
QName
(),
state
.
QType
())
...
@@ -90,8 +88,10 @@ func (g *GRPC) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
...
@@ -90,8 +88,10 @@ func (g *GRPC) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
return
0
,
nil
return
0
,
nil
}
}
if
upstreamErr
!=
nil
{
// SERVFAIL if all healthy proxys returned errors.
return
dns
.
RcodeServerFailure
,
upstreamErr
if
err
!=
nil
{
// just return the last error received
return
dns
.
RcodeServerFailure
,
err
}
}
return
dns
.
RcodeServerFailure
,
ErrNoHealthy
return
dns
.
RcodeServerFailure
,
ErrNoHealthy
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment