Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update struct fields to ensure 64-bit alignment #11837

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/reversetunnel/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ type connKey struct {

// remoteConn holds a connection to a remote host, either node or proxy.
type remoteConn struct {
// lastHeartbeat is the last time a heartbeat was received.
// this field is intentionally placed first to ensure 64-bit alignment
lastHeartbeat int64

*connConfig
mu sync.Mutex
log *logrus.Entry
Expand All @@ -68,9 +72,6 @@ type remoteConn struct {

// clock is used to control time in tests.
clock clockwork.Clock

// lastHeartbeat is the last time a heartbeat was received.
lastHeartbeat int64
}

// connConfig is the configuration for the remoteConn.
Expand Down
2 changes: 1 addition & 1 deletion lib/srv/keepalive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func waitForRequests(requestSender *testRequestSender, count int) error {
}

type testRequestSender struct {
count int64 // intentionally placed first to ensure 64-bit alignment
reply bool
count int64
}

func (n *testRequestSender) SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error) {
Expand Down