DNS-SD (DNS Service Discovery) is the protocol used by Apple's Bonjour
to discover services and devices in a local network. It's widely used
as well for discovering IoT devices such as Chromecast, Amazon FireTV or
services such as Spotify in a local area network.
Snabb's dnssd program is similar to avahi-browser. Given an OS network
interface sends a multicast query to discover the services and devices
available in the network.
The program reads incoming traffic and prints out responses. Currently
supported DNS records are PTR, A, SRV and TXT.
The accumulators lastfrees, lastfreebytes, lastfreebits for the
counters frees, freebytes and freebits are initialized as Lua numbers
but implicitly converted to cdata objects in the assignments in
pace_breathing(). This causes allocations that cannot be removed by
the sink optimizer. Conversion to Lua numbers avoids this and reduces
There was a race condition when setting up the supervisor such that in
some cases it was possible to miss a signal when the parent process
died. We could reproduce this with by running a "snabb lwaftr bench",
but only on our test machine with two NUMA nodes and only when setting
--cpu on the lwaftr. In that case the problem would appear when
running "snabb lwaftr monitor" on the lwaftr; the monitor process
would hang reading from the signalfd. Because the monitor process
still had stdout open, then when piping its output to "grep", the grep
process would hang because the write side of its stdin pipe would
still be open as well.
This patch fixes this error by making cleanup reliable. It does so by
taking a POSIX lock on an unnamed file in the parent, then taking
another lock from the supervisor child process. In this way we avoid
some of the more arcane parts of Linux.
This is another instance of the bug from commit
93ef6bd. We didn't see any issue on
upstream Snabb's test suites, but with RaptorJIT's new LJ_GC64 usage did
manifest itself as intermittent heap corruption.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.