Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subtypes are not used in find()!? #38

Open
rse opened this issue Sep 3, 2023 · 1 comment
Open

subtypes are not used in find()!? #38

rse opened this issue Sep 3, 2023 · 1 comment

Comments

@rse
Copy link

rse commented Sep 3, 2023

The find() methods accepts subtypes, but it does not filter for me and a code review showed also no sign that subtypes is actually used in the browser.

@otaviojacobi
Copy link

Hey, any updates on this?
I have a avahi service defined like:

<service-group>

  <name replace-wildcards="yes">%h</name>

  <service>
    <type>_ssh._tcp</type>
    <subtype>_mytag._sub._ssh._tcp</subtype>
    <port>22222</port>
  </service>

</service-group>

However when I run a find on that interface it doesn't filter by the subtype, I find the service nevertheless, like:

{
  addresses: [ '192.168.0.71' ],
  rawTxt: [ <Buffer > ],
  txt: {},
  name: 'c99231e',
  fqdn: 'c99231e._ssh._tcp.local',
  host: 'c99231e.local',
  referer: { address: '192.168.0.71', family: 'IPv4', port: 5353, size: 106 },
  port: 22222,
  type: 'ssh',
  protocol: 'tcp',
  subtypes: []
}

I traced back to

records.filter((rr: ServiceRecord) => {
return (rr.type === 'PTR' && dnsEqual(rr.data, ptr.data) && rr.name.includes('._sub'))
}).forEach((rr: ServiceRecord) => {
const types = ServiceToType(rr.name)
service.subtypes.push(types.subtype)
})
these record not necessarily have the ._sub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants