Skip to contentSkip to conversation

: warn for icmp type 255

PATCH New Patrick McHardy 1 participant 1 message Aug 4, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : warn for icmp type 255

This patch adds a warning if icmp-type 255 is given. Maybe we should fix this right in 2.6 as long as it's still possible, even if that means having some #ifdefs in the userspace code ?

Best regards,
Patrick

Index: libipt_icmp.c
===================================================================
RCS file: /cvspublic/netfilter/userspace/extensions/libipt_icmp.c,v retrieving revision 1.8

libipt_icmp.c +4 -1
diff -u -r1.8 libipt_icmp.c
@@ -77,7 +77,7 @@
 };
 
 static void
-print_icmptypes()
+print_icmptypes(void)
 {
 	unsigned int i;
 	printf("Valid ICMP Types:");
@@ -153,6 +153,9 @@
 		if (string_to_number(buffer, 0, 255, &number) == -1)
 			exit_error(PARAMETER_PROBLEM,
 				   "Invalid ICMP type `%s'\n", buffer);
+		if (number == 0xFF)
+			fprintf(stderr, "Warning: ICMP type 255 is used "
+					"internally and matches all types!\n");
 		*type = number;
 		if (slash) {
 			if (string_to_number(slash+1, 0, 255, &number) == -1)