sad: introduce sad_set_last_seqid() and sad_check_seqid()
The standard specifies that the header sequence id should be checked to
confirm the message has not been replayed. It specifies a seqid check
for each message that has it's own sequence id pool but this is most
relevant for sync/followup messages for which slaves do not confirm
seqid currently.
The standard also mentioned a seqid window. The seqid window specifies
how far the seqid can advance from the last know seqid before it is
considered a replay attack from before a seqid rollover.
This patch introduces sad_check_seqid() in sad.c to check the seqid and
sad_set_last_seqid() which is updates the last seqid upon successful
sync in port_synchronize() and reset upon state transition in
port_e2e_transition() and port_p2p_transition.
Signed-off-by: Clay Kaiser <Clay.Kaiser@ibm.com>
Reviewed-by: Erez Geva <ErezGeva2@gmail.com>
Reviewed-by: Miroslav Lichvar <mlichvar@redhat.com>
3 files changed