- socklen_t fromlen = lsa->len;
-// FIXME: need to get *DEST* address (to which of our addresses
-// this query was directed), and reply from the same address.
-// Or else we can exhibit usual UDP ugliness:
-// [ip1.multihomed.ip2] <= query to ip1 <= peer
-// [ip1.multihomed.ip2] => reply from ip2 => peer (confused)
- r = recvfrom(udps, buf, sizeof(buf), 0, &lsa->sa, &fromlen);
- if (OPT_verbose)
- bb_info_msg("Got UDP packet");
- if (r < 12 || r > 512) {
+ /* Try to get *DEST* address (to which of our addresses
+ * this query was directed), and reply from the same address.
+ * Or else we can exhibit usual UDP ugliness:
+ * [ip1.multihomed.ip2] <= query to ip1 <= peer
+ * [ip1.multihomed.ip2] => reply from ip2 => peer (confused) */
+ memcpy(to, lsa, lsa_size);
+ r = recv_from_to(udps, buf, MAX_PACK_LEN + 1, 0, &from->u.sa, &to->u.sa, lsa->len);
+ if (r < 12 || r > MAX_PACK_LEN) {