W5100S UDP Sendto zero ip address

When a do a sendTo van give a valid destination ip and port, wire shark is reporting that I am sending an ip of 0.0.0.0 with port 0.

I’ve created the socket with:
returncode = socket(UDP_SOCK_ENC, Sn_MR_UDP, UDP_PORT_ENCAP, SF_MULTI_ENABLE);

I write to the socket with:

ret = sendto(sn, dataPointer + sentsize, len - sentsize,desAddr.bytes,destport);

where destAddr.bytes is 192.168.1.4 and port is 4515.
However, wireshark is rseporting ip of zero.

Hi @erg144

I could not know exacty the value of your code with

returncode = socket(UDP_SOCK_ENC, Sn_MR_UDP, UDP_PORT_ENCAP, SF_MULTI_ENABLE);

If you want to handle UDP socket as multicast, you need to setup Sn_DHAR as multicat mac address.

please check the below flows:
// Multicast init
setSn_DHAR(socket_num, mac addr);
setSn_DIPR(socket_num, multicast addr);
setSn_DPORT(socket_num, multicast_port);
socket(socket_num, Sn_MR_UDP, sock_port, enable_multicast);
sendto(socket_num, buf, len, multicast_addr, multicast_port);

Thank you,