Skip to content

Commit

Permalink
fw_fcp: check card_id in requested event for transaction response
Browse files Browse the repository at this point in the history
The value of node_id can differ according to bus generation, while the
value of card_id is stable. Both of them are available to filter out the
request subaction from unexpected node even if crossing bus reset.

Signed-off-by: Takashi Sakamoto <[email protected]>
  • Loading branch information
takaswie committed Aug 12, 2023
1 parent bb217fa commit bda80b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fw_fcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,11 @@ static HinawaFwRcode handle_requested_signal(HinawaFwResp *resp, HinawaFwTcode t
{
HinawaFwFcp *self = HINAWA_FW_FCP(resp);
HinawaFwFcpPrivate *priv = hinawa_fw_fcp_get_instance_private(self);
guint node_id;
guint local_card_id;

g_object_get(priv->node, "node-id", &node_id, NULL);
g_object_get(priv->node, "card-id", &local_card_id, NULL);
if (offset == FCP_RESPOND_ADDR && tcode == HINAWA_FW_TCODE_WRITE_BLOCK_REQUEST &&
src_node_id == node_id)
card_id == local_card_id)
g_signal_emit(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED], 0, tstamp, frame, length);

// MEMO: Linux firewire subsystem already send response subaction to finish the transaction,
Expand Down

0 comments on commit bda80b4

Please sign in to comment.