Skip to content

Generated packets could be too big #468

Closed

Description

@anti-social

I believe that we should use current MAX_MSG_ABSOLUTE constant only for parsing incoming packet. It is too big for standard network configuration as it will cause fragmentation which almost always is a problem. I think maximum generated packet size should be no more than 1452 = 1500 - 40 (ipv6 header) - 8 (udp header). For bigger packets there might be a special setting.

Activity

  1. keepsimple1 commented on Jul 26, 2026

    @keepsimple1
    Owner

    Sorry I missed this issue and just saw it. What it says makes sense to me. Let me take a closer look and see how we can improve it.

  2. keepsimple1 commented on Aug 8, 2026

    @keepsimple1
    Owner

    PR merged.

  3. Phyks commented on Aug 14, 2026

    @Phyks

    Hi,

    There seems to be some issues when using mdns-sd together with mdns-repeater to repeat across VLANs (see upstream issue in netmuxd, jkcoxson/netmuxd#62). I was expecting this to be somehow solved with the current issue and related MR, but I probably have a wrong understanding of the way mdns-sd works.

    After update to v0.21.0, I still get errors such as, and it cannot detect my iPhone across VLANs.

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

    Happy to open a dedicated issue if that's any better, or provide more logs or wireshark traces / run some tests to debug this further. Many thanks!

  4. keepsimple1 commented on Aug 15, 2026

    @keepsimple1
    Owner

    @Phyks thanks for the report. Yes, please open a dedicated issue. It is a failure of processing an incoming packet and might be unrelated to this original issue.

    If you can capture the packets while the failure happens, that will be very helpful! Meantime, I have a theory about a corner case I will try to fix, and can submit a draft PR later for you to try.

  5. keepsimple1 commented on Aug 16, 2026

    @keepsimple1
    Owner

    @Phyks I've refactored read_name function related to the error message you saw in PR #492 . Is it possible to try it out?

    Also, can you provide info about the mDNS repeater setup in your test? including where the iPhone is, where the server (responder) is, etc. Thanks!

  6. Phyks commented on Aug 17, 2026

    @Phyks

    Hi,
    Many thanks for looking into this! I was waiting to be able to capture a packet trace for opening a dedicated issue, and was away from home and cannot do so properly over VPN. I’ll update asap. I’ll also try the referenced MR and report back!

    Regarding the setup, it is a such:

    If I switch the iPhone to be on a WiFi on the same VLAN as netmuxd/mdns-sd, it works fine. So the issue lies on the mdns repeating.

    I used to have the exact same setup working against a custom built of usbmuxd (with extra network setup), before switching to netmuxd/mdns-sd, so the mdns-repeater process should be compatible and working.

    Best

    EDIT: I should have added that AirPlay is working perfectly fine across these VLANs (iPhone in LAN, speaker in IoT), so mdns-repeater setup is working.

    EDIT2: mdns repeater service in VyOS is ultimately just a wrapper around avahi reflector:

    vyos@vyos:~$ cat /run/avahi-daemon/avahi-daemon.conf
    ### Autogenerated by service_mdns_repeater.py ###
    [server]
    use-ipv4=yes
    use-ipv6=yes
    allow-interfaces=eth5.4, eth1.1, eth1.2
    cache-entries-max=4096
    disallow-other-stacks=no
    
    [wide-area]
    enable-wide-area=yes
    
    [publish]
    disable-publishing=yes
    disable-user-service-publishing=yes
    publish-addresses=no
    publish-hinfo=no
    publish-workstation=no
    publish-aaaa-on-ipv4=no
    publish-a-on-ipv6=no
    
    [reflector]
    enable-reflector=yes
    
  7. Phyks commented on Aug 17, 2026

    @Phyks

    Hmmm, below should be a hopefully relevant tcpdump. Please let me know if my capture is not fitting:

    On LAN interface of the router:

    21:06:17.680949 36:37:62:79:8c:fc > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 118: (tos 0x0, ttl 255, id 7690, offset 0, flags [none], proto UDP (17), length 104)
        10.42.1.113.5353 > 224.0.0.251.5353: [udp sum ok] 0 [2q] PTR (QU)? _applicationServicePairing._tcp.local. PTR (QU)? _appSvcPrePair._tcp.local. (76)
    21:06:17.681516 36:37:62:79:8c:fc > 33:33:00:00:00:fb, ethertype IPv6 (0x86dd), length 138: (flowlabel 0xb0200, hlim 255, next-header UDP (17) payload length: 84) fe80::108d:ba36:960c:36a9.5353 > ff02::fb.5353: [udp sum ok] 0 [2q] PTR (QU)? _applicationServicePairing._tcp.local. PTR (QU)? _appSvcPrePair._tcp.local. (76)
    21:06:18.677712 36:37:62:79:8c:fc > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 118: (tos 0x0, ttl 255, id 37232, offset 0, flags [none], proto UDP (17), length 104)
        10.42.1.113.5353 > 224.0.0.251.5353: [udp sum ok] 0 [2q] PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. (76)
    21:06:18.678403 36:37:62:79:8c:fc > 33:33:00:00:00:fb, ethertype IPv6 (0x86dd), length 138: (flowlabel 0xb0200, hlim 255, next-header UDP (17) payload length: 84) fe80::108d:ba36:960c:36a9.5353 > ff02::fb.5353: [udp sum ok] 0 [2q] PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. (76)
    21:06:21.681558 36:37:62:79:8c:fc > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 118: (tos 0x0, ttl 255, id 58713, offset 0, flags [none], proto UDP (17), length 104)
        10.42.1.113.5353 > 224.0.0.251.5353: [udp sum ok] 0 [2q] PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. (76)
    21:06:21.681781 36:37:62:79:8c:fc > 33:33:00:00:00:fb, ethertype IPv6 (0x86dd), length 138: (flowlabel 0xb0200, hlim 255, next-header UDP (17) payload length: 84) fe80::108d:ba36:960c:36a9.5353 > ff02::fb.5353: [udp sum ok] 0 [2q] PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. (76)
    

    On the incoming interface of the machine running mdns-sd/netmuxd (IoT VLAN, after mdns-repeater):

    21:06:17.681962 a0:36:9f:1f:30:af > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 118: (tos 0x0, ttl 255, id 23645, offset 0, flags [DF], proto UDP (17), length 104)
        10.42.4.1.5353 > 224.0.0.251.5353: [udp sum ok] 0 [2q] PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. (76)
    21:06:18.678694 a0:36:9f:1f:30:af > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 118: (tos 0x0, ttl 255, id 23735, offset 0, flags [DF], proto UDP (17), length 104)
        10.42.4.1.5353 > 224.0.0.251.5353: [udp sum ok] 0 [2q] PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. (76)
    21:06:21.682616 a0:36:9f:1f:30:af > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 118: (tos 0x0, ttl 255, id 25775, offset 0, flags [DF], proto UDP (17), length 104)
        10.42.4.1.5353 > 224.0.0.251.5353: [udp sum ok] 0 [2q] PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. (76)
    21:06:27.175058 a0:36:9f:1f:30:af > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 414: (tos 0x0, ttl 255, id 27084, offset 0, flags [DF], proto UDP (17), length 400)
        10.42.4.1.5353 > 224.0.0.251.5353: [udp sum ok] 0 [4a] [7q] PTR (QM)? _rdlink._tcp.local. PTR (QM)? _appSvcPrePair._tcp.local. PTR (QM)? _applicationServicePairing._tcp.local. PTR (QM)? lb._dns-sd._udp.local. PTR (QM)? _hap._udp.local. PTR (QM)? _hap._tcp.local. PTR (QM)? _companion-link._tcp.local. _hap._tcp.local. PTR aspirateur Map data 448A18._hap._tcp.local., _hap._tcp.local. PTR c210 iot maison phyks me Tapo C210 F584 SD Stream 4E1815._hap._tcp.local., _hap._tcp.local. PTR c210 iot maison phyks me Tapo C210 F584 HD Stream 593610._hap._tcp.local., _hap._tcp.local. PTR HASS Bridge 6CF824._hap._tcp.local. (372)
    

    Naively, it seems the issue might be coming from the last generated packet (length 414) which is bundling together a bunch of mdns, beyond what was on the incoming interface?

    EDIT: Also tried by setting cache-entries-max=0 in Avahi reflector config, but did not change the

    Invalid incoming DNS message: Invalid name compression: pointer 169 must be less than the start offset 125
    

    errors.

  8. keepsimple1 commented on Aug 18, 2026

    @keepsimple1
    Owner

    Thanks for the data! It is likely the case the PR has fixed (a legal name compression case).

    Again, the log line

    Invalid incoming DNS message: Invalid name compression: pointer 169 must be less than the start offset 125

    indicates that you're still running the old code. Could you please make sure running the PR branch and try it again? Thanks!

  9. keepsimple1 commented on Aug 30, 2026

    @keepsimple1
    Owner

    To wrap it up, this PR comment confirms #492 fixes the new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions