invalid user-defined conversion from 'IPAddress' to 'const void*'

What is the problem. im compiling for esp32 and it gives me this error?

exit status 1
invalid user-defined conversion from ‘IPAddress’ to ‘const void*’ [-fpermissive]

void update_ip(byte to[], IPAddress ip, char name[]) {
  if (memcmp(to, ip, 4) != 0) {
    for (byte j = 0; j < 4; j++) {
      to[j] = ip[j];
    Serial.print("----------------PAIRED ");
  } else {
    Serial.print("----------------no need to pair ");

The memcmp function expects a pointer to the source. That being said, you shouldn't be using memcmp, it compares the bit pattern of classes, the raw memory. You have no guarantee that the bit pattern of an IP address matches the conceptual 4-byte layout. For classes, you should always use operator ==, not memcmp. (In fact, memcmp will most likely fail in this case, since IPAddress has a virtual method, so &ip will point to the vtable pointer, not the 4 bytes of the IP address.)

if (!(ip == to)) {