1 /* SPDX-License-Identifier: BSD-3-Clause */
4 * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
11 * IP initialization: fill in IP protocol switch table.
12 * All protocols not implemented in kernel go to raw IP protocol handler.
14 void ip6_init(Slirp
*slirp
)
19 void ip6_cleanup(Slirp
*slirp
)
24 void ip6_input(struct mbuf
*m
)
27 Slirp
*slirp
= m
->slirp
;
29 if (!slirp
->in6_enabled
) {
33 DEBUG_CALL("ip6_input");
34 DEBUG_ARG("m = %p", m
);
35 DEBUG_ARG("m_len = %d", m
->m_len
);
37 if (m
->m_len
< sizeof(struct ip6
)) {
41 ip6
= mtod(m
, struct ip6
*);
43 if (ip6
->ip_v
!= IP6VERSION
) {
47 if (ntohs(ip6
->ip_pl
) > IF_MTU
) {
48 icmp6_send_error(m
, ICMP6_TOOBIG
, 0);
52 /* check ip_ttl for a correct ICMP reply */
53 if (ip6
->ip_hl
== 0) {
54 icmp6_send_error(m
, ICMP6_TIMXCEED
, ICMP6_TIMXCEED_INTRANS
);
59 * Switch out to protocol's input routine.
64 tcp_input(m
, sizeof(struct ip6
), (struct socket
*)NULL
, AF_INET6
);