All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/7] Kill bogus memsets
@ 2005-08-01 17:04 Pablo Neira
  2005-08-01 20:20 ` Harald Welte
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira @ 2005-08-01 17:04 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Harald Welte

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]

nfattr_parse_attributes already set to zero the array of nfattr, so such 
initialization isn't required.

[-- Attachment #2: 01kill-memset.patch --]
[-- Type: text/x-patch, Size: 1558 bytes --]

Index: netfilter-2.6.14/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
--- netfilter-2.6.14.orig/net/ipv4/netfilter/ip_conntrack_netlink.c	2005-08-01 16:20:26.000000000 +0200
+++ netfilter-2.6.14/net/ipv4/netfilter/ip_conntrack_netlink.c	2005-08-01 16:25:00.000000000 +0200
@@ -479,7 +479,6 @@
 
 	DEBUGP("entered %s\n", __FUNCTION__);
 
-	memset(tb, 0, CTA_IP_MAX * sizeof(tb));
 	
 	if (nfattr_parse_nested(tb, CTA_IP_MAX, attr) < 0)
 		goto nfattr_failure;
@@ -522,8 +521,6 @@
 
 	DEBUGP("entered %s\n", __FUNCTION__);
 
-	memset(tb, 0, CTA_PROTO_MAX * sizeof(tb));
-	
 	if (nfattr_parse_nested(tb, CTA_PROTO_MAX, attr) < 0)
 		goto nfattr_failure;
 
@@ -556,7 +553,6 @@
 
 	DEBUGP("entered %s\n", __FUNCTION__);
 
-	memset(tb, 0, CTA_TUPLE_MAX * sizeof(tb));
 	memset(tuple, 0, sizeof(*tuple));
 
 	if (nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]) < 0)
@@ -607,8 +603,6 @@
 
 	DEBUGP("entered %s\n", __FUNCTION__);
 
-	memset(tb, 0, CTA_PROTONAT_MAX * sizeof(tb));
-
 	if (nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr) < 0)
 		goto nfattr_failure;
 
@@ -646,7 +640,6 @@
 
 	DEBUGP("entered %s\n", __FUNCTION__);
 
-	memset(tb, 0, CTA_NAT_MAX * sizeof(tb));
 	memset(range, 0, sizeof(*range));
 	
 	if (nfattr_parse_nested(tb, CTA_NAT_MAX, cda[CTA_NAT-1]) < 0)
@@ -684,7 +677,6 @@
 	struct nfattr *tb[CTA_HELP_MAX];
 
 	DEBUGP("entered %s\n", __FUNCTION__);
-	memset(tb, 0, CTA_HELP_MAX * sizeof(tb));
 
 	if (nfattr_parse_nested(tb, CTA_HELP_MAX, attr) < 0)
 		goto nfattr_failure;

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-01 17:04 [PATCH 2/7] Kill bogus memsets Pablo Neira
2005-08-01 20:20 ` Harald Welte

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.