From 2d4c55fdfbcf420d8c0f7ea3fcda44cd1ef7b5b3 Mon Sep 17 00:00:00 2001 From: Stefan Ric Date: Wed, 4 Dec 2024 19:01:11 +0100 Subject: [PATCH] Fix parsing issue with zero-padded advertisement data --- linux/adv/packet.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/adv/packet.go b/linux/adv/packet.go index ce555f0d..caeb98a3 100644 --- a/linux/adv/packet.go +++ b/linux/adv/packet.go @@ -174,6 +174,10 @@ func (p *Packet) Field(typ byte) []byte { return nil } l, t := b[0], b[1] + if l == 0 && t == 0 { + b = b[2:] + continue + } if int(l) < 1 || len(b) < int(1+l) { return nil }