Skip to content

Commit c1d5d72

Browse files
committed
mctpd: update supports_vdm check
Updated supports_vdm check to be decided based on supported PCIE/IANA message type instead of formatID. Fixes: cb182be ("mctpd: Add VendorDefinedMessageTypes property") Signed-off-by: rutaabhyankar <ruta.abhyankar@intel.com>
1 parent 4df64d5 commit c1d5d72

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/mctpd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,10 +3163,8 @@ static int query_peer_properties(struct peer *peer)
31633163
}
31643164

31653165
for (unsigned int i = 0; i < peer->num_message_types; i++) {
3166-
if (peer->message_types[i] ==
3167-
MCTP_GET_VDM_SUPPORT_IANA_FORMAT_ID ||
3168-
peer->message_types[i] ==
3169-
MCTP_GET_VDM_SUPPORT_PCIE_FORMAT_ID) {
3166+
if (peer->message_types[i] == MCTP_TYPE_VENDOR_IANA ||
3167+
peer->message_types[i] == MCTP_TYPE_VENDOR_PCIE) {
31703168
supports_vdm = true;
31713169
break;
31723170
}

tests/test_mctpd.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,13 @@ async def test_query_vdm_types(dbus, mctpd):
641641
"""Test that VendorDefinedMessageTypes is queried and populated."""
642642
iface = mctpd.system.interfaces[0]
643643
vdm_support = [[0, 0x1234, 0x5678], [1, 0xABCDEF12, 0x3456]]
644-
ep = Endpoint(iface, bytes([0x1E]), eid=15, vdm_msg_types=vdm_support)
644+
ep = Endpoint(
645+
iface,
646+
bytes([0x1E]),
647+
eid=15,
648+
types=[0, 0x7E, 0x7F],
649+
vdm_msg_types=vdm_support,
650+
)
645651
mctpd.network.add_endpoint(ep)
646652

647653
mctp = await mctpd_mctp_iface_obj(dbus, iface)

0 commit comments

Comments
 (0)