X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/a5c4a56a64e127a1a5e5d436cf52df1e7a96eb33..f6994bd047a35b06aa7aed3c59487000abec2325:/server/peer.c diff --git a/server/peer.c b/server/peer.c index e9b8f668..2eb30bf5 100644 --- a/server/peer.c +++ b/server/peer.c @@ -413,9 +413,8 @@ static void p_read(int fd, unsigned mode, void *v) } break; case MSG_KEYEXCH: - if (!p) goto unexp; - p_rxupdstats(p, n); - kx_message(&p->kx, ch & MSG_TYPEMASK, &b); + if (p) p_rxupdstats(p, n); + if (kx_message(p ? &p->kx : 0, &a, ch & MSG_TYPEMASK, &b)) goto unexp; break; case MSG_MISC: switch (ch & MSG_TYPEMASK) {