espressif / esp-protocols

Collection of ESP-IDF components related to networking protocols
181 stars 126 forks source link

feat(mdns): add check of instance when handling PTR query (IDFGH-12701) #559

Closed gytxxsy closed 4 months ago

gytxxsy commented 5 months ago
  1. Upon receiving a PTR query, when matching question and answer entries, if an instance exists in the answer entry, it will also be considered as one of the check items. This change is to avoid mistakenly deleting certain question entries. For example, if device A hosts services B with the different instances (ins1~ins5). When the device receives a PTR query, with the question querying service B, and the answer list already contains ins1.Service B and ins2.Service B, then when matching this question entry and answer entries, the question entry should not be deleted.

  2. Check the answer entries in the query when creating answer entries for query response. If the answer entry already exists, then give up creating that entry.

gytxxsy commented 5 months ago

@zwx1995esp @chshu