}
if (!err) {
T( trace(T_PEER, "peer: updating address for `%s'", p_name(p)); )
- p_rxupdstats(p, n);
pa = am_find(&byaddr, a, sizeof(peer_byaddr), &f); assert(!f);
am_remove(&byaddr, p->byaddr);
p->byaddr = pa;
a_notify("NEWADDR", "?PEER", p, "?ADDR", a, A_END);
}
}
+ p_rxupdstats(p, n);
if (err) {
if (p) p->st.n_reject++;
a_warn("PEER", "?PEER", p, "decrypt-failed",
/* --- Pick the packet apart --- */
- if (p) p_rxupdstats(p, n);
buf_init(&b, buf_i, n);
if ((ch = buf_getbyte(&b)) < 0) {
a_warn("PEER", "?PEER", p, "bad-packet", "no-type", A_END);
break;
case MSG_KEYEXCH:
if (!p) goto unexp;
+ p_rxupdstats(p, n);
kx_message(&p->kx, ch & MSG_TYPEMASK, &b);
break;
case MSG_MISC:
switch (ch & MSG_TYPEMASK) {
case MISC_NOP:
if (!p) goto unexp;
+ p_rxupdstats(p, n);
T( trace(T_PEER, "peer: received NOP packet"); )
break;
case MISC_PING:
if (!p) goto unexp;
+ p_rxupdstats(p, n);
buf_put(p_txstart(p, MSG_MISC | MISC_PONG), BCUR(&b), BLEFT(&b));
p_txend(p);
break;
case MISC_PONG:
if (!p) goto unexp;
+ p_rxupdstats(p, n);
p_ponged(p, MISC_PONG, &b);
break;
case MISC_EPING: