Skip to content
Open
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
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ out/delta-snp.tar.gz: out/delta.tar.gz bin/internal/tools/snp-report boot/startu
out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools bin/cmd/hooks/wait-paths Makefile
@mkdir -p out
rm -rf rootfs
mkdir -p rootfs/bin/
rm -rf /tmp/base-rootfs && mkdir -p /tmp/base-rootfs
tar -xf $(BASE) -C /tmp/base-rootfs
if [ "$$(readlink -f /tmp/base-rootfs/bin)" = "/tmp/base-rootfs/usr/bin" ]; then \
mkdir -p rootfs/usr/bin; \
ln -s usr/bin rootfs/bin; \
else \
mkdir -p rootfs/bin; \
fi
mkdir -p rootfs/info/
cp bin/init rootfs/
cp bin/vsockexec rootfs/bin/
Expand Down
16 changes: 16 additions & 0 deletions internal/uvm/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ var (
ErrNICNotFound = errors.New("NIC not found in network namespace")
)

const (
ipv4GwDestination = "0.0.0.0/0"
ipv4EmptyGw = "0.0.0.0"
ipv6GwDestination = "::/0"
ipv6EmptyGw = "::"
)

func sortEndpoints(endpoints []*hcn.HostComputeEndpoint) {
cmp := func(a, b *hcn.HostComputeEndpoint) int {
if strings.HasSuffix(a.Name, "eth0") {
Expand Down Expand Up @@ -573,6 +580,15 @@ func convertToLCOWReq(id string, endpoint *hcn.HostComputeEndpoint, policyBasedR
}

for _, r := range endpoint.Routes {

if (r.DestinationPrefix == ipv4GwDestination || r.DestinationPrefix == ipv6GwDestination) &&
r.NextHop == "" {
// This is the default route
// But NextHop should either specify a gateway or be equal to 0.0.0.0 to be on-link
// The fact that it's empty makes this an invalid route
continue
}

newRoute := guestresource.LCOWRoute{
DestinationPrefix: r.DestinationPrefix,
NextHop: r.NextHop,
Expand Down
Loading