[netfilter-cvslog] r3421 - trunk/nfsim/tools

rusty at netfilter.org rusty at netfilter.org
Fri Dec 17 04:19:12 CET 2004


Author: rusty at netfilter.org
Date: 2004-12-17 04:19:12 +0100 (Fri, 17 Dec 2004)
New Revision: 3421

Modified:
   trunk/nfsim/tools/gen_ip.c
Log:
Patch from acidfu:
	 So everytime you enter 'gen_err' without parameter or with non-valid
	 parameter the help of gen_ip is printed out.


Modified: trunk/nfsim/tools/gen_ip.c
===================================================================
--- trunk/nfsim/tools/gen_ip.c	2004-12-17 01:17:11 UTC (rev 3420)
+++ trunk/nfsim/tools/gen_ip.c	2004-12-17 03:19:12 UTC (rev 3421)
@@ -635,10 +635,8 @@
 	int tos = 0, mf = 0, df = 0, ttl = 255, len, datalen;
 	u_int16_t fragoff = 0, fraglen = 0;
 
-	if (argc < 5) {
-		gen_ip_help(0, NULL);
+	if (argc < 5)
 		return false;
-	}
 
 	if (argc > 5 && strncmp(argv[1], "FRAG=", 5) == 0) {
 		const char *comma = strchr(argv[1]+5, ',');
@@ -770,8 +768,10 @@
 		argv++;
 	}
 
-	if (!parse_packet(&packet, argc, argv, &dump_flags))
+	if (!parse_packet(&packet, argc, argv, &dump_flags)) {
+		gen_ip_help(0, NULL);
 		return false;
+	}
 
 	return send_packet(&packet, interface, dump_flags);
 }




More information about the netfilter-cvslog mailing list