]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/nf_log.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / net / netfilter / nf_log.c
index 9fda6ee95a31ed5ee5d59c8fc3c5403076a179b4..fa8ae5d2659c6ad1fb13b7dbb20743d0cc1a8886 100644 (file)
 
 #define NF_LOG_PREFIXLEN               128
 
-static const struct nf_logger *nf_loggers[NPROTO] __read_mostly;
+static const struct nf_logger *nf_loggers[NFPROTO_NUMPROTO] __read_mostly;
 static DEFINE_MUTEX(nf_log_mutex);
 
 /* return EBUSY if somebody else is registered, EEXIST if the same logger
  * is registred, 0 on success. */
-int nf_log_register(int pf, const struct nf_logger *logger)
+int nf_log_register(u_int8_t pf, const struct nf_logger *logger)
 {
        int ret;
 
-       if (pf >= NPROTO)
+       if (pf >= ARRAY_SIZE(nf_loggers))
                return -EINVAL;
 
        /* Any setup of logging members must be done before
@@ -45,9 +45,9 @@ int nf_log_register(int pf, const struct nf_logger *logger)
 }
 EXPORT_SYMBOL(nf_log_register);
 
-void nf_log_unregister_pf(int pf)
+void nf_log_unregister_pf(u_int8_t pf)
 {
-       if (pf >= NPROTO)
+       if (pf >= ARRAY_SIZE(nf_loggers))
                return;
        mutex_lock(&nf_log_mutex);
        rcu_assign_pointer(nf_loggers[pf], NULL);
@@ -63,7 +63,7 @@ void nf_log_unregister(const struct nf_logger *logger)
        int i;
 
        mutex_lock(&nf_log_mutex);
-       for (i = 0; i < NPROTO; i++) {
+       for (i = 0; i < ARRAY_SIZE(nf_loggers); i++) {
                if (nf_loggers[i] == logger)
                        rcu_assign_pointer(nf_loggers[i], NULL);
        }
@@ -73,7 +73,7 @@ void nf_log_unregister(const struct nf_logger *logger)
 }
 EXPORT_SYMBOL(nf_log_unregister);
 
-void nf_log_packet(int pf,
+void nf_log_packet(u_int8_t pf,
                   unsigned int hooknum,
                   const struct sk_buff *skb,
                   const struct net_device *in,
@@ -103,7 +103,7 @@ static void *seq_start(struct seq_file *seq, loff_t *pos)
 {
        rcu_read_lock();
 
-       if (*pos >= NPROTO)
+       if (*pos >= ARRAY_SIZE(nf_loggers))
                return NULL;
 
        return pos;
@@ -113,7 +113,7 @@ static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
 {
        (*pos)++;
 
-       if (*pos >= NPROTO)
+       if (*pos >= ARRAY_SIZE(nf_loggers))
                return NULL;
 
        return pos;