ktls / af_ktls

Linux Kernel TLS/DTLS Module
GNU General Public License v2.0
157 stars 25 forks source link

fix double bind #85

Closed djwatson closed 8 years ago

djwatson commented 8 years ago

fix https://github.com/ktls/af_ktls/issues/44

just return einval per man 2 bind

fridex commented 8 years ago

This does not look correct to me. The callback is not restored and what about already decrypted part?

djwatson commented 8 years ago

Correct, this returns an error for the second bind request, and continues to use the first bound fd, so the callback doesn't need to be restored, and the currently decrypted part is still used.

The man page and other kernel sockets look like they just disallow binding twice, and don't try to rebind.

fridex commented 8 years ago

Correct, this returns an error for the second bind request, and continues to use the first bound fd

I believe sockfd_put() shouldn't be called and tsk->socket shouldn't be set to NULL in that case.