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.

Change-Id: Idb1d47ff5feadd0e51eb0be39e906aa3ad659952
Reviewed-by: Alex Deymo <>
Commit-Queue: David Zeuthen <>
Tested-by: David Zeuthen <>
4 files changed