FST: Fix handling of Rx FST Setup Request when session already exists
authorDedy Lansky <qca_dlansky@qca.qualcomm.com>
Tue, 29 Dec 2015 07:24:51 +0000 (09:24 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 29 Dec 2015 16:41:35 +0000 (18:41 +0200)
commit071e3bf1164c7eb261375f03f3665c548c1d58aa
treebde93a57a21f8a9056e4cc00b33fb0791fceed40
parent324ade51e168f28430f4429849becd0f08d507c0
FST: Fix handling of Rx FST Setup Request when session already exists

When we receive FST Setup Request when session already exists, the
following validations take place:
1. we drop the frame if needed according to MAC comparison
2. we drop the frame if the session is "not pending", i.e., if FST
   Setup Response was already exchanged (sent or received).

There are two issues with the above:
1. MAC comparison is relevant only before the Setup Response exchange.
   In other words, Setup Request should not be dropped due to MAC
   comparison after Setup Response has been exchanged.
2. Receiving Setup Request after Setup Response exchange most likely
   means that FST state machine is out of sync with the peer. Dropping
   the Setup Request will not help solve this situation.

The fix is:
1. do MAC comparison only if session is "pending", i.e., Setup Response
   was not yet exchanged.
2. In case Setup Response was already exchanged, reset our session and
   handle the Setup Request as if it arrived when session doesn't exist.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/fst/fst_session.c