Skip to content

Commit f3a4280

Browse files
authored
Merge pull request #91 from iamGavinJ/clean-shutdown
Flush goodbye packets in free_iface function
2 parents 3b05d8d + 3e333e0 commit f3a4280

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/mdnsd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ static void record_received(const struct resource *r, void *data __attribute__((
127127
static void free_iface(struct iface *iface)
128128
{
129129
mdnsd_shutdown(iface->mdns);
130+
/* Flush goodbye packets (TTL=0) out on the wire before freeing */
131+
if (iface->sd >= 0)
132+
mdnsd_step(iface->mdns, iface->sd, false, true, NULL);
130133
mdnsd_free(iface->mdns);
131134
iface->mdns = NULL;
132135
if (iface->sd >= 0)

0 commit comments

Comments
 (0)