1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright (c) 2013
4 * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
5 */
6
7#include "slirp.h"
8
9/* Number of packets queued before we start sending
10 * (to prevent allocing too many mbufs) */
11#define IF6_THRESH 10
12
13/*
14 * IPv6 output. The packet in mbuf chain m contains a IP header
15 */
16int ip6_output(struct socket *so, struct mbuf *m, int fast)
17{
18 struct ip6 *ip = mtod(m, struct ip6 *);
19
20 DEBUG_CALL("ip6_output");
21 DEBUG_ARG("so = %p", so);
22 DEBUG_ARG("m = %p", m);
23
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;
31
32 if (fast) {
33 if_encap(m->slirp, m);
34 } else {
35 if_output(so, m);
36 }
37
38 return 0;
39}
40