mka: Fix multiple key server election bugs
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 19 Jul 2016 09:56:51 +0000 (11:56 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 7 Aug 2016 08:31:17 +0000 (11:31 +0300)
commit099613e4150471923689242609b7a92e78227b52
tree585e0a79a576ef0ea2ab5cb69d948a8bd8e04bce
parenta1979469fd13dd39201362fa953fcb3087d7a17b
mka: Fix multiple key server election bugs

1. The comparison between SCI's of two servers with identical priority
   is broken, and would always return TRUE. Just use os_memcmp(), which
   provides the ordering we need.

2. If no peer can be key server but this instance can, then become the
   key server.

3. The ordering of blocks between peer as key server and ourself as key
   server overwrites settings. Simple reordering fixes this.

4. Default to being the key server, so that we advertise our ability in
   the MKPDUs we send. That's the only way peers can know we can be key
   server. Cleared automatically as soon as we find a better peer.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
src/pae/ieee802_1x_kay.c