if (!p) goto unexp;
p_rxupdstats(p, n);
buf_put(p_txstart(p, MSG_MISC | MISC_PONG), BCUR(&b), BLEFT(&b));
- p_txend(p);
+ p_txend(p, 0);
break;
case MISC_PONG:
if (!p) goto unexp;
buf_flip(&bb);
p_encrypt(p, MSG_MISC | MISC_EPONG, &bb,
p_txstart(p, MSG_MISC | MISC_EPONG));
- p_txend(p);
+ p_txend(p, 0);
}
break;
case MISC_EPONG:
/* --- @p_txend@ --- *
*
* Arguments: @peer *p@ = pointer to peer block
+ * @unsigned f@ = flags
*
* Returns: ---
*
}
}
-void p_txend(peer *p)
+void p_txend(peer *p, unsigned f)
{
if (p_dotxend(p) && p->spec.t_ka) {
sel_rmtimer(&p->tka);
pg->msg = MISC_PONG;
b = p_txstart(p, MSG_MISC | MISC_PING);
p_pingwrite(pg, b);
- p_txend(p);
+ p_txend(p, 0);
break;
case MISC_EPING:
pg->msg = MISC_EPONG;
p_encrypt(p, MSG_MISC | MISC_EPING, &bb, b);
if (!BOK(b))
return (-1);
- p_txend(p);
+ p_txend(p, 0);
break;
default:
abort();
{
buf *b = p_txstart(p, MSG_MISC | MISC_GREET);
buf_put(b, c, sz);
- p_txend(p);
+ p_txend(p, 0);
}
/* --- @p_tun@ --- *
if (BOK(bb) && BLEN(bb)) {
p->st.n_ipout++;
p->st.sz_ipout += BLEN(bb);
- p_txend(p);
+ p_txend(p, 0);
}
}
buf_init(&bb, buf_t, sizeof(buf_t));
assert(BOK(&bb)); buf_flip(&bb);
p_encrypt(p, MSG_MISC | MISC_BYE, &bb, b);
- p_txend(p);
+ p_txend(p, 0);
}
a_notify("KILL", "%s", p->spec.name, A_END);