cozybit / authsae

Simultaneous Authentication of Equals: Unofficial official clone of the now stale http://sourceforge.net/projects/authsae
31 stars 28 forks source link

Send PLINK_CLOSE frame on removal of a peer #93

Closed ilyacodes closed 5 years ago

ilyacodes commented 5 years ago

We currently do not send an AMPE PLINK_CLOSE frame when a CMD_DEL_STATION event is given to us by the kernel. This results in the other end of our link potentially staying in ESTAB even though we have no intent to talk to it again.

Note: until version 4.8, the kernel would send these frames automatically in all cases. Starting with 4.8, it no longer sends them if userspace mesh peering has been requested.

Test results before:

ilyacodes@ilyacodes-virtual-machine:~/authsae$ tests/test006.sh 
.
Did not de-ESTAB after peer deletion
ilyacodes@ilyacodes-virtual-machine:~/authsae$ iw smesh0 station dump | grep "Station\|mesh plink:"
Station 02:00:00:00:01:00 (on smesh0)
    mesh plink: LISTEN
ilyacodes@ilyacodes-virtual-machine:~/authsae$ iw smesh1 station dump | grep "Station\|mesh plink:"
Station 02:00:00:00:00:00 (on smesh1)
    mesh plink: ESTAB

Test results after:

ilyacodes@ilyacodes-virtual-machine:~/authsae$ tests/test006.sh 
.
PASS
ilyacodes@ilyacodes-virtual-machine:~/authsae$ iw smesh0 station dump | grep "Station\|mesh plink:"
ilyacodes@ilyacodes-virtual-machine:~/authsae$ iw smesh1 station dump | grep "Station\|mesh plink:"
jcard0na commented 5 years ago

It seems like it should be possible to write a test case for this that confirms that this works on kernels >=4.8. Do you think you could add a test case under https://github.com/cozybit/authsae/tree/master/tests?

jcard0na commented 5 years ago

Excellent, thanks!