Fix multiple setting in DTLS
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 3 Aug 2016 23:14:30 +0000 (16:14 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 4 Aug 2016 21:09:53 +0000 (14:09 -0700)
commit9475e8e9bf6e27ae44f1ab36790f5d524fdd8f32
tree9af3a4229d58e9fa4277f699259e92c03cc149f1
parent9903fc8083378cb0c827bebb5f4dbabf26e9d403
Fix multiple setting in DTLS

The bug was that __get_dtls was returning a v->dtls, not a v.  Thus if
we set twice, we'd dereference the *value*, instead of v.  In essence,
we'd set v->dtls->dtls = dtls.  That's a wild write.

Incidentally, our DTLS handles set/get calls from within the destructor
without resorting to infinite loops, PTHREAD_DESTRUCTOR_ITERATIONS (4)
retries, or other nasty shit.  Nicely done, Kevin.  =)

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/dtls.c
user/utest/dtls.c [new file with mode: 0644]