christgau / wsdd

A Web Service Discovery host daemon.
MIT License
861 stars 101 forks source link

Discovery with 'Hello' Message only does not work #89

Closed christgau closed 3 years ago

christgau commented 3 years ago

If wsdd is in discovery mode, it appears as if the metadata exchange is not performed on the 'Hello' message, i.e. when a host comes up. Thus an explicit probe request is needed to discovery a new host

christgau commented 3 years ago

It actually appears to work, but for IPv6, Windows sends out two XAddrs in one XML tag separated by whitespace: one with the host's global address (which appears to be wrong) and one with link-local address. wsdd does not handle is this correctly at the moment.

toxic0berliner commented 3 years ago

It seems I encounter this issue, my machines are only setup to use IPv4 and not IPv6.

This is what I get in journalctl when a windows 10 host comes online :

avril 07 16:17:04 printer wsdd[1430]: 2021-04-07 16:17:04,169:wsdd DEBUG(pid 1430): netlink message with 64 bytes
avril 07 16:17:04 printer wsdd[1430]: 2021-04-07 16:17:04,169:wsdd DEBUG(pid 1430): invalid rtm_message type 16
avril 07 16:17:07 printer wsdd[1430]: 2021-04-07 16:17:07,749:wsdd INFO(pid 1430): 10.0.30.109:60290(enp3s0) - - "Hello urn:uuid:ac0b29e1-acbe-4840-aad8-dc76ce890472 UDP" - -
avril 07 16:17:07 printer wsdd[1430]: 2021-04-07 16:17:07,749:wsdd DEBUG(pid 1430): incoming message content is b'<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsdp="http://schemas.xmlsoap.org/ws/2006/02/devprof" xmlns:pub="http://schemas.microsoft.com/windows/pub/2005/07"><soap:Header><wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To><wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello</wsa:Action><wsa:MessageID>urn:uuid:ac0b29e1-acbe-4840-aad8-dc76ce890472</wsa:MessageID><wsd:AppSequence InstanceId="87" SequenceId="urn:uuid:cc7a13f5-4761-45a8-ae59-e3ec577de2fb" MessageNumber="1"></wsd:AppSequence></soap:Header><soap:Body><wsd:Hello><wsa:EndpointReference><wsa:Address>urn:uuid:2fcf207f-ff99-4f19-9eaa-c63431e62f77</wsa:Address></wsa:EndpointReference><wsd:Types>wsdp:Device pub:Computer</wsd:Types><wsd:XAddrs>http://10.0.30.109:5357/2fcf207f-ff99-4f19-9eaa-c63431e62f77/</wsd:XAddrs><wsd:MetadataVersion>2</wsd:MetadataVersion></wsd:Hello></soap:Body></soap:Envelope>'
avril 07 16:17:07 printer wsdd[1430]: 2021-04-07 16:17:07,750:wsdd DEBUG(pid 1430): unhandled action http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello/urn:uuid:ac0b29e1-acbe-4840-aad8-dc76ce890472
avril 07 16:18:07 printer wsdd[1430]: 2021-04-07 16:18:07,181:wsdd DEBUG(pid 1430): netlink message with 64 bytes
avril 07 16:18:07 printer wsdd[1430]: 2021-04-07 16:18:07,182:wsdd DEBUG(pid 1430): invalid rtm_message type 16

I understand this should not affect discovery later on, so I'm not too bothered, but I have issues with discovery elsewhere so I'll check the other issues and probably report a new one since this Hello is a nice to have but not mandatory as I understand.

christgau commented 3 years ago

The Hello message actually looks good, And if you are not in discovery mode (which is the default for the systemd unit file provided in this repository) everything is working as expected and the unhandled action is fine. You do not seem to be affected by the error that this issue is about.