These packets are expected to go missing periodically and everyone will
cope. Unfortunately, GCC wants us to do something with the return code
from write(2), so we explicitly assign it to a write-only variable and
hope that its data-flow analysis is done after it checks for return-code
ignoring.
{
pkstream *p = vp;
size_t pksz;
{
pkstream *p = vp;
size_t pksz;
}
pksz = LOAD16(b);
if (pksz + 2 == sz) {
}
pksz = LOAD16(b);
if (pksz + 2 == sz) {
- write(fd_udp, b + 2, pksz);
+ hunoz = write(fd_udp, b + 2, pksz);
selpk_want(&p->p, 2);
} else {
selpk_want(&p->p, pksz + 2);
selpk_want(&p->p, 2);
} else {
selpk_want(&p->p, pksz + 2);
static void dosend(filter *f, const octet *buf, size_t sz)
{
static void dosend(filter *f, const octet *buf, size_t sz)
{
printf("send to `%s'\n", f->p_to->name);
printf("send to `%s'\n", f->p_to->name);
- write(f->p_to->sf.fd, buf, sz);
+ hunoz = write(f->p_to->sf.fd, buf, sz);
}
static void addsend(filter *f, unsigned ac, char **av)
}
static void addsend(filter *f, unsigned ac, char **av)
static void t_inject(tunnel *t, buf *b)
{
static void t_inject(tunnel *t, buf *b)
{
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-bsd: inject decrypted packet");
trace_block(T_PACKET, "tun-bsd: packet contents", BBASE(b), BLEN(b));
})
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-bsd: inject decrypted packet");
trace_block(T_PACKET, "tun-bsd: packet contents", BBASE(b), BLEN(b));
})
- write(t->f.fd, BBASE(b), BLEN(b));
+ hunoz = write(t->f.fd, BBASE(b), BLEN(b));
}
/* --- @t_destroy@ --- *
}
/* --- @t_destroy@ --- *
static void t_inject(tunnel *t, buf *b)
{
static void t_inject(tunnel *t, buf *b)
{
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-linux: inject decrypted packet");
trace_block(T_PACKET, "tunnel: packet contents", BBASE(b), BLEN(b));
})
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-linux: inject decrypted packet");
trace_block(T_PACKET, "tunnel: packet contents", BBASE(b), BLEN(b));
})
- write(t->f.fd, BBASE(b), BLEN(b));
+ hunoz = write(t->f.fd, BBASE(b), BLEN(b));
}
/* --- @t_destroy@ --- *
}
/* --- @t_destroy@ --- *
static void t_inject(tunnel *t, buf *b)
{
static void t_inject(tunnel *t, buf *b)
{
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-unet: inject decrypted packet");
trace_block(T_PACKET, "tun-unet: packet contents", BBASE(b), BLEN(b));
})
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-unet: inject decrypted packet");
trace_block(T_PACKET, "tun-unet: packet contents", BBASE(b), BLEN(b));
})
- write(t->f.fd, BBASE(b), BLEN(b));
+ hunoz = write(t->f.fd, BBASE(b), BLEN(b));
}
/* --- @t_destroy@ --- *
}
/* --- @t_destroy@ --- *