Add names of a few more ICMPv6 messages, from RFC6275 (Mobile IPv6)

and RFC4286 (Multicast Router Discovery.) and as shown in the IANA
parameters page available at:
  https://www.ietf.org/assignments/icmpv6-parameters/icmpv6-parameters.txt

Also make the array be explicitly 256 entries long, one for each possible
code, which will detect attempts to insert names without deleting the
place holder (and mean a good solid NULL de-ref if too many place holders
are deleted, rather than just random results.)
This commit is contained in:
kre 2017-12-19 17:05:15 +00:00
parent e6140f0520
commit c56c6100f2

View File

@ -1,4 +1,4 @@
/* $NetBSD: inet6.c,v 1.69 2016/12/17 09:12:22 mlelstv Exp $ */
/* $NetBSD: inet6.c,v 1.70 2017/12/19 17:05:15 kre Exp $ */
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
@ -64,7 +64,7 @@
#if 0
static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
__RCSID("$NetBSD: inet6.c,v 1.69 2016/12/17 09:12:22 mlelstv Exp $");
__RCSID("$NetBSD: inet6.c,v 1.70 2017/12/19 17:05:15 kre Exp $");
#endif
#endif /* not lint */
@ -860,7 +860,7 @@ ip6_ifstats(const char *ifname)
#undef p_5
}
static const char *icmp6names[] = {
static const char *icmp6names[256] = {
"#0",
"unreach",
"packet too big",
@ -1004,17 +1004,17 @@ static const char *icmp6names[] = {
"node information reply",
"#141",
"#142",
"#143",
"#144",
"#145",
"#146",
"#147",
"multicast listener report (v2)",
"home agent discovery request",
"home agent discovery reply",
"mobile prefix solicitation",
"mobile prefix advertisement",
"#148",
"#149",
"#150",
"#151",
"#152",
"#153",
"multicast router advertisement",
"multicast router solicitation",
"multicast router termination",
"#154",
"#155",
"#156",