Skip to content

Commit 2037fec

Browse files
committed
netstack: m log route changes
1 parent 3efc88b commit 2037fec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

intra/netstack/netstack.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func Up(s *stack.Stack, ep stack.LinkEndpoint, h GConnHandler) error {
9797
// also closes its netstack protos (ip4, ip6), closes link-endpoint (ep), if any
9898
if ferr := s.RemoveNIC(nic); ferr != nil {
9999
_, newnic = ferr.(*tcpip.ErrUnknownNICID)
100-
log.I("netstack: remove nic? %t; err(%v)", newnic, ferr)
100+
log.I("netstack: new nic? %t; remove nic? err(%v)", newnic, ferr)
101101
} else {
102102
log.I("netstack: removed nic(%d)", nic)
103103
}
@@ -177,6 +177,7 @@ func Route(s *stack.Stack, l3 string) {
177177
// TODO? s.Pause()
178178
// defer s.Resume()
179179

180+
which := l3
180181
switch l3 {
181182
case settings.IP46:
182183
s.SetRouteTable([]tcpip.Route{
@@ -199,13 +200,15 @@ func Route(s *stack.Stack, l3 string) {
199200
case settings.IP4:
200201
fallthrough
201202
default:
203+
which = settings.IP4
202204
s.SetRouteTable([]tcpip.Route{
203205
{
204206
Destination: header.IPv4EmptySubnet,
205207
NIC: settings.NICID,
206208
},
207209
})
208210
}
211+
log.I("netstack: route(ask:%s; set: %s); done", l3, which)
209212
}
210213

211214
// also: github.com/google/gvisor/blob/adbdac747/runsc/boot/loader.go#L1132

0 commit comments

Comments
 (0)