int rv;
if (cmdlen > HV_MESSAGE_PAYLOAD) {
- printf("%s: payload too large (%ld)\n", sc->sc_dev.dv_xname,
+ printf("%s: payload too large (%lu)\n", sc->sc_dev.dv_xname,
cmdlen);
return (EMSGSIZE);
}
continue;
ch = hv_channel_lookup(sc, relid);
if (ch == NULL) {
- printf("%s: unhandled event on %u\n",
+ printf("%s: unhandled event on %d\n",
sc->sc_dev.dv_xname, relid);
continue;
}
if (ch->ch_state != HV_CHANSTATE_OPENED) {
- printf("%s: channel %u is not active\n",
+ printf("%s: channel %d is not active\n",
sc->sc_dev.dv_xname, relid);
continue;
}
hdr = (struct hv_channel_msg_header *)msg->payload;
if (hdr->message_type >= HV_CHANMSG_COUNT) {
- printf("%s: unhandled message type %d flags %#x\n",
+ printf("%s: unhandled message type %u flags %#x\n",
sc->sc_dev.dv_xname, hdr->message_type,
msg->header.message_flags);
goto skip;
if (hv_msg_dispatch[hdr->message_type].hmd_handler)
hv_msg_dispatch[hdr->message_type].hmd_handler(sc, hdr);
else
- printf("%s: unhandled message type %d\n",
+ printf("%s: unhandled message type %u\n",
sc->sc_dev.dv_xname, hdr->message_type);
skip:
msg->header.message_type = HV_MESSAGE_TYPE_NONE;
-/* $OpenBSD: if_xnf.c,v 1.22 2016/04/19 18:15:41 mikeb Exp $ */
+/* $OpenBSD: if_xnf.c,v 1.23 2016/07/28 12:08:14 mikeb Exp $ */
/*
* Copyright (c) 2015, 2016 Mike Belopuhov
struct xnf_softc *sc = ifp->if_softc;
struct xnf_tx_ring *txr = sc->sc_tx_ring;
struct mbuf *m;
- int error, pkts = 0;
+ int pkts = 0;
uint32_t prod;
if (!(ifp->if_flags & IFF_RUNNING) || ifq_is_oactive(&ifp->if_snd))
prod = txr->txr_prod;
for (;;) {
- m = ifq_deq_begin(&ifp->if_snd);
- if (m == NULL)
- break;
-
- error = xnf_encap(sc, m, &prod);
- if (error == ENOENT) {
+ if ((XNF_TX_DESC - (prod - sc->sc_tx_cons)) <
+ sc->sc_tx_frags) {
/* transient */
- ifq_deq_rollback(&ifp->if_snd, m);
ifq_set_oactive(&ifp->if_snd);
break;
- } else if (error) {
+ }
+ m = ifq_dequeue(&ifp->if_snd);
+ if (m == NULL)
+ break;
+
+ if (xnf_encap(sc, m, &prod)) {
/* the chain is too large */
ifp->if_oerrors++;
- ifq_deq_commit(&ifp->if_snd, m);
m_freem(m);
continue;
}
ifp->if_opackets++;
- ifq_deq_commit(&ifp->if_snd, m);
#if NBPFILTER > 0
if (ifp->if_bpf)
uint32_t oprod = *prod;
int i, id, flags, n = 0;
- if ((XNF_TX_DESC - (*prod - sc->sc_tx_cons)) < sc->sc_tx_frags)
- return (ENOENT);
n = chainlen(m_head);
if (n > sc->sc_tx_frags && m_defrag(m_head, M_DONTWAIT))
goto errout;
-/* $OpenBSD: kern_pledge.c,v 1.178 2016/07/12 06:06:34 deraadt Exp $ */
+/* $OpenBSD: kern_pledge.c,v 1.179 2016/07/28 12:08:14 mikeb Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
{ "rpath", PLEDGE_RPATH },
{ "sendfd", PLEDGE_SENDFD },
{ "settime", PLEDGE_SETTIME },
- { "stdio", PLEDGE_STDIO },
+ { "stdio", PLEDGE_STDIO|PLEDGE_RECVFD },
{ "tmppath", PLEDGE_TMPPATH },
{ "tty", PLEDGE_TTY },
{ "unix", PLEDGE_UNIX },