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

POC #10248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

POC #10248

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
2 changes: 1 addition & 1 deletion pkg/sentry/inet/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Namespace struct {
inode *nsfs.Inode

// stack is the network stack implementation of this network namespace.
stack Stack `state:"nosave"`
stack Stack

// creator allows kernel to create new network stack for network namespaces.
// If nil, no networking will function if network is namespaced.
Expand Down
12 changes: 11 additions & 1 deletion pkg/sentry/kernel/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,17 @@ func (k *Kernel) LoadFrom(ctx context.Context, r wire.Reader, timeReady chan str

// rootNetworkNamespace should be populated after loading the state file.
// Restore the root network stack.
k.rootNetworkNamespace.RestoreRootStack(net)
//k.rootNetworkNamespace.RestoreRootStack(net)

log.Infof("Saved Network stack: %+v", k.rootNetworkNamespace.Stack())
log.Infof("Network stack: %+v", net)

if k.rootNetworkNamespace.Stack() != nil {
log.Infof("Saved Network stack: %+v", k.rootNetworkNamespace.Stack().Interfaces())
log.Infof("Network stack: %+v", net.Interfaces())
} else {
log.Infof("Network stack is nil")
}

// Load the memory files' state.
memoryStart := time.Now()
Expand Down
2 changes: 2 additions & 0 deletions pkg/tcpip/stack/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ var netRawMissingLogger = log.BasicRateLimitedLogger(time.Minute)
// table.
//
// LOCK ORDERING: mu > routeMu.
//
// +stateify savable
type Stack struct {
transportProtocols map[tcpip.TransportProtocolNumber]*transportProtocolState
networkProtocols map[tcpip.NetworkProtocolNumber]NetworkProtocol
Expand Down
Loading