Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum {
MDNS_NETERR = -2, // network error
MDNS_LKPERR = -3, // lookup error
MDNS_ERROR = -4, // any runtime error that's not originating from the standard library
MDNS_GOODBYE = 1, // goodbye packet received (RFC 6762 §11.3, TTL=0)
};

/*
Expand Down
7 changes: 6 additions & 1 deletion src/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,12 @@ mdns_listen_probe_network(const struct mdns_ctx *ctx, const char *const names[],
for (struct rr_entry *entry = entries; entry; entry = entry->next) {
for (unsigned int i = 0; i < nb_names; ++i) {
if (!strrcmp(entry->name, names[i])) {
callback(p_cookie, r, entries);
/* RFC 6762 §11.3: TTL=0 is a goodbye packet */
if (entry->ttl == 0) {
callback(p_cookie, MDNS_GOODBYE, entries);
} else {
callback(p_cookie, r, entries);
}
break;
}
}
Expand Down