IKEA tradfri gateway - broken zeroconf / discovery

Hi, every couple of minutes I see exceptions in my home assistant logs.

Apparently, the zeroconf/discovery/avahi/mdns component is confused by the tradfri gateway sending malformed packets.

2020-05-31 14:06:14 WARNING (zeroconf-Engine-2895220768) [zeroconf] Choked at offset 382 while unpacking b'\x00\x00~censored~ ...
2020-05-31 14:06:14 WARNING (zeroconf-Engine-2895220768) [zeroconf] Exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 716, in __init__
    self.read_others()
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 787, in read_others
    domain = self.read_name()
  File "/usr/local/lib/python3.7/site-packages/zeroconf/__init__.py", line 843, in read_name
    length = self.data[off]
IndexError: index out of range

Wireshark confirms packets are fishy.


Any ideas? Could this be intentional?

(I asked on r/tradfri as well, sometimes there’s IKEA engineering staff there).

Did you ever found any solution to this?
I see this in my logs too.
I´m going to move away from the ikea gateway and get everything connected with Deconz and conbee2 instead.

The parser and/or logging code needs an update to be less spammy.

The packets are definitely out of spec, but that’s not an issue per-se - home assistant shouldn’t trust the network or rely on it being well behaved.

IKEA doesn’t care.