Skip to content

Commit

Permalink
Mark structs as savable in netstack.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 661475603
  • Loading branch information
nybidari authored and gvisor-bot committed Aug 10, 2024
1 parent 876de08 commit 979bbf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pkg/tcpip/link/veth/veth.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ import (
var _ stack.LinkEndpoint = (*Endpoint)(nil)
var _ stack.GSOEndpoint = (*Endpoint)(nil)

// +stateify savable
type veth struct {
mu sync.RWMutex
mu sync.RWMutex `state:"nosave"`
closed bool
backlogQueue chan vethPacket
backlogQueue chan vethPacket `state:"nosave"`
mtu uint32
endpoints [2]Endpoint
}
Expand Down Expand Up @@ -80,7 +81,7 @@ type Endpoint struct {
// +checklocks:mu
linkAddr tcpip.LinkAddress
// +checklocks:mu
onCloseAction func()
onCloseAction func() `state:"nosave"`
}

// NewPair creates a new veth pair.
Expand Down
2 changes: 1 addition & 1 deletion pkg/tcpip/stack/nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func makeNICStats(global tcpip.NICStats) sharedStats {

// +stateify savable
type packetEndpointList struct {
mu packetEndpointListRWMutex
mu packetEndpointListRWMutex `state:"nosave"`

// eps is protected by mu, but the contained PacketEndpoint values are not.
//
Expand Down

0 comments on commit 979bbf2

Please sign in to comment.