From 4e62826e01eb481cdbd5793020b7ff3b77785c49 Mon Sep 17 00:00:00 2001 From: "Christian F.K. Schaller" Date: Tue, 7 Apr 2026 13:07:18 -0400 Subject: [PATCH] module-avb: fix legacy AECP handlers reading payload at wrong offset handle_acquire_entity_avb_legacy() and handle_lock_entity_avb_legacy() incorrectly treated the full ethernet frame pointer as the AEM packet pointer, causing p->payload to read descriptor_type and descriptor_id from the wrong offset. Fix by properly skipping the ethernet header, matching the pattern used by all other AEM command handlers. Co-Authored-By: Claude Opus 4.6 --- src/modules/module-avb/aecp-aem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/module-avb/aecp-aem.c b/src/modules/module-avb/aecp-aem.c index fccf6b178..e655f02c5 100644 --- a/src/modules/module-avb/aecp-aem.c +++ b/src/modules/module-avb/aecp-aem.c @@ -27,7 +27,8 @@ static int handle_acquire_entity_avb_legacy(struct aecp *aecp, int64_t now, const void *m, int len) { struct server *server = aecp->server; - const struct avb_packet_aecp_aem *p = m; + const struct avb_ethernet_header *h = m; + const struct avb_packet_aecp_aem *p = SPA_PTROFF(h, sizeof(*h), void); const struct avb_packet_aecp_aem_acquire *ae; const struct descriptor *desc; uint16_t desc_type, desc_id; @@ -53,7 +54,8 @@ static int handle_lock_entity_avb_legacy(struct aecp *aecp, int64_t now, const void *m, int len) { struct server *server = aecp->server; - const struct avb_packet_aecp_aem *p = m; + const struct avb_ethernet_header *h = m; + const struct avb_packet_aecp_aem *p = SPA_PTROFF(h, sizeof(*h), void); const struct avb_packet_aecp_aem_acquire *ae; const struct descriptor *desc; uint16_t desc_type, desc_id;