aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira <pablo@eurodev.net>2005-08-09 23:02:36 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:39:00 -0400
commit94cd2b67641e7ddc2e6ed71d76e00116957423db (patch)
tree4741237af1e0106a8b164f89c02f158247f1ebc1
parenta86888b925299330053d20e0eba03ac4d2648c4b (diff)
[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. Signed-off-by: Pablo Neira <pablo@eurodev.net> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/netfilter/ip_conntrack_netlink.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c
index f43ec18c916..36a046f2210 100644
--- a/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ b/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -479,7 +479,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct ip_conntrack_tuple *tuple)
479 479
480 DEBUGP("entered %s\n", __FUNCTION__); 480 DEBUGP("entered %s\n", __FUNCTION__);
481 481
482 memset(tb, 0, CTA_IP_MAX * sizeof(tb));
483 482
484 if (nfattr_parse_nested(tb, CTA_IP_MAX, attr) < 0) 483 if (nfattr_parse_nested(tb, CTA_IP_MAX, attr) < 0)
485 goto nfattr_failure; 484 goto nfattr_failure;
@@ -522,8 +521,6 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr,
522 521
523 DEBUGP("entered %s\n", __FUNCTION__); 522 DEBUGP("entered %s\n", __FUNCTION__);
524 523
525 memset(tb, 0, CTA_PROTO_MAX * sizeof(tb));
526
527 if (nfattr_parse_nested(tb, CTA_PROTO_MAX, attr) < 0) 524 if (nfattr_parse_nested(tb, CTA_PROTO_MAX, attr) < 0)
528 goto nfattr_failure; 525 goto nfattr_failure;
529 526
@@ -556,7 +553,6 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct ip_conntrack_tuple *tuple,
556 553
557 DEBUGP("entered %s\n", __FUNCTION__); 554 DEBUGP("entered %s\n", __FUNCTION__);
558 555
559 memset(tb, 0, CTA_TUPLE_MAX * sizeof(tb));
560 memset(tuple, 0, sizeof(*tuple)); 556 memset(tuple, 0, sizeof(*tuple));
561 557
562 if (nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]) < 0) 558 if (nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]) < 0)
@@ -607,8 +603,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
607 603
608 DEBUGP("entered %s\n", __FUNCTION__); 604 DEBUGP("entered %s\n", __FUNCTION__);
609 605
610 memset(tb, 0, CTA_PROTONAT_MAX * sizeof(tb));
611
612 if (nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr) < 0) 606 if (nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr) < 0)
613 goto nfattr_failure; 607 goto nfattr_failure;
614 608
@@ -646,7 +640,6 @@ ctnetlink_parse_nat(struct nfattr *cda[],
646 640
647 DEBUGP("entered %s\n", __FUNCTION__); 641 DEBUGP("entered %s\n", __FUNCTION__);
648 642
649 memset(tb, 0, CTA_NAT_MAX * sizeof(tb));
650 memset(range, 0, sizeof(*range)); 643 memset(range, 0, sizeof(*range));
651 644
652 if (nfattr_parse_nested(tb, CTA_NAT_MAX, cda[CTA_NAT-1]) < 0) 645 if (nfattr_parse_nested(tb, CTA_NAT_MAX, cda[CTA_NAT-1]) < 0)
@@ -684,7 +677,6 @@ ctnetlink_parse_help(struct nfattr *attr, char **helper_name)
684 struct nfattr *tb[CTA_HELP_MAX]; 677 struct nfattr *tb[CTA_HELP_MAX];
685 678
686 DEBUGP("entered %s\n", __FUNCTION__); 679 DEBUGP("entered %s\n", __FUNCTION__);
687 memset(tb, 0, CTA_HELP_MAX * sizeof(tb));
688 680
689 if (nfattr_parse_nested(tb, CTA_HELP_MAX, attr) < 0) 681 if (nfattr_parse_nested(tb, CTA_HELP_MAX, attr) < 0)
690 goto nfattr_failure; 682 goto nfattr_failure;