Skip to contentSkip to conversation

remove bogus memset() calls from ip_conntrack_netlink.c

PATCH Applied Harald Welte 1 participant 1 message Aug 2, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 remove bogus memset() calls from ip_conntrack_netlink.c

[NETFILTER] remove bogus memset() calls from ip_conntrack_netlink.c

nfattr_parse_nested() calls nfattr_parse() which in turn does a memset on the 'tb' array. All callers therefore don't need to memset before calling it.

---
commit c4e2485887523a16e9c37a21a1d95ac10633ef0a
tree a86946c1fa855ed8a76be2efe4fef3c8a5a1c7a6
parent 883b2070f68548537042038d9868c829fc20d463
author Harald Welte <[email protected]> Mo, 01 Aug 2005 22:21:59 +0200 committer Harald Welte <[email protected]> Mo, 01 Aug 2005 22:21:59 +0200

 net/ipv4/netfilter/ip_conntrack_netlink.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
net/ipv4/netfilter/ip_conntrack_netlink.c +0 -8
@@ -479,7 +479,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *
 
 	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 @@ ctnetlink_parse_tuple_proto(struct nfatt
 
 	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 @@ ctnetlink_parse_tuple(struct nfattr *cda
 
 	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 @@ static int ctnetlink_parse_nat_proto(str
 
 	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 @@ ctnetlink_parse_nat(struct nfattr *cda[]
 
 	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 @@ ctnetlink_parse_help(struct nfattr *attr
 	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;
Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie