To fix avoid EISCONN if addr is specified for sendto(), the old commit changed the linux_sendto() to ignore the target address if the socket state is in a connected/connecting state.
This commit causes many issues now, such as arp packet send failed, wpa_supplicant send L2 packet failed.
linux_sendto() is a calling function for various socket types, such as netlink, unix, l2 socket. What more, for most socket(exclude udp and tcp), the socket state is always set to "connected" from it created.
so the old commit cause these socket sendto failed.
In fact, the socket that has the original issue is UDP protocol. When the socket has already called the connect(), if an address is specified in the sendto(), EISCONN error will be returned.
Therefore, Therefore,to fix this type of socket issue is a better way: if addr is specified for sendto()
to fix this type of socket issue is a better waythe connected address is ignored (like Linux behavior).