Commit e082bb5a authored by Miek Gieben's avatar Miek Gieben Committed by GitHub

plugin/trace: fix struct allignment (#4112)

* 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: #4111
Signed-off-by: default avatarMiek Gieben <miek@miek.nl>

* plugin/erratic does makes the same mistake
Signed-off-by: default avatarMiek Gieben <miek@miek.nl>
parent 04af1c69
...@@ -13,15 +13,13 @@ import ( ...@@ -13,15 +13,13 @@ import (
// Erratic is a plugin that returns erratic responses to each client. // Erratic is a plugin that returns erratic responses to each client.
type Erratic struct { type Erratic struct {
drop uint64 q uint64 // counter of queries
drop uint64
delay uint64 delay uint64
duration time.Duration
truncate uint64 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. // ServeDNS implements the plugin.Handler interface.
......
...@@ -29,6 +29,8 @@ const ( ...@@ -29,6 +29,8 @@ const (
) )
type trace struct { type trace struct {
count uint64 // as per Go spec, needs to be first element in a struct
Next plugin.Handler Next plugin.Handler
Endpoint string Endpoint string
EndpointType string EndpointType string
...@@ -37,7 +39,6 @@ type trace struct { ...@@ -37,7 +39,6 @@ type trace struct {
serviceName string serviceName string
clientServer bool clientServer bool
every uint64 every uint64
count uint64
Once sync.Once Once sync.Once
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment