Lines Matching refs:icmp6

29 /*	$FreeBSD: src/sys/netinet6/icmp6.c,v 1.6.2.6 2001/07/10 09:44:16 ume Exp $	*/
30 /* $KAME: icmp6.c,v 1.211 2001/04/04 05:56:20 itojun Exp $ */
121 #include <netinet/icmp6.h>
290 struct icmp6_hdr *icmp6;
325 * - the Parameter Problem Message that can be allowed an icmp6 error
369 * informational) we must not send icmp6 error.
411 icmp6 = (struct icmp6_hdr *)(nip6 + 1);
412 icmp6->icmp6_type = type;
413 icmp6->icmp6_code = code;
414 icmp6->icmp6_pptr = htonl((u_int32_t)param);
447 struct icmp6_hdr *icmp6, *nicmp6;
463 * Locate icmp6 structure in mbuf, and check
473 icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
475 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6));
476 if (icmp6 == NULL) {
481 code = icmp6->icmp6_code;
484 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
522 icmp6->icmp6_type, sum, ip6_sprintf(&ip6->ip6_src)));
535 switch (icmp6->icmp6_type) {
544 icmp6stat.icp6s_inhist[icmp6->icmp6_type]++;
546 if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK)
549 switch (icmp6->icmp6_type) {
665 bcopy(icmp6, nicmp6, sizeof(struct icmp6_hdr));
708 if (icmp6->icmp6_type == MLD_LISTENER_QUERY) /* XXX: ugly... */
871 icmp6->icmp6_type, ip6_sprintf(&ip6->ip6_src),
874 if (icmp6->icmp6_type < ICMP6_ECHO_REQUEST) {
916 struct icmp6_hdr *icmp6;
929 icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off);
931 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
932 sizeof(*icmp6) + sizeof(struct ip6_hdr));
933 if (icmp6 == NULL) {
938 eip6 = (struct ip6_hdr *)(icmp6 + 1);
948 int icmp6type = icmp6->icmp6_type;
1079 icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off);
1081 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
1082 sizeof(*icmp6) + sizeof(struct ip6_hdr));
1083 if (icmp6 == NULL) {
1097 eip6 = (struct ip6_hdr *)(icmp6 + 1);
1120 ip6cp.ip6c_icmp6 = icmp6;
1121 ip6cp.ip6c_ip6 = (struct ip6_hdr *)(icmp6 + 1);
1128 notifymtu = ntohl(icmp6->icmp6_mtu);
1153 struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6;
1155 u_int mtu = ntohl(icmp6->icmp6_mtu);
2020 struct icmp6_hdr *icmp6;
2027 icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
2029 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6));
2030 if (icmp6 == NULL) {
2061 && ICMP6_FILTER_WILLBLOCK(icmp6->icmp6_type,
2127 * OFF points to the icmp6 header, counted from the top of the mbuf.
2136 struct icmp6_hdr *icmp6;
2190 icmp6 = (struct icmp6_hdr *)(ip6 + 1);
2191 type = icmp6->icmp6_type; /* keep type for statistics */
2192 code = icmp6->icmp6_code; /* ditto. */
2290 if (icmp6->icmp6_type == ICMP6_ECHO_REPLY && icmp6->icmp6_code == 0) {
2313 icmp6->icmp6_cksum = 0;
2314 icmp6->icmp6_cksum = in6_cksum(m, IPPROTO_ICMPV6,
2382 * don't update route by icmp6 redirect.
2422 /* ip6->ip6_src must be equal to gw for icmp6->icmp6_reddst */
2513 "(if %d, icmp6 packet %d): %s\n",
2596 * router on this interface, don't send icmp6 redirect.
2773 * compute the maximum size for icmp6 redirect header option.
3024 struct icmp6_hdr *icmp6;
3069 icmp6 = mtod(m, struct icmp6_hdr *);
3075 if ((icmp6->icmp6_type == ICMP6_ECHO_REQUEST &&
3076 icmp6->icmp6_code == 0) ||
3077 (icmp6->icmp6_type == ICMP6_NI_QUERY &&
3078 (icmp6->icmp6_code == ICMP6_NI_SUBJ_IPV6 ||
3079 icmp6->icmp6_code == ICMP6_NI_SUBJ_FQDN))) {
3142 * Returns 0 if it is okay to send the icmp6 packet.
3143 * Returns 1 if the router SHOULD NOT send this icmp6 packet due to rate