Skip to content

Commit 3dd21f2

Browse files
karta0807913cfergeau
authored andcommitted
remove testing code
Change-Id: Iccbfa76ada834a28e1a40e0c4a0e5b70ec830aae
1 parent 90d2916 commit 3dd21f2

2 files changed

Lines changed: 6 additions & 25 deletions

File tree

pkg/virtualnetwork/services.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"gvisor.dev/gvisor/pkg/tcpip/transport/udp"
2323
)
2424

25+
// ipv6Pool can be nil
2526
func addServices(configuration *types.Configuration, s *stack.Stack, ipPool *tap.IPPool, ipv6Pool *tap.IPPool) (http.Handler, error) {
2627
var natLock sync.Mutex
2728
translation := parseNATTable(configuration)
@@ -41,22 +42,18 @@ func addServices(configuration *types.Configuration, s *stack.Stack, ipPool *tap
4142
return nil, err
4243
}
4344

44-
var dhcpv6Mux http.Handler
45-
if ipv6Pool != nil {
46-
dhcpv6Mux, err = dhcpv6Server(configuration, s, ipv6Pool)
47-
if err != nil {
48-
return nil, err
49-
}
50-
}
51-
5245
forwarderMux, err := forwardHostVM(configuration, s)
5346
if err != nil {
5447
return nil, err
5548
}
5649
mux := http.NewServeMux()
5750
mux.Handle("/forwarder/", http.StripPrefix("/forwarder", forwarderMux))
5851
mux.Handle("/dhcp/", http.StripPrefix("/dhcp", dhcpMux))
59-
if dhcpv6Mux != nil {
52+
if ipv6Pool != nil {
53+
dhcpv6Mux, err := dhcpv6Server(configuration, s, ipv6Pool)
54+
if err != nil {
55+
return nil, err
56+
}
6057
mux.Handle("/dhcpv6/", http.StripPrefix("/dhcpv6", dhcpv6Mux))
6158
}
6259
mux.Handle("/dns/", http.StripPrefix("/dns", dnsMux))

pkg/virtualnetwork/virtualnetwork.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,6 @@ func createStack(configuration *types.Configuration, endpoint stack.LinkEndpoint
193193
Gateway: tcpip.Address{},
194194
NIC: 1,
195195
})
196-
197-
_, linkLocalSubnet, _ := net.ParseCIDR("fe80::/10")
198-
linkLocal, _ := tcpip.NewSubnet(tcpip.AddrFromSlice(linkLocalSubnet.IP), tcpip.MaskFromBytes(linkLocalSubnet.Mask))
199-
routes = append(routes, tcpip.Route{
200-
Destination: linkLocal,
201-
Gateway: tcpip.Address{},
202-
NIC: 1,
203-
})
204-
205-
_, ipv6DefaultCIDR, _ := net.ParseCIDR("::/0")
206-
ipv6DefaultRoute, _ := tcpip.NewSubnet(tcpip.AddrFromSlice(ipv6DefaultCIDR.IP), tcpip.MaskFromBytes(ipv6DefaultCIDR.Mask))
207-
routes = append(routes, tcpip.Route{
208-
Destination: ipv6DefaultRoute,
209-
Gateway: tcpip.Address{},
210-
NIC: 1,
211-
})
212196
}
213197

214198
s.SetRouteTable(routes)

0 commit comments

Comments
 (0)