vsphere/internal/vmworkflow/virtual_machine_customize_subresource.go
func matchGateway(a string, m int, g string) bool {
	ip := net.ParseIP(a)
	gw := net.ParseIP(g)
	var mask net.IPMask
	if ip.To4() != nil {
		mask = net.CIDRMask(m, 32)
	} else {
		mask = net.CIDRMask(m, 128)
	}
	if ip.Mask(mask).Equal(gw.Mask(mask)) {
		return true
	}
	return false
}
func matchGateway(a string, m int, g string) bool {
	ip := net.ParseIP(a)
	gw := net.ParseIP(g)
	var mask net.IPMask
	if ip.To4() != nil {
		mask = net.CIDRMask(m, 32)
	} else {
		mask = net.CIDRMask(m, 128)
	}
	if ip.Mask(mask).Equal(gw.Mask(mask)) {
		return true
	}
	return false
}
func matchGateway ( a string , m int , g string ) bool { ip := net . ParseIP ( a ) gw := net . ParseIP ( g ) var mask net . IPMask if ip . To4 ( ) != nil { mask = net . CIDRMask ( m , 32 ) } else { mask = net . CIDRMask ( m , 128 ) } if ip . Mask ( mask ) . Equal ( gw . Mask ( mask ) ) { return true } return false }
// matchGateway take an IP, mask, and gateway, and checks to see if the gateway
// is reachable from the IP address.
matchGateway take an IP mask and gateway and checks to see if the gateway is reachable from the IP address .