firecracker-microvm / firecracker-microvm/firecracker-go-sdk

Misleading NetworkInterface configuration

Open
#464 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
672
Forks
166
PR merge metrics
No merged PRs in 30d

Description

Currently, [`NetworkInterface.StaticConfiguration.IPConfiguration.IPAddr`](https://pkg.go.dev/github.com/firecracker-microvm/firecracker-go-sdk#IPConfiguration) is of type `net.IPNet` which, according to the `net` library, represents

```go
// An IPNet represents an IP network.
type IPNet struct {
IP IP // network number
Mask IPMask // network mask
}
```

Note that there is no place to specify an actual IP address in there, only subnet and mask.
If the SDK user uses the convenient `net.ParseCIDR()` function, the resulting `net.IPNet` struct can be passed as-is to the firecracker config, but there is NO IP address that can be assigned to the VM's interface. This leads to the situation where the subnet ID (the network number) is assigned to the interface, which is very very wrong.

I believe a different type should be used for this setting.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.