Skip to content

refactoring: read_name and name compression - #492

Open
keepsimple1 wants to merge 3 commits into
mainfrom
name-pointer
Open

refactoring: read_name and name compression#492
keepsimple1 wants to merge 3 commits into
mainfrom
name-pointer

Conversation

@keepsimple1

Copy link
Copy Markdown
Owner

Re-implemented read_name that hopefully help resolve this comment: #468 (comment)

@Phyks

Phyks commented Aug 17, 2026

Copy link
Copy Markdown

Hi,

I did a quick test rebuilding netmuxd against this branch, and it seems the issue is still present:

$ sudo -u usbmux RUST_LOG=debug ./netmuxd --disable-unix --host 127.0.0.1
Starting netmuxd
[2026-08-17T18:34:31Z INFO  netmuxd] Logger initialized
[2026-08-17T18:34:31Z INFO  netmuxd] Collected arguments, proceeding
[2026-08-17T18:34:31Z INFO  netmuxd::mdns] Starting mDNS discovery for _apple-mobdev2._tcp.local. with mdns-sd
Listening on 127.0.0.1:27015
WARNING: Running in host mode will not work unless you are running a daemon in unix mode as well
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V4 on lo addr 127.0.0.1
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V4 on ens18 addr 10.42.4.102
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V4 on br-c2548c7b1cc0 addr 172.18.0.1
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V4 on br-f78b176b13fe addr 172.19.0.1
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on lo addr ::1 with index 1
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on ens18 addr 2a01:XXX with index 2
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on ens18 addr fe80::XXX with index 2
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] failed to join multicast: fe80::XXX: PKT join multicast group on addr fe80::XXX: Address already in use (os error 98). Skipped.
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on br-c2548c7b1cc0 addr fe80::XXX with index 21
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on br-f78b176b13fe addr fe80::XXX with index 22
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on vethc2fd722 addr fe80::XXX with index 23
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on vethfcd878d addr fe80::XXX with index 24
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on vethd5c140a addr fe80::XXX with index 25
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on vethf260437 addr fe80::XXX with index 26
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on veth1a365cc addr fe80::XXX with index 27
[2026-08-17T18:34:31Z DEBUG mdns_sd::service_daemon] join multicast group V6 on veth70758b7 addr fe80::XXX with index 28
[2026-08-17T18:37:05Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 106 must be less than the start offset 100
[2026-08-17T18:38:13Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 106 must be less than the start offset 100

RUST_LOG=trace is very verbose, and does not seem to provide much more details. I'm not sure if there is any extra logging that would be helpful?

I'll make a proper and clean tcpdump and report back with it! :)

@keepsimple1

keepsimple1 commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

I did a quick test rebuilding netmuxd against this branch, and it seems the issue is still present:

from your log, it seems that the test was not using this PR branch? The following log line no longer exists in this branch:

[2026-08-17T18:37:05Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 106 must be less than the start offset 100

Just a note, you can update the dependency using the following :

mdns-sd = { git = "https://github.com/keepsimple1/mdns-sd", branch = "name-pointer" }

@Phyks

Phyks commented Aug 18, 2026

Copy link
Copy Markdown

Oops, sorry, thanks for pointing out. I had updated the Cargo.toml but forgot to run a cargo update prior to build. Upon rebuild, these are the typical log lines that I get:

2026-08-18T07:15:58Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 150 at offset 148 must point backwards
[2026-08-18T07:15:59Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:15:59Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 150 at offset 148 must point backwards
[2026-08-18T07:16:00Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:16:01Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:16:05Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:25:06Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 150 at offset 148 must point backwards
[2026-08-18T07:25:07Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:25:07Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 150 at offset 148 must point backwards
[2026-08-18T07:25:08Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:25:09Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:25:13Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:34:41Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 150 at offset 148 must point backwards
[2026-08-18T07:34:42Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 150 at offset 148 must point backwards
[2026-08-18T07:34:42Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:34:43Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:34:44Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 150 at offset 148 must point backwards
[2026-08-18T07:34:45Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:34:48Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Invalid name compression: pointer 169 at offset 125 must point backwards
[2026-08-18T07:39:54Z DEBUG mdns_sd::service_daemon] Invalid incoming DNS message: Bad name with invalid length: 0x6e offset 80, data (so far): [0, 0, 84, 0, 0, 0, 0, d, 0, 0, 0, 0, 8, 5f, 61, 69, 72, 70, 6c, 61, 79, 4, 5f, 74, 63, 70, 5, 6c, 6f, 63, 61, 6c, 0, 0, c, 0, 1, 0, 0, 11, 94, 0, 13, 10, 44, 65, 6e, 6f, 6e, 20, 41, 56, 43, 2d, 58, 33, 38, 30, 30, 48, c0, c, 1d, 38, 43, 41, 39, 36, 46, 33, 35, 31, 32, 36, 31, 40, 44, 65, 6e, 6f]

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants