(route netip.Prefix)
| 117 | } |
| 118 | |
| 119 | func convertToIPV6Route(route netip.Prefix) *NetworkSettingsRequest_IPv6Settings_IPv6Route { |
| 120 | return &NetworkSettingsRequest_IPv6Settings_IPv6Route{ |
| 121 | Destination: route.Addr().String(), |
| 122 | // #nosec G115 - Safe conversion as prefix lengths are always within uint32 range (0-128) |
| 123 | PrefixLength: uint32(route.Bits()), |
| 124 | Router: "", // N/A |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | func prefixToSubnetMask(prefix netip.Prefix) string { |
| 129 | maskBytes := net.CIDRMask(prefix.Masked().Bits(), net.IPv4len*8) |
no test coverage detected