nbd: Permit simple error to NBD_CMD_BLOCK_STATUS
[qemu/ericb.git] / slirp / src / ip6_output.c
blobb86110662c22347735f6a1cb5d56ff1ca5948859
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright (c) 2013
4 * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
5 */
7 #include "slirp.h"
9 /* Number of packets queued before we start sending
10 * (to prevent allocing too many mbufs) */
11 #define IF6_THRESH 10
14 * IPv6 output. The packet in mbuf chain m contains a IP header
16 int ip6_output(struct socket *so, struct mbuf *m, int fast)
18 struct ip6 *ip = mtod(m, struct ip6 *);
20 DEBUG_CALL("ip6_output");
21 DEBUG_ARG("so = %p", so);
22 DEBUG_ARG("m = %p", m);
24 /* Fill IPv6 header */
25 ip->ip_v = IP6VERSION;
26 ip->ip_hl = IP6_HOP_LIMIT;
27 ip->ip_tc_hi = 0;
28 ip->ip_tc_lo = 0;
29 ip->ip_fl_hi = 0;
30 ip->ip_fl_lo = 0;
32 if (fast) {
33 if_encap(m->slirp, m);
34 } else {
35 if_output(so, m);
38 return 0;