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

SRV type #16

Closed
ardarico opened this issue Jun 25, 2020 · 0 comments
Closed

SRV type #16

ardarico opened this issue Jun 25, 2020 · 0 comments

Comments

@ardarico
Copy link

ardarico commented Jun 25, 2020

Hi,

I am trying to handle SRV type queries, such as

dig @127.0.0.1 -p 53 instance._service_type -t srv

I noticed that packet.js includes an [SRV description], but does not recognize Packet.TYPE.SRV. Thus, I added

SRV : 0x21,

to the Packet.TYPE definition, and now the server correctly decodes the query. However, something is wrong in the answer:

Samsung:Downloads micheleamoretti$ dig @127.0.0.1 -p 53 6gkzwgjz._iot._udp -t srv
;; Warning: Message parser reports malformed message packet.

; <<>> DiG 9.10.6 <<>> @127.0.0.1 -p 53 6gkzwgjz._iot._udp -t srv
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20964
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: Message has 6 extra bytes at end

;; QUESTION SECTION:
;6gkzwgjz._iot._udp. IN SRV

;; Query time: 9 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Jun 25 14:55:53 CEST 2020
;; MSG SIZE rcvd: 72

What is the cause of that WARNING?

My server code creates the response in this way:

response.header.qr = 1;
response.header.ra = 1;
response.additionals = [];
if (domains[query])
{
response.answers.push({
name: query,
type: Packet.TYPE.SRV,
class: Packet.CLASS.IN,
ttl: 100,
target: domains[query],
port: 8080
});
}

lsongdev added a commit that referenced this issue Jul 3, 2020
lsongdev added a commit that referenced this issue Jul 3, 2020
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

1 participant