All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Conntrack-tool cleanup
@ 2005-11-06 21:26 Krzysztof Oledzki
  2005-11-08  2:01 ` Pablo Neira
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Oledzki @ 2005-11-06 21:26 UTC (permalink / raw)
  To: Pablo Neira; +Cc: netfilter-devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 832 bytes --]

Hello,

Attached patch fixes following warning generated by gcc -Wall:

conntrack.c: In function `get_modprobe':
conntrack.c:429: warning: implicit declaration of function `read'
conntrack.c:435: warning: implicit declaration of function `close'
conntrack.c: In function `iptables_insmod':
conntrack.c:458: warning: implicit declaration of function `fork'
conntrack.c:463: warning: implicit declaration of function `execv'
conntrack.c: In function `nat_parse':
conntrack.c:539: warning: implicit declaration of function `inet_addr'
conntrack.c: In function `main':
conntrack.c:617: warning: unused variable `o'
conntrack.c:617: warning: unused variable `r'
conntrack.c:629: warning: unused variable `manip'
conntrack.c:1062: warning: control reaches end of non-void function

Best regards,

 			Krzysztof Olędzki

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1188 bytes --]

Index: src/conntrack.c
===================================================================
--- src/conntrack.c	(revision 4488)
+++ src/conntrack.c	(working copy)
@@ -38,9 +38,12 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <errno.h>
+#include <unistd.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
 #include <fcntl.h>
 #include <dlfcn.h>
 #include <string.h>
@@ -614,7 +617,7 @@
 {
 	char c;
 	unsigned int command = 0, options = 0;
-	struct nfct_tuple orig, reply, mask, *o = NULL, *r = NULL;
+	struct nfct_tuple orig, reply, mask;
 	struct nfct_tuple exptuple;
 	struct ctproto_handler *h = NULL;
 	union nfct_protoinfo proto;
@@ -626,7 +629,6 @@
 	unsigned int mark = 0;
 	unsigned int id = NFCT_ANY_ID;
 	unsigned int type = 0, extra_flags = 0, event_mask = 0;
-	int manip = -1;
 	int res = 0;
 
 	memset(&proto, 0, sizeof(union nfct_protoinfo));
@@ -1057,6 +1059,10 @@
 		global_option_offset = 0;
 	}
 
-	if (res < 0)
+	if (res < 0) {
 		fprintf(stderr, "Operation failed: %s\n", err2str(res, command));
+		exit(OTHER_PROBLEM);
+	}
+
+	return 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-08  2:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-06 21:26 [PATCH] Conntrack-tool cleanup Krzysztof Oledzki
2005-11-08  2:01 ` Pablo Neira

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.