Problem
LinuxXfrmBackend::rekey_sa issues XFRM_MSG_UPDSA. The upstream Linux handler routes that message to xfrm_state_update, which locates the existing SA and returns -ESRCH when the lookup misses. The SDK maps that authoritative miss to XfrmError::NotFound.
MockXfrmBackend::rekey_sa currently uses map insertion and returns Ok(()) even when no matching SA exists. It therefore creates state on an update-only operation and can false-green rekey behavior that the Linux backend rejects.
Required contract
- Build the existing-SA lookup using the same modeled Linux lookup identity as the mock SA store.
- If no matching SA exists, return
XfrmError::NotFound without inserting or altering any SA.
- Operation capture may record the rejected rekey attempt, but stored state must remain unchanged.
- Preserve successful update behavior when the matching SA does exist.
Required tests
- Rekey an empty unscoped mock backend, assert
NotFound, then query the identity and prove that no SA was inserted.
- Repeat with a nonzero
if_id; the Linux SA lookup tuple still controls whether an existing SA is present, and a miss must not create one.
- Install an SA first, rekey the matching identity, and prove the intended existing-state update still succeeds.
The regression must exercise the public MockXfrmBackend.
Problem
LinuxXfrmBackend::rekey_saissuesXFRM_MSG_UPDSA. The upstream Linux handler routes that message toxfrm_state_update, which locates the existing SA and returns-ESRCHwhen the lookup misses. The SDK maps that authoritative miss toXfrmError::NotFound.MockXfrmBackend::rekey_sacurrently uses map insertion and returnsOk(())even when no matching SA exists. It therefore creates state on an update-only operation and can false-green rekey behavior that the Linux backend rejects.Required contract
XfrmError::NotFoundwithout inserting or altering any SA.Required tests
NotFound, then query the identity and prove that no SA was inserted.if_id; the Linux SA lookup tuple still controls whether an existing SA is present, and a miss must not create one.The regression must exercise the public
MockXfrmBackend.