]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolve: llmnr: fix never hit condition 22274/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Jan 2022 00:29:59 +0000 (09:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Jan 2022 00:37:50 +0000 (09:37 +0900)
commita5e2a488e83fabf6d8ade7621c2fc3574a8faaa7
tree59a485ecf265baabe5c3377c70379f7060c7605c
parent4aa6129897d2e8de9b275b44270c1c9da745de0e
resolve: llmnr: fix never hit condition

Previously, the condition in on_stream_io_impl() never hit, as the
read packet is always taken from the stream in the few lines above.

Instead of the dns_stream_complete() under the condition, the stream
is unref()ed in the on_packet callback for LLMNR stream, unlike the
other on_packet callbacks.

That's quite tricky. Also, potentially, the stream may still have
queued packets to write.

This fix the condition, and drops the unref() in the on_packet callback.

C.f. https://github.com/systemd/systemd/pull/22274#issuecomment-1023708449.

Closes #22266.
src/resolve/resolved-dns-stream.c
src/resolve/resolved-dns-stream.h
src/resolve/resolved-llmnr.c