Adapt to the removal of NIPQUAD in 2.6.36
[ipt_ACCOUNT] / linux-2.6.36 / net / ipv4 / netfilter / ipt_ACCOUNT.c
index 53ee450..890155f 100644 (file)
@@ -125,24 +125,24 @@ static int ipt_acc_table_insert(char *name, u_int32_t ip, u_int32_t netmask)
 {
     unsigned int i;
 
-    DEBUGP("ACCOUNT: ipt_acc_table_insert: %s, %u.%u.%u.%u/%u.%u.%u.%u\n",
-                                         name, NIPQUAD(ip), NIPQUAD(netmask));
+    DEBUGP("ACCOUNT: ipt_acc_table_insert: %s, %pI4/%pI4\n",
+                                         name, &ip, &netmask);
 
     /* Look for existing table */
     for (i = 0; i < ACCOUNT_MAX_TABLES; i++) {
         if (strncmp(ipt_acc_tables[i].name, name, 
                     ACCOUNT_TABLE_NAME_LEN) == 0) {
             DEBUGP("ACCOUNT: Found existing slot: %d - "
-                   "%u.%u.%u.%u/%u.%u.%u.%u\n", i, 
-                   NIPQUAD(ipt_acc_tables[i].ip), 
-                   NIPQUAD(ipt_acc_tables[i].netmask));
+                   "%pI4/%pI4\n", i,
+                   &ipt_acc_tables[i].ip,
+                   &ipt_acc_tables[i].netmask);
 
             if (ipt_acc_tables[i].ip != ip 
                 || ipt_acc_tables[i].netmask != netmask) {
                 printk("ACCOUNT: Table %s found, but IP/netmask mismatch. "
-                       "IP/netmask found: %u.%u.%u.%u/%u.%u.%u.%u\n",
-                       name, NIPQUAD(ipt_acc_tables[i].ip), 
-                       NIPQUAD(ipt_acc_tables[i].netmask));
+                       "IP/netmask found: %pI4/%pI4\n",
+                       name, &ipt_acc_tables[i].ip, 
+                       &ipt_acc_tables[i].netmask);
                 return -1;
             }
 
@@ -341,9 +341,9 @@ static void ipt_acc_depth0_insert(struct ipt_acc_mask_24 *mask_24,
     unsigned char is_src = 0, is_dst = 0, src_slot, dst_slot;
     char is_src_new_ip = 0, is_dst_new_ip = 0; /* Check if this entry is new */
 
-    DEBUGP("ACCOUNT: ipt_acc_depth0_insert: %u.%u.%u.%u/%u.%u.%u.%u "
-           "for net %u.%u.%u.%u/%u.%u.%u.%u, size: %u\n", NIPQUAD(src_ip), 
-           NIPQUAD(dst_ip), NIPQUAD(net_ip), NIPQUAD(netmask), size);
+    DEBUGP("ACCOUNT: ipt_acc_depth0_insert: %pI4/%pI4 "
+           "for net %pI4/%pI4, size: %u\n", &src_ip,
+           &dst_ip, &net_ip, &netmask, size);
 
     /* Check if src/dst is inside our network. */
     /* Special: net_ip = 0.0.0.0/0 gets stored as src in slot 0 */
@@ -355,9 +355,9 @@ static void ipt_acc_depth0_insert(struct ipt_acc_mask_24 *mask_24,
         is_dst = 1;
 
     if (!is_src && !is_dst) {
-        DEBUGP("ACCOUNT: Skipping packet %u.%u.%u.%u/%u.%u.%u.%u "
-               "for net %u.%u.%u.%u/%u.%u.%u.%u\n", NIPQUAD(src_ip), 
-               NIPQUAD(dst_ip), NIPQUAD(net_ip), NIPQUAD(netmask));
+        DEBUGP("ACCOUNT: Skipping packet %pI4/%pI4 "
+               "for net %pI4/%pI4\n", &src_ip,
+               &dst_ip, &net_ip, &netmask);
         return;
     }
 
@@ -396,11 +396,11 @@ static void ipt_acc_depth0_insert(struct ipt_acc_mask_24 *mask_24,
         }
     } else {
         if (is_src_new_ip) {
-            DEBUGP("ACCOUNT: New src_ip: %u.%u.%u.%u\n", NIPQUAD(src_ip));
+            DEBUGP("ACCOUNT: New src_ip: %pI4\n", &src_ip);
             (*itemcount)++;
         }
         if (is_dst_new_ip) {
-            DEBUGP("ACCOUNT: New dst_ip: %u.%u.%u.%u\n", NIPQUAD(dst_ip));
+            DEBUGP("ACCOUNT: New dst_ip: %pI4\n", &dst_ip);
             (*itemcount)++;
         }
     }
@@ -532,8 +532,8 @@ static unsigned int ipt_acc_target(struct sk_buff **pskb,
 
     if (ipt_acc_tables[info->table_nr].name[0] == 0) {
         printk("ACCOUNT: ipt_acc_target: Invalid table id %u. "
-               "IPs %u.%u.%u.%u/%u.%u.%u.%u\n", info->table_nr, 
-               NIPQUAD(src_ip), NIPQUAD(dst_ip));
+               "IPs %pI4/%pI4\n", info->table_nr, 
+               &src_ip, &dst_ip);
         spin_unlock_bh(&ipt_acc_lock);
         return IPT_CONTINUE;
     }
@@ -573,8 +573,8 @@ static unsigned int ipt_acc_target(struct sk_buff **pskb,
     }
 
     printk("ACCOUNT: ipt_acc_target: Unable to process packet. "
-           "Table id %u. IPs %u.%u.%u.%u/%u.%u.%u.%u\n", 
-           info->table_nr, NIPQUAD(src_ip), NIPQUAD(dst_ip));
+           "Table id %u. IPs %pI4/%pI4\n", 
+           info->table_nr, &src_ip, &dst_ip);
 
     spin_unlock_bh(&ipt_acc_lock);
     return IPT_CONTINUE;