Skip to content

Commit

Permalink
Longer comment about address
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Jun 14, 2023
1 parent a2c4533 commit dc5df2f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,15 @@ void AdvertiserMinMdns::AdvertiseRecords(BroadcastAdvertiseType type)

// Attempt to get a "Real" IP address since `Type()` on a broadcast address
// always returns IPAddressType::kAny
//
// Generally the "source" of a packet is not relevant below because we
// set `unicast` to false, so we will broadcast a reply rather than
// trying to reply to a specific IP.
//
// The first IP address covers the need of getting an address of the
// right type on that interface. This seemed more sane than just using
// 127.0.0.1 or ::1. Multicast addresses specifically are kAny so they
// do not work as explained above.
CHIP_ERROR err = GetFirstIpAddress(interfaceId, addressType, packetInfo.SrcAddress);

if (err != CHIP_NO_ERROR)
Expand Down

0 comments on commit dc5df2f

Please sign in to comment.