[NETFILTER]: Convert DEBUGP to pr_debug
[deliverable/linux.git] / net / ipv4 / netfilter / ipt_SAME.c
index 3a0d7dac0af826b208edd490ac25f67d7d9641a9..97641f1a97f6078f4482401bf5d3a7be30443c40 100644 (file)
@@ -27,12 +27,6 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Martin Josefsson <gandalf@wlug.westbo.se>");
 MODULE_DESCRIPTION("iptables special SNAT module for consistent sourceip");
 
-#if 0
-#define DEBUGP printk
-#else
-#define DEBUGP(format, args...)
-#endif
-
 static bool
 same_check(const char *tablename,
              const void *e,
@@ -46,54 +40,52 @@ same_check(const char *tablename,
        mr->ipnum = 0;
 
        if (mr->rangesize < 1) {
-               DEBUGP("same_check: need at least one dest range.\n");
+               pr_debug("same_check: need at least one dest range.\n");
                return false;
        }
        if (mr->rangesize > IPT_SAME_MAX_RANGE) {
-               DEBUGP("same_check: too many ranges specified, maximum "
-                               "is %u ranges\n",
-                               IPT_SAME_MAX_RANGE);
+               pr_debug("same_check: too many ranges specified, maximum "
+                        "is %u ranges\n", IPT_SAME_MAX_RANGE);
                return false;
        }
        for (count = 0; count < mr->rangesize; count++) {
                if (ntohl(mr->range[count].min_ip) >
                                ntohl(mr->range[count].max_ip)) {
-                       DEBUGP("same_check: min_ip is larger than max_ip in "
-                               "range `%u.%u.%u.%u-%u.%u.%u.%u'.\n",
-                               NIPQUAD(mr->range[count].min_ip),
-                               NIPQUAD(mr->range[count].max_ip));
+                       pr_debug("same_check: min_ip is larger than max_ip in "
+                                "range `%u.%u.%u.%u-%u.%u.%u.%u'.\n",
+                                NIPQUAD(mr->range[count].min_ip),
+                                NIPQUAD(mr->range[count].max_ip));
                        return false;
                }
                if (!(mr->range[count].flags & IP_NAT_RANGE_MAP_IPS)) {
-                       DEBUGP("same_check: bad MAP_IPS.\n");
+                       pr_debug("same_check: bad MAP_IPS.\n");
                        return false;
                }
                rangeip = (ntohl(mr->range[count].max_ip) -
                                        ntohl(mr->range[count].min_ip) + 1);
                mr->ipnum += rangeip;
 
-               DEBUGP("same_check: range %u, ipnum = %u\n", count, rangeip);
+               pr_debug("same_check: range %u, ipnum = %u\n", count, rangeip);
        }
-       DEBUGP("same_check: total ipaddresses = %u\n", mr->ipnum);
+       pr_debug("same_check: total ipaddresses = %u\n", mr->ipnum);
 
        mr->iparray = kmalloc((sizeof(u_int32_t) * mr->ipnum), GFP_KERNEL);
        if (!mr->iparray) {
-               DEBUGP("same_check: Couldn't allocate %u bytes "
-                       "for %u ipaddresses!\n",
-                       (sizeof(u_int32_t) * mr->ipnum), mr->ipnum);
+               pr_debug("same_check: Couldn't allocate %Zu bytes "
+                        "for %u ipaddresses!\n",
+                        (sizeof(u_int32_t) * mr->ipnum), mr->ipnum);
                return false;
        }
-       DEBUGP("same_check: Allocated %u bytes for %u ipaddresses.\n",
-                       (sizeof(u_int32_t) * mr->ipnum), mr->ipnum);
+       pr_debug("same_check: Allocated %Zu bytes for %u ipaddresses.\n",
+                (sizeof(u_int32_t) * mr->ipnum), mr->ipnum);
 
        for (count = 0; count < mr->rangesize; count++) {
                for (countess = ntohl(mr->range[count].min_ip);
                                countess <= ntohl(mr->range[count].max_ip);
                                        countess++) {
                        mr->iparray[index] = countess;
-                       DEBUGP("same_check: Added ipaddress `%u.%u.%u.%u' "
-                               "in index %u.\n",
-                               HIPQUAD(countess), index);
+                       pr_debug("same_check: Added ipaddress `%u.%u.%u.%u' "
+                                "in index %u.\n", HIPQUAD(countess), index);
                        index++;
                }
        }
@@ -107,8 +99,8 @@ same_destroy(const struct xt_target *target, void *targinfo)
 
        kfree(mr->iparray);
 
-       DEBUGP("same_destroy: Deallocated %u bytes for %u ipaddresses.\n",
-                       (sizeof(u_int32_t) * mr->ipnum), mr->ipnum);
+       pr_debug("same_destroy: Deallocated %Zu bytes for %u ipaddresses.\n",
+                (sizeof(u_int32_t) * mr->ipnum), mr->ipnum);
 }
 
 static unsigned int
@@ -146,10 +138,9 @@ same_target(struct sk_buff **pskb,
 
        new_ip = htonl(same->iparray[aindex]);
 
-       DEBUGP("ipt_SAME: src=%u.%u.%u.%u dst=%u.%u.%u.%u, "
-                       "new src=%u.%u.%u.%u\n",
-                       NIPQUAD(t->src.ip), NIPQUAD(t->dst.ip),
-                       NIPQUAD(new_ip));
+       pr_debug("ipt_SAME: src=%u.%u.%u.%u dst=%u.%u.%u.%u, "
+                "new src=%u.%u.%u.%u\n",
+                NIPQUAD(t->src.u3.ip), NIPQUAD(t->dst.u3.ip), NIPQUAD(new_ip));
 
        /* Transfer from original range. */
        newrange = ((struct nf_nat_range)
This page took 0.031666 seconds and 5 git commands to generate.