Skip to content

Commit

Permalink
plugin/trace: fix struct allignment (coredns#4112)
Browse files Browse the repository at this point in the history
* plugin/trace: fix struct allignment

A 64 bit entity needs to be the first in a struct to make it work on 32
bit systems.

Fixes: coredns#4111

Signed-off-by: Miek Gieben <miek@miek.nl>

* plugin/erratic does makes the same mistake

Signed-off-by: Miek Gieben <miek@miek.nl>
  • Loading branch information
miekg authored and nyodas committed Oct 26, 2020
1 parent 4e892f7 commit 0dc2403
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions plugin/erratic/erratic.go
Expand Up @@ -13,15 +13,13 @@ import (

// Erratic is a plugin that returns erratic responses to each client.
type Erratic struct {
drop uint64

q uint64 // counter of queries
drop uint64
delay uint64
duration time.Duration

truncate uint64
large bool // undocumented feature; return large responses for A request (>512B, to test compression).

q uint64 // counter of queries
duration time.Duration
large bool // undocumented feature; return large responses for A request (>512B, to test compression).
}

// ServeDNS implements the plugin.Handler interface.
Expand Down
3 changes: 2 additions & 1 deletion plugin/trace/trace.go
Expand Up @@ -29,6 +29,8 @@ const (
)

type trace struct {
count uint64 // as per Go spec, needs to be first element in a struct

Next plugin.Handler
Endpoint string
EndpointType string
Expand All @@ -37,7 +39,6 @@ type trace struct {
serviceName string
clientServer bool
every uint64
count uint64
Once sync.Once
}

Expand Down

0 comments on commit 0dc2403

Please sign in to comment.