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

Ensure the name cache is rolled back when the packet reaches maximum size #318

Merged
merged 1 commit into from Jan 4, 2021

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 27, 2020

Fixes #308

If the packet was too large, it would be rolled back at the end of write_record.
We need to remove the names that were added to the name cache (self.names)
as well to avoid a case were we would create a pointer to a name that was
rolled back.

The size of the packet was incorrect at the end after the inserts because
insert_short would increase self.size even though it was already accounted
before. To resolve this insert_short_at_start was added which does not
increase self.size. This did not cause an actual bug, however it sure
made debugging this problem far more difficult.

Additionally the size now inserted and then replaced when the actual
size is known because it made debugging quite difficult since the size
did not previously agree with the data.

@bdraco bdraco force-pushed the fix_reset_on_packets branch 2 times, most recently from 809c3d8 to 6ed8c0a Compare October 27, 2020 18:38
@jstasiak
Copy link
Collaborator

Any easy way we can modify the test suite to verify this?

@coveralls
Copy link

coveralls commented Oct 27, 2020

Coverage Status

Coverage increased (+0.04%) to 93.748% when pulling f20e851 on bdraco:fix_reset_on_packets into 8f7effd on jstasiak:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 93.387% when pulling 6ed8c0aaeb74e2c817e48d34539f1c73da544e08 on bdraco:fix_reset_on_packets into 4da1612 on jstasiak:master.

@bdraco
Copy link
Member Author

bdraco commented Oct 27, 2020

I'll mark this as a draft while I think of a way to write a test for it. It will probably need to wait to the weekend when I have some more time. Its been like this for a while so I don't think its on fire and needs attention right now.

@bdraco bdraco marked this pull request as draft October 27, 2020 20:04
@bdraco
Copy link
Member Author

bdraco commented Oct 27, 2020

Definitely needs a test as I just got another case of it in the logs so I may not have fixed it or at least not all the instances of it.

2020-10-27 19:37:33 WARNING (zeroconf-Engine-260) [zeroconf] Choked at offset 1432 while unpacking b'\x00\x00\x84\x00\x00\x00\x00\x01\x00\x00\x00\x1b\x16FrontdoorCamera 8941D1\x04_hap\x04_tcp\x05local\x00\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=rShOMw==\x17HASS Bridge ZC8X FF413D\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcau\xc0\x92\xc0\x92\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=blO0/Q==\xc0\x92\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge 3K9A C2582A\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc10\xc10\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=Ak6GJw==\xc10\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge WLTF 4BE61F\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca}\xc1\xce\xc1\xce\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=YG0RXg==\xc1\xce\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Living Room TV 921B77\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc2k\xc2k\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=j6ZfMg==\xc2k\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x14Master Bed TV CEDB27\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcav\xc3\x06\xc3\x06\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=xgqEuw==\xc3\x06\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Snooze Room TV 6B89B0\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc3\x9f\xc3\x9f\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=2kikSg==\xc3\x9f\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge W9DN 5B5CC5\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca|\xc4:\xc4:\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=BdGUNQ==\xc4:\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc0\x0c\xc0\x0c\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=rShOMw==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge OS95 39C053\xc0#\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaw\xc5\\\xc5\\\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x98\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05'

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

2020-12-13 14:40:20 WARNING (zeroconf-Engine-245) [zeroconf] Choked at offset 1412 while unpacking b"\x00\x00\x84\x00\x00\x00\x00\x02\x00\x00\x00\x1c\x04_hap\x04_tcp\x05local\x00\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge OS95 39C053\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge W9DN 5B5CC5\xc0\x0c\x15Living Room TV 921B77\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc0g\xc0g\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=X+IIkg==\xc0g\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge ZC8X FF413D\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcau\xc1\x02\xc1\x02\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=t88gzA==\xc1\x02\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x16FrontdoorCamera 8941D1\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc1\xa0\xc1\xa0\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=75se4g==\xc1\xa0\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge Y9OO EFF0A7\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca~\xc2;\xc2;\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge Y9OO\x06pv=1.0\x14id=D3:FE:98:EF:F0:A7\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=qq5qSg==\xc2;\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge ZJWH FF5137\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcax\xc2\xd8\xc2\xd8\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=/tQqgw==\xc2\xd8\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge WLTF 4BE61F\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca}\xc3v\xc3v\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6qKX5Q==\xc3v\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x14Master Bed TV CEDB27\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcav\xc4\x13\xc4\x13\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=tNrdPw==\xc4\x13\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge 3K9A C2582A\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc4\xac\xc4\xac\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=XSl3Vg==\xc4\xac\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Snooze Room TV 6B89B0\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc5J\xc5J\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x84\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0'\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaw\xc0'"

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

Looks like I need to dig in more

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

Was able to verify its choking on a packet it is sending.

2020-12-13 15:07:37 WARNING (zeroconf-Engine-250) [zeroconf] Sending out: <DNSOutgoing:{multicast=True, flags=33792, questions=[], answers=[(record[ptr,in,_hap._tcp.local.]=4500/4499,AlexanderHomeAssistant 74651D._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge ZJWH FF5137._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge 3K9A C2582A._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,Living Room TV 921B77._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,FrontdoorCamera 8941D1._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge OS95 39C053._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge W9DN 5B5CC5._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge ZC8X FF413D._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,Snooze Room TV 6B89B0._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,Master Bed TV CEDB27._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge WLTF 4BE61F._hap._tcp.local., 0)], authorities=[], additionals=[record[srv,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,AlexanderHomeAssistant 74651D._hap._tcp.local.:54811, record[txt,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=4500/4499,b'\x19md=Ale'..., record[a,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,HASS Bridge ZJWH FF5137._hap._tcp.local.:51832, record[txt,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=4500/4499,b'\x13md=HAS'..., record[a,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,HASS Bridge 3K9A C2582A._hap._tcp.local.:51834, record[txt,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=4500/4499,b'\x13md=HAS'..., record[a,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,Living Room TV 921B77._hap._tcp.local.:51833, record[txt,in-unique,Living Room TV 921B77._hap._tcp.local.]=4500/4499,b'\x11md=Liv'..., record[a,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,FrontdoorCamera 8941D1._hap._tcp.local.:54898, record[txt,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=4500/4499,b'\x12md=Fro'..., record[a,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,HASS Bridge OS95 39C053._hap._tcp.local.:51831, record[txt,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=4500/4499,b'\x13md=HAS'..., record[a,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,HASS Bridge W9DN 5B5CC5._hap._tcp.local.:51836, record[txt,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=4500/4499,b'\x13md=HAS'..., record[a,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,HASS Bridge ZC8X FF413D._hap._tcp.local.:51829, record[txt,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=4500/4499,b'\x13md=HAS'..., record[a,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,HASS Bridge Y9OO EFF0A7._hap._tcp.local.:51838, record[txt,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=4500/4499,b'\x13md=HAS'..., record[a,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,Snooze Room TV 6B89B0._hap._tcp.local.:51835, record[txt,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=4500/4499,b'\x11md=Sno'..., record[a,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,Master Bed TV CEDB27._hap._tcp.local.:51830, record[txt,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=4500/4499,b'\x10md=Mas'..., record[a,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,HASS Bridge WLTF 4BE61F._hap._tcp.local.:51837, record[txt,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=4500/4499,b'\x13md=HAS'..., record[a,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,192.168.208.5]}> as [b"\x00\x00\x84\x00\x00\x00\x00\x0b\x00\x00\x00\x19\x04_hap\x04_tcp\x05local\x00\x00\x0c\x00\x01\x00\x00\x11\x94\x00 \x1dAlexanderHomeAssistant 74651D\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge ZJWH FF5137\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge 3K9A C2582A\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x18\x15Living Room TV 921B77\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x19\x16FrontdoorCamera 8941D1\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge OS95 39C053\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge W9DN 5B5CC5\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge ZC8X FF413D\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x18\x15Snooze Room TV 6B89B0\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x17\x14Master Bed TV CEDB27\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge WLTF 4BE61F\xc0\x0c\xc0'\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6\x1b\xc0'\xc0'\x00\x10\x80\x01\x00\x00\x11\x94\x00\\\x19md=AlexanderHomeAssistant\x06pv=1.0\x14id=59:8A:0B:74:65:1D\x05c#=14\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=FYa//g==\xc0'\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0S\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcax\xc0S\xc0S\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=4NmQWw==\xc0S\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0y\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc0y\xc0y\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=siXN9g==\xc0y\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\x9f\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc0\x9f\xc0\x9f\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=mYyPjA==\xc0\x9f\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\xc3\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc0\xc3\xc0\xc3\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=sq97lg==\xc0\xc3\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\xe8\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaw\xc0\xe8\xc0\xe8\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=OXN/nA==\xc0\xe8\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc1\x0e\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca|\xc1\x0e\xc1\x0e\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=1FqOfg==\xc1\x0e\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc14\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcau\xc14\xc14\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x8c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc1Z\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc1Z", b'\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x17HASS Bridge Y9OO EFF0A7\x04_hap\x04_tcp\x05local\x00\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge Y9OO\x06pv=1.0\x14id=D3:FE:98:EF:F0:A7\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=j9V/cw==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Snooze Room TV 6B89B0\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc0\xa4\xc0\xa4\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=JjOEig==\xc0\xa4\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x14Master Bed TV CEDB27\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcav\xc1?\xc1?\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=4D6mBg==\xc1?\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge WLTF 4BE61F\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca}\xc1\xd8\xc1\xd8\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=tJgpsA==\xc1\xd8\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05']
2020-12-13 15:07:39 WARNING (zeroconf-Engine-250) [zeroconf] Choked at offset 1420 while unpacking b"\x00\x00\x84\x00\x00\x00\x00\x0b\x00\x00\x00\x19\x04_hap\x04_tcp\x05local\x00\x00\x0c\x00\x01\x00\x00\x11\x94\x00 \x1dAlexanderHomeAssistant 74651D\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge ZJWH FF5137\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge 3K9A C2582A\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x18\x15Living Room TV 921B77\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x19\x16FrontdoorCamera 8941D1\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge OS95 39C053\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge W9DN 5B5CC5\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge ZC8X FF413D\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x18\x15Snooze Room TV 6B89B0\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x17\x14Master Bed TV CEDB27\xc0\x0c\xc0\x0c\x00\x0c\x00\x01\x00\x00\x11\x94\x00\x1a\x17HASS Bridge WLTF 4BE61F\xc0\x0c\xc0'\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6\x1b\xc0'\xc0'\x00\x10\x80\x01\x00\x00\x11\x94\x00\\\x19md=AlexanderHomeAssistant\x06pv=1.0\x14id=59:8A:0B:74:65:1D\x05c#=14\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=FYa//g==\xc0'\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0S\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcax\xc0S\xc0S\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=4NmQWw==\xc0S\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0y\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc0y\xc0y\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=siXN9g==\xc0y\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\x9f\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc0\x9f\xc0\x9f\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=mYyPjA==\xc0\x9f\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\xc3\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc0\xc3\xc0\xc3\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=sq97lg==\xc0\xc3\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\xe8\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaw\xc0\xe8\xc0\xe8\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=OXN/nA==\xc0\xe8\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc1\x0e\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca|\xc1\x0e\xc1\x0e\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=1FqOfg==\xc1\x0e\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc14\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcau\xc14\xc14\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x8c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc1Z\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc1Z"
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 745, in __init__
    self.read_others()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 816, in read_others
    domain = self.read_name()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 890, in read_name
    raise IncomingDecodeError("Bad domain name (circular) at %s" % (off,))
zeroconf.IncomingDecodeError: Bad domain name (circular) at 1420

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

I think something in the first packet is pointing to something in the second packet.

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

2020-12-13 15:14:51 WARNING (zeroconf-Engine-247) [zeroconf] Sending out: <DNSOutgoing:{multicast=True, flags=33792, questions=[], answers=[(record[txt,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6fLM5A==', 0)], authorities=[], additionals=[record[srv,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,HASS Bridge ZJWH FF5137._hap._tcp.local.:51832, record[txt,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=L0m/aQ==', record[a,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,HASS Bridge 3K9A C2582A._hap._tcp.local.:51834, record[txt,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b2CnzQ==', record[a,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,Master Bed TV CEDB27._hap._tcp.local.:51830, record[txt,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=4500/4499,b'\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=CVj1kw==', record[a,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,Living Room TV 921B77._hap._tcp.local.:51833, record[txt,in-unique,Living Room TV 921B77._hap._tcp.local.]=4500/4499,b'\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=qU77SQ==', record[a,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,HASS Bridge ZC8X FF413D._hap._tcp.local.:51829, record[txt,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b0QZlg==', record[a,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,HASS Bridge WLTF 4BE61F._hap._tcp.local.:51837, record[txt,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=ahAISA==', record[a,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,FrontdoorCamera 8941D1._hap._tcp.local.:54898, record[txt,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=4500/4499,b'\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=0+MXmA==', record[a,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,HASS Bridge W9DN 5B5CC5._hap._tcp.local.:51836, record[txt,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6fLM5A==', record[a,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,HASS Bridge Y9OO EFF0A7._hap._tcp.local.:51838, record[txt,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge Y9OO\x06pv=1.0\x14id=D3:FE:98:EF:F0:A7\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=u3bdfw==', record[a,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,Snooze Room TV 6B89B0._hap._tcp.local.:51835, record[txt,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=4500/4499,b'\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=xNTqsg==', record[a,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,AlexanderHomeAssistant 74651D._hap._tcp.local.:54811, record[txt,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=4500/4499,b'\x19md=AlexanderHomeAssistant\x06pv=1.0\x14id=59:8A:0B:74:65:1D\x05c#=14\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=ccZLPA==', record[a,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,HASS Bridge OS95 39C053._hap._tcp.local.:51831, record[txt,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=Xfe5LQ==', record[a,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,192.168.208.5]}> as [b'\x00\x00\x84\x00\x00\x00\x00\x01\x00\x00\x00\x1b\x17HASS Bridge W9DN 5B5CC5\x04_hap\x04_tcp\x05local\x00\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6fLM5A==\x17HASS Bridge ZJWH FF5137\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcax\xc0\x95\xc0\x95\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=L0m/aQ==\xc0\x95\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge 3K9A C2582A\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc13\xc13\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b2CnzQ==\xc13\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x14Master Bed TV CEDB27\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcav\xc1\xd1\xc1\xd1\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=CVj1kw==\xc1\xd1\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Living Room TV 921B77\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc2j\xc2j\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=qU77SQ==\xc2j\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge ZC8X FF413D\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcau\xc3\x05\xc3\x05\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b0QZlg==\xc3\x05\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge WLTF 4BE61F\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca}\xc3\xa3\xc3\xa3\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=ahAISA==\xc3\xa3\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x16FrontdoorCamera 8941D1\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc4@\xc4@\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=0+MXmA==\xc4@\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca|\xc0\x0c\xc0\x0c\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6fLM5A==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge Y9OO EFF0A7\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca~\xc5a\xc5a\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x9d\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05', b'\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00\x00\t\x15Snooze Room TV 6B89B0\x04_hap\x04_tcp\x05local\x00\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc0\x0c\xc0\x0c\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=xNTqsg==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x1dAlexanderHomeAssistant 74651D\xc0"\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6\x1b\xc0\xb6\xc0\xb6\x00\x10\x80\x01\x00\x00\x11\x94\x00\\\x19md=AlexanderHomeAssistant\x06pv=1.0\x14id=59:8A:0B:74:65:1D\x05c#=14\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=ccZLPA==\xc0\xb6\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge OS95 39C053\xc0"\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaw\xc1`\xc1`\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=Xfe5LQ==\xc1`\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05']
2020-12-13 15:14:51 WARNING (zeroconf-Engine-247) [zeroconf] Choked at offset 1437 while unpacking b'\x00\x00\x84\x00\x00\x00\x00\x01\x00\x00\x00\x1b\x17HASS Bridge W9DN 5B5CC5\x04_hap\x04_tcp\x05local\x00\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6fLM5A==\x17HASS Bridge ZJWH FF5137\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcax\xc0\x95\xc0\x95\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=L0m/aQ==\xc0\x95\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge 3K9A C2582A\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc13\xc13\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b2CnzQ==\xc13\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x14Master Bed TV CEDB27\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcav\xc1\xd1\xc1\xd1\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=CVj1kw==\xc1\xd1\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Living Room TV 921B77\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc2j\xc2j\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=qU77SQ==\xc2j\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge ZC8X FF413D\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcau\xc3\x05\xc3\x05\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b0QZlg==\xc3\x05\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge WLTF 4BE61F\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca}\xc3\xa3\xc3\xa3\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=ahAISA==\xc3\xa3\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x16FrontdoorCamera 8941D1\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc4@\xc4@\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=0+MXmA==\xc4@\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca|\xc0\x0c\xc0\x0c\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6fLM5A==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge Y9OO EFF0A7\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca~\xc5a\xc5a\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x9d\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 742, in __init__
    self.read_others()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 813, in read_others
    domain = self.read_name()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 887, in read_name
    raise IncomingDecodeError("Bad domain name (circular) at %s" % (off,))
zeroconf.IncomingDecodeError: Bad domain name (circular) at 1437

I think I've got enough to replay the packet construction now

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

Here is the DNSOutgoing repr that triggers the issue:

Sending out: <DNSOutgoing:{multicast=True, flags=33792, questions=[], answers=[(record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge ZJWH FF5137._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge 3K9A C2582A._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,Master Bed TV CEDB27._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,Living Room TV 921B77._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge ZC8X FF413D._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge WLTF 4BE61F._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,FrontdoorCamera 8941D1._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge W9DN 5B5CC5._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge Y9OO EFF0A7._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,Snooze Room TV 6B89B0._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,AlexanderHomeAssistant 74651D._hap._tcp.local., 0), (record[ptr,in,_hap._tcp.local.]=4500/4499,HASS Bridge OS95 39C053._hap._tcp.local., 0)], authorities=[], additionals=[record[srv,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,HASS Bridge ZJWH FF5137._hap._tcp.local.:51832, record[txt,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=L0m/aQ==', record[a,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,HASS Bridge 3K9A C2582A._hap._tcp.local.:51834, record[txt,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b2CnzQ==', record[a,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,Master Bed TV CEDB27._hap._tcp.local.:51830, record[txt,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=4500/4499,b'\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=CVj1kw==', record[a,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,Living Room TV 921B77._hap._tcp.local.:51833, record[txt,in-unique,Living Room TV 921B77._hap._tcp.local.]=4500/4499,b'\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=qU77SQ==', record[a,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,HASS Bridge ZC8X FF413D._hap._tcp.local.:51829, record[txt,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=b0QZlg==', record[a,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,HASS Bridge WLTF 4BE61F._hap._tcp.local.:51837, record[txt,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=ahAISA==', record[a,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,FrontdoorCamera 8941D1._hap._tcp.local.:54898, record[txt,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=4500/4499,b'\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=0+MXmA==', record[a,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,HASS Bridge W9DN 5B5CC5._hap._tcp.local.:51836, record[txt,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=6fLM5A==', record[a,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,HASS Bridge Y9OO EFF0A7._hap._tcp.local.:51838, record[txt,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge Y9OO\x06pv=1.0\x14id=D3:FE:98:EF:F0:A7\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=u3bdfw==', record[a,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,Snooze Room TV 6B89B0._hap._tcp.local.:51835, record[txt,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=4500/4499,b'\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=xNTqsg==', record[a,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,AlexanderHomeAssistant 74651D._hap._tcp.local.:54811, record[txt,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=4500/4499,b'\x19md=AlexanderHomeAssistant\x06pv=1.0\x14id=59:8A:0B:74:65:1D\x05c#=14\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=ccZLPA==', record[a,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,HASS Bridge OS95 39C053._hap._tcp.local.:51831, record[txt,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=Xfe5LQ==', record[a,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,192.168.208.5]}>

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

And a second one to be sure

2020-12-13 15:25:30 WARNING (zeroconf-Engine-244) [zeroconf] Sending out: <DNSOutgoing:{multicast=True, flags=33792, questions=[], answers=[(record[txt,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=HiZUhw==', 0)], authorities=[], additionals=[record[srv,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,Living Room TV 921B77._hap._tcp.local.:51833, record[txt,in-unique,Living Room TV 921B77._hap._tcp.local.]=4500/4499,b'\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=F2gJwg==', record[a,in-unique,Living Room TV 921B77._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,Snooze Room TV 6B89B0._hap._tcp.local.:51835, record[txt,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=4500/4499,b'\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=9ixLPA==', record[a,in-unique,Snooze Room TV 6B89B0._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,HASS Bridge 3K9A C2582A._hap._tcp.local.:51834, record[txt,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=D3le0g==', record[a,in-unique,HASS Bridge 3K9A C2582A._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,HASS Bridge Y9OO EFF0A7._hap._tcp.local.:51838, record[txt,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge Y9OO\x06pv=1.0\x14id=D3:FE:98:EF:F0:A7\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=JotcDA==', record[a,in-unique,HASS Bridge Y9OO EFF0A7._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,Master Bed TV CEDB27._hap._tcp.local.:51830, record[txt,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=4500/4499,b'\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=MhIepQ==', record[a,in-unique,Master Bed TV CEDB27._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,HASS Bridge OS95 39C053._hap._tcp.local.:51831, record[txt,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=kOtNcA==', record[a,in-unique,HASS Bridge OS95 39C053._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,FrontdoorCamera 8941D1._hap._tcp.local.:54898, record[txt,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=4500/4499,b'\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=Pqrwug==', record[a,in-unique,FrontdoorCamera 8941D1._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,HASS Bridge WLTF 4BE61F._hap._tcp.local.:51837, record[txt,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=HiZUhw==', record[a,in-unique,HASS Bridge WLTF 4BE61F._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,AlexanderHomeAssistant 74651D._hap._tcp.local.:54811, record[txt,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=4500/4499,b'\x19md=AlexanderHomeAssistant\x06pv=1.0\x14id=59:8A:0B:74:65:1D\x05c#=14\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=C/jflQ==', record[a,in-unique,AlexanderHomeAssistant 74651D._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,HASS Bridge W9DN 5B5CC5._hap._tcp.local.:51836, record[txt,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=finGog==', record[a,in-unique,HASS Bridge W9DN 5B5CC5._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,HASS Bridge ZJWH FF5137._hap._tcp.local.:51832, record[txt,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=NAWZNw==', record[a,in-unique,HASS Bridge ZJWH FF5137._hap._tcp.local.]=120/119,192.168.208.5, record[srv,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,HASS Bridge ZC8X FF413D._hap._tcp.local.:51829, record[txt,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=4500/4499,b'\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=DetsYA==', record[a,in-unique,HASS Bridge ZC8X FF413D._hap._tcp.local.]=120/119,192.168.208.5]}> as [b'\x00\x00\x84\x00\x00\x00\x00\x01\x00\x00\x00\x1b\x17HASS Bridge WLTF 4BE61F\x04_hap\x04_tcp\x05local\x00\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=HiZUhw==\x15Living Room TV 921B77\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc0\x94\xc0\x94\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=F2gJwg==\xc0\x94\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Snooze Room TV 6B89B0\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc1/\xc1/\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=9ixLPA==\xc1/\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge 3K9A C2582A\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc1\xca\xc1\xca\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=D3le0g==\xc1\xca\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge Y9OO EFF0A7\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca~\xc2h\xc2h\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge Y9OO\x06pv=1.0\x14id=D3:FE:98:EF:F0:A7\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=JotcDA==\xc2h\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x14Master Bed TV CEDB27\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcav\xc3\x05\xc3\x05\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=MhIepQ==\xc3\x05\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge OS95 39C053\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaw\xc3\x9e\xc3\x9e\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=kOtNcA==\xc3\x9e\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x16FrontdoorCamera 8941D1\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc4<\xc4<\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=Pqrwug==\xc4<\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca}\xc0\x0c\xc0\x0c\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=HiZUhw==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x1dAlexanderHomeAssistant 74651D\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6\x1b\xc5\\\xc5\\\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x9e\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05', b'\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00\x00\t\x17HASS Bridge W9DN 5B5CC5\x04_hap\x04_tcp\x05local\x00\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca|\xc0\x0c\xc0\x0c\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge W9DN\x06pv=1.0\x14id=11:8E:DB:5B:5C:C5\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=finGog==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge ZJWH FF5137\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcax\xc0\xb9\xc0\xb9\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZJWH\x06pv=1.0\x14id=01:6B:30:FF:51:37\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=NAWZNw==\xc0\xb9\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge ZC8X FF413D\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcau\xc1W\xc1W\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge ZC8X\x06pv=1.0\x14id=96:14:45:FF:41:3D\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=DetsYA==\xc1W\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05']
2020-12-13 15:25:30 WARNING (zeroconf-Engine-244) [zeroconf] Choked at offset 1438 while unpacking b'\x00\x00\x84\x00\x00\x00\x00\x01\x00\x00\x00\x1b\x17HASS Bridge WLTF 4BE61F\x04_hap\x04_tcp\x05local\x00\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=HiZUhw==\x15Living Room TV 921B77\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcay\xc0\x94\xc0\x94\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Living Room TV\x06pv=1.0\x14id=11:61:E7:92:1B:77\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=F2gJwg==\xc0\x94\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x15Snooze Room TV 6B89B0\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca{\xc1/\xc1/\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x11md=Snooze Room TV\x06pv=1.0\x14id=5F:D5:70:6B:89:B0\x05c#=17\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=9ixLPA==\xc1/\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge 3K9A C2582A\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaz\xc1\xca\xc1\xca\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge 3K9A\x06pv=1.0\x14id=E2:AA:5B:C2:58:2A\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=D3le0g==\xc1\xca\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge Y9OO EFF0A7\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca~\xc2h\xc2h\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge Y9OO\x06pv=1.0\x14id=D3:FE:98:EF:F0:A7\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=JotcDA==\xc2h\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x14Master Bed TV CEDB27\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcav\xc3\x05\xc3\x05\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x10md=Master Bed TV\x06pv=1.0\x14id=9E:B7:44:CE:DB:27\x05c#=18\x04s#=1\x04ff=0\x05ci=31\x04sf=0\x0bsh=MhIepQ==\xc3\x05\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x17HASS Bridge OS95 39C053\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xcaw\xc3\x9e\xc3\x9e\x00\x10\x80\x01\x00\x00\x11\x94\x00V\x13md=HASS Bridge OS95\x06pv=1.0\x14id=7E:8C:E6:39:C0:53\x05c#=12\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=kOtNcA==\xc3\x9e\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x16FrontdoorCamera 8941D1\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6r\xc4<\xc4<\x00\x10\x80\x01\x00\x00\x11\x94\x00T\x12md=FrontdoorCamera\x06pv=1.0\x14id=9F:B7:DC:89:41:D1\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=Pqrwug==\xc4<\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc0\x0c\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xca}\xc0\x0c\xc0\x0c\x00\x10\x80\x01\x00\x00\x11\x94\x00U\x13md=HASS Bridge WLTF\x06pv=1.0\x14id=E0:E7:98:4B:E6:1F\x04c#=2\x04s#=1\x04ff=0\x04ci=2\x04sf=0\x0bsh=HiZUhw==\xc0\x0c\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\x1dAlexanderHomeAssistant 74651D\xc0$\x00!\x80\x01\x00\x00\x00x\x00\x08\x00\x00\x00\x00\xd6\x1b\xc5\\\xc5\\\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05\xc5\x9e\x00\x01\x80\x01\x00\x00\x00x\x00\x04\xc0\xa8\xd0\x05'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 742, in __init__
    self.read_others()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 813, in read_others
    domain = self.read_name()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 887, in read_name
    raise IncomingDecodeError("Bad domain name (circular) at %s" % (off,))
zeroconf.IncomingDecodeError: Bad domain name (circular) at 1438

@bdraco
Copy link
Member Author

bdraco commented Dec 13, 2020

@stephenrauch Any chance you can take a look? I've got a script that replicates the compression issue:

https://github.com/bdraco/python-zeroconf/blob/choke_fix/choke.py

@bdraco
Copy link
Member Author

bdraco commented Dec 29, 2020

I finally found the actual problem.

When we rollback because the packet is too large we fail to remove the names so we create pointers to names that have been moved to the next packet.

@bdraco bdraco changed the title Ensure the name cache is reset when generating DNSOutgoing packets Ensure the name cache is rollback when the packet reaches maximum size Dec 29, 2020
@bdraco bdraco changed the title Ensure the name cache is rollback when the packet reaches maximum size Ensure the name cache is rolled back when the packet reaches maximum size Dec 29, 2020
@bdraco
Copy link
Member Author

bdraco commented Dec 29, 2020

I'm going to take choke.py and turn it into a test.

@bdraco bdraco force-pushed the fix_reset_on_packets branch 4 times, most recently from b40eeeb to f88f738 Compare December 29, 2020 23:52
@bdraco bdraco marked this pull request as ready for review December 30, 2020 00:09
@bdraco
Copy link
Member Author

bdraco commented Dec 30, 2020

Verified the no more choked error on the affected systems

@jstasiak
Copy link
Collaborator

Nice! I'll have a look at this soon.

@bdraco bdraco force-pushed the fix_reset_on_packets branch 5 times, most recently from 8f2667a to a71fa51 Compare December 30, 2020 01:08
@bdraco
Copy link
Member Author

bdraco commented Dec 30, 2020

@bdraco
Copy link
Member Author

bdraco commented Dec 30, 2020

I think I should take out the exact packet matching. As long as re-loading it with DNSIncoming doesn't throw we know its ok

@bdraco
Copy link
Member Author

bdraco commented Dec 30, 2020

That's cleaner. I think this is ready to go. I just retested it

@bdraco
Copy link
Member Author

bdraco commented Dec 31, 2020

Running for 24 hours and no more errors in the log on the site that this was happening 👍

@bdraco
Copy link
Member Author

bdraco commented Jan 2, 2021

Still looking good.

@jstasiak Any chance we can get a release with this before monday so we can get it into the next Home Assistant release on wednesday?

Thank you

@jstasiak
Copy link
Collaborator

jstasiak commented Jan 4, 2021

@bdraco I'm sorry, didn't have time to look at this until now. The new test finishes successfully for me (Mac OS 10.14, CPython 3.9.0) without changes to the library code so while I trust the issue is fixed the test we have doesn't actually verify it.

@bdraco
Copy link
Member Author

bdraco commented Jan 4, 2021

I'll roll the test back to a prior revision. I looks I was too aggressive in trying to reduce the size of the test case.

…size

If the packet was too large, it would be rolled back at the end of write_record.
We need to remove the names that were added to the name cache (self.names)
as well to avoid a case were we would create a pointer to a name that was
rolled back.

The size of the packet was incorrect at the end after the inserts because
insert_short would increase self.size even though it was already accounted
before. To resolve this insert_short_at_start was added which does not
increase self.size. This did not cause an actual bug, however it sure
made debugging this problem far more difficult.

Additionally the size now inserted and then replaced when the actual
size is known because it made debugging quite difficult since the size
did not previously agree with the data.
@bdraco
Copy link
Member Author

bdraco commented Jan 4, 2021

I was able to keep the test almost as-is and add this:

diff --git a/zeroconf/test.py b/zeroconf/test.py
index 8ffe8f3..f558e71 100644
--- a/zeroconf/test.py
+++ b/zeroconf/test.py
@@ -2124,4 +2124,5 @@ def test_dns_compression_rollback_for_corruption():
     for packet in out.packets():
         # Verify we can process the packets we created to
         # ensure there is no corruption with the dns compression
-        assert r.DNSIncoming(packet)
+        incoming = r.DNSIncoming(packet)
+        assert incoming.valid is True

Verified it passes on the new code and fails on the old code.

@bdraco
Copy link
Member Author

bdraco commented Jan 4, 2021

@jstasiak retested after walking away for a minute and should be good to go. Thanks for validating the test. Sorry I missed it in the first place.

@jstasiak
Copy link
Collaborator

jstasiak commented Jan 4, 2021

I was able to keep the test almost as-is (...)

Nice! I was afraid the binary dump of the DNS packets would be back (I could live with it, but it's better not to have it). I'll review (and hopefully release) soon.

Copy link
Collaborator

@jstasiak jstasiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jstasiak jstasiak merged commit 86b4e11 into python-zeroconf:master Jan 4, 2021
@jstasiak
Copy link
Collaborator

jstasiak commented Jan 4, 2021

@bdraco Released as version 0.28.8. No worries about the test. :)

@bdraco
Copy link
Member Author

bdraco commented Jan 4, 2021

Thank you!

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.

Choked at offset
3 participants