module-avb: fix MRP NEW messages never being transmitted

AVB_MRP_SEND_NEW was defined as 0, making it indistinguishable from
"no pending send" in the MSRP and MVRP event handlers which check
`if (!pending_send)`. This meant that when an attribute was first
declared (applicant state VN or AN), the NEW message was silently
dropped instead of being transmitted on the network.

Fix by shifting all AVB_MRP_SEND_* values to start at 1, so that 0
unambiguously means "no send pending". Update the MSRP and MVRP
encoders to subtract 1 when encoding to the IEEE 802.1Q wire format
(which uses 0-based event values).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian F.K. Schaller 2026-04-07 08:23:43 -04:00 committed by Wim Taymans
parent ef8f820d4a
commit 1d0c51f057
4 changed files with 13 additions and 11 deletions

View file

@ -88,13 +88,13 @@ struct avb_packet_mrp_footer {
#define AVB_MRP_ATTRIBUTE_EVENT_LV 5
#define AVB_MRP_ATTRIBUTE_EVENT_LVA 6
#define AVB_MRP_SEND_NEW 0
#define AVB_MRP_SEND_JOININ 1
#define AVB_MRP_SEND_IN 2
#define AVB_MRP_SEND_JOINMT 3
#define AVB_MRP_SEND_MT 4
#define AVB_MRP_SEND_LV 5
#define AVB_MRP_SEND_LVA 6
#define AVB_MRP_SEND_NEW 1
#define AVB_MRP_SEND_JOININ 2
#define AVB_MRP_SEND_IN 3
#define AVB_MRP_SEND_JOINMT 4
#define AVB_MRP_SEND_MT 5
#define AVB_MRP_SEND_LV 6
#define AVB_MRP_SEND_LVA 7
#define AVB_MRP_NOTIFY_NEW 1
#define AVB_MRP_NOTIFY_JOIN 2