[iptables] sparse warning fixes: integer used as pointer

Patrick McHardy netfilter-cvslog-bounces at lists.netfilter.org
Sat Jun 7 15:28:55 CEST 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=0ea82bc43e9262cdbb9880ca56bb514db4c77f8e
commit 0ea82bc43e9262cdbb9880ca56bb514db4c77f8e
Author:     Patrick McHardy <kaber at trash.net>
AuthorDate: Sat Jun 7 15:15:29 2008 +0200
Commit:     Patrick McHardy <kaber at trash.net>
CommitDate: Sat Jun 7 15:15:29 2008 +0200

    sparse warning fixes: integer used as pointer
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>

commit ddffcfbe3c97d1eb81d497261ff376cd336974b3
Author:     Patrick McHardy <kaber at trash.net>
AuthorDate: Sat Jun 7 15:07:18 2008 +0200
Commit:     Patrick McHardy <kaber at trash.net>
CommitDate: Sat Jun 7 15:07:18 2008 +0200

    iptables-xml: sparse fixes
    
    - Using plain integer as NULL pointer
    - Undeclared non-static variables
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>

commit 1f23d3c2544f4329b31804392abc4eff434ba308
Author:     Patrick McHardy <kaber at trash.net>
AuthorDate: Sat Jun 7 15:04:34 2008 +0200
Commit:     Patrick McHardy <kaber at trash.net>
CommitDate: Sat Jun 7 15:04:34 2008 +0200

    libiptc: move variable definitions to head of function
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>
       via  0ea82bc43e9262cdbb9880ca56bb514db4c77f8e (commit)
       via  ddffcfbe3c97d1eb81d497261ff376cd336974b3 (commit)
       via  1f23d3c2544f4329b31804392abc4eff434ba308 (commit)
      from  bb9284d153f338b01975344e96c1b8bcde7d82a8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0ea82bc43e9262cdbb9880ca56bb514db4c77f8e
Author: Patrick McHardy <kaber at trash.net>
Date:   Sat Jun 7 15:15:29 2008 +0200

    sparse warning fixes: integer used as pointer
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>

commit ddffcfbe3c97d1eb81d497261ff376cd336974b3
Author: Patrick McHardy <kaber at trash.net>
Date:   Sat Jun 7 15:07:18 2008 +0200

    iptables-xml: sparse fixes
    
    - Using plain integer as NULL pointer
    - Undeclared non-static variables
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>

commit 1f23d3c2544f4329b31804392abc4eff434ba308
Author: Patrick McHardy <kaber at trash.net>
Date:   Sat Jun 7 15:04:34 2008 +0200

    libiptc: move variable definitions to head of function
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>

-----------------------------------------------------------------------

 extensions/libipt_SET.c        |    6 +++---
 extensions/libipt_set.c        |    4 ++--
 extensions/libxt_CONNSECMARK.c |    4 ++--
 extensions/libxt_SECMARK.c     |    2 +-
 extensions/libxt_quota.c       |    2 +-
 ip6tables-restore.c            |    2 +-
 iptables-restore.c             |    4 ++--
 iptables-xml.c                 |   14 +++++++-------
 libiptc/libiptc.c              |    6 ++++--
 9 files changed, 23 insertions(+), 21 deletions(-)
Signed-off-by: Patrick McHardy <kaber at trash.net>

diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 9463bdb..d0f51b4 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -2170,6 +2170,8 @@ int
 TC_CREATE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle)
 {
 	static struct chain_head *c;
+	int capacity;
+	int exceeded;
 
 	iptc_fn = TC_CREATE_CHAIN;
 
@@ -2209,8 +2211,8 @@ TC_CREATE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle)
 	 * in the buckets. Thus, only rebuild chain index when the
 	 * capacity is exceed with CHAIN_INDEX_INSERT_MAX chains.
 	 */
-	int capacity = (*handle)->chain_index_sz * CHAIN_INDEX_BUCKET_LEN;
-	int exceeded = ((((*handle)->num_chains)-capacity));
+	capacity = (*handle)->chain_index_sz * CHAIN_INDEX_BUCKET_LEN;
+	exceeded = ((((*handle)->num_chains)-capacity));
 	if (exceeded > CHAIN_INDEX_INSERT_MAX) {
 		debug("Capacity(%d) exceeded(%d) rebuild (chains:%d)\n",
 		      capacity, exceeded, (*handle)->num_chains);



More information about the netfilter-cvslog mailing list