Over UDP we call `HarvestDestinationAddress()` to get the real
destination address via `IP_PKTINFO`., but this only sets the destination
address, not the destination port. Therefore since
7cea4e39a78ef981ee461b49bbc193fa9903f56dit the destination port was always
0 when bound to an "any" address.
uint16_t len = (uint16_t) ret;
ComboAddress dest;
- if (!HarvestDestinationAddress(&msgh, &dest)) {
+ if (HarvestDestinationAddress(&msgh, &dest)) {
+ /* we don't get the port, only the address */
+ dest.sin4.sin_port = cs->local.sin4.sin_port;
+ }
+ else {
dest.sin4.sin_family = 0;
}