aboutsummaryrefslogtreecommitdiff
path: root/icmp6_t.c
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2024-06-03 22:40:29 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2024-06-05 19:00:29 -0300
commit3bb75df683d55cd2fe257fb5dd37e92d694aec11 (patch)
treed0419996a92cfe52a54db6910c47c630b68ad59a /icmp6_t.c
parent04be949e08740712d7db50a9864756f5955f5dd1 (diff)
New upstream version 1.0.18
Diffstat (limited to 'icmp6_t.c')
-rw-r--r--icmp6_t.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/icmp6_t.c b/icmp6_t.c
index e0928f8..bc308b5 100644
--- a/icmp6_t.c
+++ b/icmp6_t.c
@@ -100,11 +100,14 @@ struct icmp6msg icmp6msgs[] = {
{ 256, 256, "impossible combination", "impossible combination" }
};
+struct icmp6msg icmp6error =
+ { 256, 256, "unknown", "unknown" };
+
struct icmp6msg *stricmp6(int type, int code)
{
int i;
- if(type > 255) return(&((struct icmp6msg) { 256, 256, "unknown", "unknown" }));
+ if(type > 255) return &icmp6error;
for(i = 0; icmp6msgs[i].type <= type; i++)
if(icmp6msgs[i].type == type && icmp6msgs[i].code == code) return(&(icmp6msgs[i]));
@@ -112,7 +115,7 @@ struct icmp6msg *stricmp6(int type, int code)
for(i = 0; icmp6msgs[i].type <= type; i++)
if(icmp6msgs[i].type == type) return(&(icmp6msgs[i]));
- return(&((struct icmp6msg) { 256, 256, "unknown", "unknown" }));
+ return &icmp6error;
}
/* EOF */