Use LAN name from Avahi instead of assuming it's the D-Bus machine id.
This way p2p works as intended with any LAN name and also works if
it's changed on the fly via D-Bus using e.g. the gdbus command like
# gdbus call --system --dest org.freedesktop.Avahi --object-path / \
--method org.freedesktop.Avahi.Server.SetHostName some-new-lan-name
Notably, this change allows us to delete all the code dealing with
obtaining the D-Bus machine-id.
TEST=Unit tests pass + Changed LAN name (via the gdbus command) while
avahi-daemon and p2p-server was running and checked (via the
p2p-client command) that other devices could still see files
exported by the devices, under the new name.
Reviewed-by: Alex Deymo <firstname.lastname@example.org>
Commit-Queue: David Zeuthen <email@example.com>
Tested-by: David Zeuthen <firstname.lastname@example.org>
4 files changed