/* String equality tests */
#define STREQ(a,b) (strcmp(a,b) == 0)
#define STRNEQ(a,b,n) (strncmp(a,b,n) == 0)
+#define STRCASEQ(a,b) (strcasecmp(a,b) == 0)
+#define STRNCASEQ(a,b,n) (strncasecmp(a,b,n) == 0)
/* Stringify tokens */
#define _STR(c) #c
unsigned int i;
for (i = 0; i < ARRAY_SIZE(icmp_typecodes); i++)
- if (STRNEQ(icmp_typecodes[i].name, str, strlen(str))) {
+ if (STRNCASEQ(icmp_typecodes[i].name, str, strlen(str))) {
*typecode = (icmp_typecodes[i].type << 8) | icmp_typecodes[i].code;
return 0;
}
unsigned int i;
for (i = 0; i < ARRAY_SIZE(icmpv6_typecodes); i++)
- if (STRNEQ(icmpv6_typecodes[i].name, str, strlen(str))) {
+ if (STRNCASEQ(icmpv6_typecodes[i].name, str, strlen(str))) {
*typecode = (icmpv6_typecodes[i].type << 8) | icmpv6_typecodes[i].code;
return 0;
}