Home | History | Annotate | Download | only in netinet6

Lines Matching defs:icmp6

1 /*	$NetBSD: icmp6.c,v 1.258 2024/07/05 04:31:54 rin Exp $	*/
2 /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
65 __KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.258 2024/07/05 04:31:54 rin Exp $");
99 #include <netinet/icmp6.h>
228 icmp6_wqinput = wqinput_create("icmp6", _icmp6_input);
355 struct icmp6_hdr *icmp6;
382 * - the Parameter Problem Message that can be allowed an icmp6 error
421 * informational) we must not send icmp6 error.
441 * OK, ICMP6 can be generated.
463 icmp6 = (struct icmp6_hdr *)(nip6 + 1);
464 icmp6->icmp6_type = type;
465 icmp6->icmp6_code = code;
466 icmp6->icmp6_pptr = htonl((u_int32_t)param);
486 * If we can't tell whether or not we can generate ICMP6, free it.
492 * Process a received ICMP6 message.
499 struct icmp6_hdr *icmp6, *nicmp6;
515 * Locate icmp6 structure in mbuf, and check
535 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6));
536 if (icmp6 == NULL) {
546 if (ACCESSIBLE_POINTER(icmp6, struct ip6_hdr) == 0) {
554 icmp6 = (struct icmp6_hdr *)(mtod(m, char *) + off);
556 KASSERT(ACCESSIBLE_POINTER(icmp6, struct ip6_hdr));
562 nd6log(LOG_ERR, "ICMP6 checksum error(%d|%x) %s\n",
563 icmp6->icmp6_type, sum, IN6_PRINT(ip6buf, &ip6->ip6_src));
572 * Deliver very specific ICMP6 type only.
576 switch (icmp6->icmp6_type) {
587 code = icmp6->icmp6_code;
588 ICMP6_STATINC(ICMP6_STAT_INHIST + icmp6->icmp6_type);
590 switch (icmp6->icmp6_type) {
718 if (icmp6->icmp6_type == MLD_LISTENER_QUERY) /* XXX: ugly... */
798 memcpy(nicmp6, icmp6, sizeof(struct icmp6_hdr));
830 if (icmp6->icmp6_type == ND_ROUTER_ADVERT)
834 if ((icmp6->icmp6_type == ND_ROUTER_SOLICIT &&
836 (icmp6->icmp6_type == ND_ROUTER_ADVERT &&
841 nd6_rtr_cache(m, off, icmp6len, icmp6->icmp6_type);
845 nd6_rtr_cache(n, off, icmp6len, icmp6->icmp6_type);
908 icmp6->icmp6_type,
912 if (icmp6->icmp6_type < ICMP6_ECHO_REQUEST) {
961 struct icmp6_hdr *icmp6;
970 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
971 sizeof(*icmp6) + sizeof(struct ip6_hdr));
972 if (icmp6 == NULL) {
976 eip6 = (struct ip6_hdr *)(icmp6 + 1);
986 int icmp6type = icmp6->icmp6_type;
1056 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
1057 sizeof(*icmp6) + sizeof(struct ip6_hdr));
1058 if (icmp6 == NULL) {
1071 eip6 = (struct ip6_hdr *)(icmp6 + 1);
1095 ip6cp.ip6c_icmp6 = icmp6;
1096 ip6cp.ip6c_ip6 = (struct ip6_hdr *)(icmp6 + 1);
1103 notifymtu = ntohl(icmp6->icmp6_mtu);
1125 struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6;
1127 u_int mtu = ntohl(icmp6->icmp6_mtu);
1416 * XXX: We must return a reply with the ICMP6 code
1946 struct icmp6_hdr *icmp6;
1949 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6));
1950 if (icmp6 == NULL) {
1977 ICMP6_FILTER_WILLBLOCK(icmp6->icmp6_type,
2039 * OFF points to the icmp6 header, counted from the top of the mbuf.
2054 struct icmp6_hdr *icmp6;
2104 icmp6 = (struct icmp6_hdr *)(ip6 + 1);
2105 type = icmp6->icmp6_type; /* keep type for statistics */
2106 code = icmp6->icmp6_code; /* ditto. */
2198 icmp6->icmp6_cksum = 0;
2199 icmp6->icmp6_cksum = in6_cksum(m, IPPROTO_ICMPV6,
2213 * since the length of ICMP6 errors is limited to the minimum MTU.
2266 /* XXX if we are router, we don't update route by icmp6 redirect */
2289 "ICMP6 redirect sent from %s rejected; "
2295 "ICMP6 redirect sent from %s rejected; "
2302 /* ip6->ip6_src must be equal to gw for icmp6->icmp6_reddst */
2312 "ICMP6 redirect rejected; no route "
2323 "ICMP6 redirect rejected; "
2332 nd6log(LOG_ERR, "ICMP6 redirect rejected; "
2343 nd6log(LOG_ERR, "ICMP6 redirect rejected; "
2356 nd6log(LOG_ERR, "ICMP6 redirect rejected; "
2381 "(if %d, icmp6 packet %d): %s\n",
2485 /* if we are not router, we don't send icmp6 redirect */
2649 * compute the maximum size for icmp6 redirect header option.
2791 * Returns 0 if it is okay to send the icmp6 packet.
2792 * Returns 1 if the router SHOULD NOT send this icmp6 packet due to rate
2950 CTLTYPE_NODE, "icmp6",