Currently, the receive path schedules the transmission of a keepalive for any packet that successfully decrypts, including keepalives sent by the peer. This means that keepalives will keep ping-ponging for the entire duration of the session, until the check for expired sessions in send_keepalive declines to rotate the session if there's no other traffic.
Instead, only schedule a keepalive transmission if a non-keepalive packet was received.
Currently, the receive path schedules the transmission of a keepalive for any packet that successfully decrypts, including keepalives sent by the peer. This means that keepalives will keep ping-ponging for the entire duration of the session, until the check for expired sessions in send_keepalive declines to rotate the session if there's no other traffic.
Instead, only schedule a keepalive transmission if a non-keepalive packet was received.