aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-10-31 03:53:08 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-31 03:53:08 -0400
commitcffee385d7f367e80b288abf4261256477f7760e (patch)
treeac4655a3883910236effe70b6169f70a5b804182 /net/ipv4
parent77be155cba4e163e8bba9fd27222a8b6189ec4f7 (diff)
net: replace NIPQUAD() in net/ipv4/netfilter/
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/arp_tables.c16
-rw-r--r--net/ipv4/netfilter/ip_tables.c12
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c9
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c7
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c15
-rw-r--r--net/ipv4/netfilter/nf_nat_h323.c58
-rw-r--r--net/ipv4/netfilter/nf_nat_irc.c4
-rw-r--r--net/ipv4/netfilter/nf_nat_rule.c6
-rw-r--r--net/ipv4/netfilter/nf_nat_sip.c18
-rw-r--r--net/ipv4/netfilter/nf_nat_snmp_basic.c9
10 files changed, 69 insertions, 85 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 8d70d29f1ccf..7ea88b61cb0d 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -142,15 +142,15 @@ static inline int arp_packet_match(const struct arphdr *arphdr,
142 ARPT_INV_TGTIP)) { 142 ARPT_INV_TGTIP)) {
143 dprintf("Source or target IP address mismatch.\n"); 143 dprintf("Source or target IP address mismatch.\n");
144 144
145 dprintf("SRC: %u.%u.%u.%u. Mask: %u.%u.%u.%u. Target: %u.%u.%u.%u.%s\n", 145 dprintf("SRC: %pI4. Mask: %pI4. Target: %pI4.%s\n",
146 NIPQUAD(src_ipaddr), 146 &src_ipaddr,
147 NIPQUAD(arpinfo->smsk.s_addr), 147 &arpinfo->smsk.s_addr,
148 NIPQUAD(arpinfo->src.s_addr), 148 &arpinfo->src.s_addr,
149 arpinfo->invflags & ARPT_INV_SRCIP ? " (INV)" : ""); 149 arpinfo->invflags & ARPT_INV_SRCIP ? " (INV)" : "");
150 dprintf("TGT: %u.%u.%u.%u Mask: %u.%u.%u.%u Target: %u.%u.%u.%u.%s\n", 150 dprintf("TGT: %pI4 Mask: %pI4 Target: %pI4.%s\n",
151 NIPQUAD(tgt_ipaddr), 151 &tgt_ipaddr,
152 NIPQUAD(arpinfo->tmsk.s_addr), 152 &arpinfo->tmsk.s_addr,
153 NIPQUAD(arpinfo->tgt.s_addr), 153 &arpinfo->tgt.s_addr,
154 arpinfo->invflags & ARPT_INV_TGTIP ? " (INV)" : ""); 154 arpinfo->invflags & ARPT_INV_TGTIP ? " (INV)" : "");
155 return 0; 155 return 0;
156 } 156 }
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 213fb27debc1..ef8b6ca068b2 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -94,15 +94,11 @@ ip_packet_match(const struct iphdr *ip,
94 IPT_INV_DSTIP)) { 94 IPT_INV_DSTIP)) {
95 dprintf("Source or dest mismatch.\n"); 95 dprintf("Source or dest mismatch.\n");
96 96
97 dprintf("SRC: %u.%u.%u.%u. Mask: %u.%u.%u.%u. Target: %u.%u.%u.%u.%s\n", 97 dprintf("SRC: %pI4. Mask: %pI4. Target: %pI4.%s\n",
98 NIPQUAD(ip->saddr), 98 &ip->saddr, &ipinfo->smsk.s_addr, &ipinfo->src.s_addr,
99 NIPQUAD(ipinfo->smsk.s_addr),
100 NIPQUAD(ipinfo->src.s_addr),
101 ipinfo->invflags & IPT_INV_SRCIP ? " (INV)" : ""); 99 ipinfo->invflags & IPT_INV_SRCIP ? " (INV)" : "");
102 dprintf("DST: %u.%u.%u.%u Mask: %u.%u.%u.%u Target: %u.%u.%u.%u.%s\n", 100 dprintf("DST: %pI4 Mask: %pI4 Target: %pI4.%s\n",
103 NIPQUAD(ip->daddr), 101 &ip->daddr, &ipinfo->dmsk.s_addr, &ipinfo->dst.s_addr,
104 NIPQUAD(ipinfo->dmsk.s_addr),
105 NIPQUAD(ipinfo->dst.s_addr),
106 ipinfo->invflags & IPT_INV_DSTIP ? " (INV)" : ""); 102 ipinfo->invflags & IPT_INV_DSTIP ? " (INV)" : "");
107 return false; 103 return false;
108 } 104 }
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 7ac1677419a9..2e4f98b85524 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -168,7 +168,7 @@ clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip,
168 char buffer[16]; 168 char buffer[16];
169 169
170 /* create proc dir entry */ 170 /* create proc dir entry */
171 sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); 171 sprintf(buffer, "%pI4", &ip);
172 c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR, 172 c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR,
173 clusterip_procdir, 173 clusterip_procdir,
174 &clusterip_proc_fops, c); 174 &clusterip_proc_fops, c);
@@ -373,7 +373,7 @@ static bool clusterip_tg_check(const struct xt_tgchk_param *par)
373 config = clusterip_config_find_get(e->ip.dst.s_addr, 1); 373 config = clusterip_config_find_get(e->ip.dst.s_addr, 1);
374 if (!config) { 374 if (!config) {
375 if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) { 375 if (!(cipinfo->flags & CLUSTERIP_FLAG_NEW)) {
376 printk(KERN_WARNING "CLUSTERIP: no config found for %u.%u.%u.%u, need 'new'\n", NIPQUAD(e->ip.dst.s_addr)); 376 printk(KERN_WARNING "CLUSTERIP: no config found for %pI4, need 'new'\n", &e->ip.dst.s_addr);
377 return false; 377 return false;
378 } else { 378 } else {
379 struct net_device *dev; 379 struct net_device *dev;
@@ -478,9 +478,8 @@ static void arp_print(struct arp_payload *payload)
478 } 478 }
479 hbuffer[--k]='\0'; 479 hbuffer[--k]='\0';
480 480
481 printk("src %u.%u.%u.%u@%s, dst %u.%u.%u.%u\n", 481 printk("src %pI4@%s, dst %pI4\n",
482 NIPQUAD(payload->src_ip), hbuffer, 482 &payload->src_ip, hbuffer, &payload->dst_ip);
483 NIPQUAD(payload->dst_ip));
484} 483}
485#endif 484#endif
486 485
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index fc6ce04a3e35..4614a696f1b0 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -54,8 +54,8 @@ static void dump_packet(const struct nf_loginfo *info,
54 /* Important fields: 54 /* Important fields:
55 * TOS, len, DF/MF, fragment offset, TTL, src, dst, options. */ 55 * TOS, len, DF/MF, fragment offset, TTL, src, dst, options. */
56 /* Max length: 40 "SRC=255.255.255.255 DST=255.255.255.255 " */ 56 /* Max length: 40 "SRC=255.255.255.255 DST=255.255.255.255 " */
57 printk("SRC=%u.%u.%u.%u DST=%u.%u.%u.%u ", 57 printk("SRC=%pI4 DST=%pI4 ",
58 NIPQUAD(ih->saddr), NIPQUAD(ih->daddr)); 58 &ih->saddr, &ih->daddr);
59 59
60 /* Max length: 46 "LEN=65535 TOS=0xFF PREC=0xFF TTL=255 ID=65535 " */ 60 /* Max length: 46 "LEN=65535 TOS=0xFF PREC=0xFF TTL=255 ID=65535 " */
61 printk("LEN=%u TOS=0x%02X PREC=0x%02X TTL=%u ID=%u ", 61 printk("LEN=%u TOS=0x%02X PREC=0x%02X TTL=%u ID=%u ",
@@ -262,8 +262,7 @@ static void dump_packet(const struct nf_loginfo *info,
262 break; 262 break;
263 case ICMP_REDIRECT: 263 case ICMP_REDIRECT:
264 /* Max length: 24 "GATEWAY=255.255.255.255 " */ 264 /* Max length: 24 "GATEWAY=255.255.255.255 " */
265 printk("GATEWAY=%u.%u.%u.%u ", 265 printk("GATEWAY=%pI4 ", &ich->un.gateway);
266 NIPQUAD(ich->un.gateway));
267 /* Fall through */ 266 /* Fall through */
268 case ICMP_DEST_UNREACH: 267 case ICMP_DEST_UNREACH:
269 case ICMP_SOURCE_QUENCH: 268 case ICMP_SOURCE_QUENCH:
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 4a7c35275396..bddadead6195 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -60,9 +60,8 @@ static bool ipv4_invert_tuple(struct nf_conntrack_tuple *tuple,
60static int ipv4_print_tuple(struct seq_file *s, 60static int ipv4_print_tuple(struct seq_file *s,
61 const struct nf_conntrack_tuple *tuple) 61 const struct nf_conntrack_tuple *tuple)
62{ 62{
63 return seq_printf(s, "src=%u.%u.%u.%u dst=%u.%u.%u.%u ", 63 return seq_printf(s, "src=%pI4 dst=%pI4 ",
64 NIPQUAD(tuple->src.u3.ip), 64 &tuple->src.u3.ip, &tuple->dst.u3.ip);
65 NIPQUAD(tuple->dst.u3.ip));
66} 65}
67 66
68static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff, 67static int ipv4_get_l4proto(const struct sk_buff *skb, unsigned int nhoff,
@@ -284,17 +283,17 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
284 .tuple.dst.u3.ip; 283 .tuple.dst.u3.ip;
285 memset(sin.sin_zero, 0, sizeof(sin.sin_zero)); 284 memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
286 285
287 pr_debug("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", 286 pr_debug("SO_ORIGINAL_DST: %pI4 %u\n",
288 NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); 287 &sin.sin_addr.s_addr, ntohs(sin.sin_port));
289 nf_ct_put(ct); 288 nf_ct_put(ct);
290 if (copy_to_user(user, &sin, sizeof(sin)) != 0) 289 if (copy_to_user(user, &sin, sizeof(sin)) != 0)
291 return -EFAULT; 290 return -EFAULT;
292 else 291 else
293 return 0; 292 return 0;
294 } 293 }
295 pr_debug("SO_ORIGINAL_DST: Can't find %u.%u.%u.%u/%u-%u.%u.%u.%u/%u.\n", 294 pr_debug("SO_ORIGINAL_DST: Can't find %pI4/%u-%pI4/%u.\n",
296 NIPQUAD(tuple.src.u3.ip), ntohs(tuple.src.u.tcp.port), 295 &tuple.src.u3.ip, ntohs(tuple.src.u.tcp.port),
297 NIPQUAD(tuple.dst.u3.ip), ntohs(tuple.dst.u.tcp.port)); 296 &tuple.dst.u3.ip, ntohs(tuple.dst.u.tcp.port));
298 return -ENOENT; 297 return -ENOENT;
299} 298}
300 299
diff --git a/net/ipv4/netfilter/nf_nat_h323.c b/net/ipv4/netfilter/nf_nat_h323.c
index ee47bf28c825..7e8e6fc75413 100644
--- a/net/ipv4/netfilter/nf_nat_h323.c
+++ b/net/ipv4/netfilter/nf_nat_h323.c
@@ -119,10 +119,9 @@ static int set_sig_addr(struct sk_buff *skb, struct nf_conn *ct,
119 (ntohl(addr.ip) & 0xff000000) == 0x7f000000) 119 (ntohl(addr.ip) & 0xff000000) == 0x7f000000)
120 i = 0; 120 i = 0;
121 121
122 pr_debug("nf_nat_ras: set signal address " 122 pr_debug("nf_nat_ras: set signal address %pI4:%hu->%pI4:%hu\n",
123 "%u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 123 &addr.ip, port,
124 NIPQUAD(addr.ip), port, 124 &ct->tuplehash[!dir].tuple.dst.u3.ip,
125 NIPQUAD(ct->tuplehash[!dir].tuple.dst.u3.ip),
126 info->sig_port[!dir]); 125 info->sig_port[!dir]);
127 return set_h225_addr(skb, data, 0, &taddr[i], 126 return set_h225_addr(skb, data, 0, &taddr[i],
128 &ct->tuplehash[!dir]. 127 &ct->tuplehash[!dir].
@@ -131,10 +130,9 @@ static int set_sig_addr(struct sk_buff *skb, struct nf_conn *ct,
131 } else if (addr.ip == ct->tuplehash[dir].tuple.dst.u3.ip && 130 } else if (addr.ip == ct->tuplehash[dir].tuple.dst.u3.ip &&
132 port == info->sig_port[dir]) { 131 port == info->sig_port[dir]) {
133 /* GK->GW */ 132 /* GK->GW */
134 pr_debug("nf_nat_ras: set signal address " 133 pr_debug("nf_nat_ras: set signal address %pI4:%hu->%pI4:%hu\n",
135 "%u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 134 &addr.ip, port,
136 NIPQUAD(addr.ip), port, 135 &ct->tuplehash[!dir].tuple.src.u3.ip,
137 NIPQUAD(ct->tuplehash[!dir].tuple.src.u3.ip),
138 info->sig_port[!dir]); 136 info->sig_port[!dir]);
139 return set_h225_addr(skb, data, 0, &taddr[i], 137 return set_h225_addr(skb, data, 0, &taddr[i],
140 &ct->tuplehash[!dir]. 138 &ct->tuplehash[!dir].
@@ -162,10 +160,9 @@ static int set_ras_addr(struct sk_buff *skb, struct nf_conn *ct,
162 if (get_h225_addr(ct, *data, &taddr[i], &addr, &port) && 160 if (get_h225_addr(ct, *data, &taddr[i], &addr, &port) &&
163 addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && 161 addr.ip == ct->tuplehash[dir].tuple.src.u3.ip &&
164 port == ct->tuplehash[dir].tuple.src.u.udp.port) { 162 port == ct->tuplehash[dir].tuple.src.u.udp.port) {
165 pr_debug("nf_nat_ras: set rasAddress " 163 pr_debug("nf_nat_ras: set rasAddress %pI4:%hu->%pI4:%hu\n",
166 "%u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 164 &addr.ip, ntohs(port),
167 NIPQUAD(addr.ip), ntohs(port), 165 &ct->tuplehash[!dir].tuple.dst.u3.ip,
168 NIPQUAD(ct->tuplehash[!dir].tuple.dst.u3.ip),
169 ntohs(ct->tuplehash[!dir].tuple.dst.u.udp.port)); 166 ntohs(ct->tuplehash[!dir].tuple.dst.u.udp.port));
170 return set_h225_addr(skb, data, 0, &taddr[i], 167 return set_h225_addr(skb, data, 0, &taddr[i],
171 &ct->tuplehash[!dir].tuple.dst.u3, 168 &ct->tuplehash[!dir].tuple.dst.u3,
@@ -257,15 +254,15 @@ static int nat_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
257 } 254 }
258 255
259 /* Success */ 256 /* Success */
260 pr_debug("nf_nat_h323: expect RTP %u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 257 pr_debug("nf_nat_h323: expect RTP %pI4:%hu->%pI4:%hu\n",
261 NIPQUAD(rtp_exp->tuple.src.u3.ip), 258 &rtp_exp->tuple.src.u3.ip,
262 ntohs(rtp_exp->tuple.src.u.udp.port), 259 ntohs(rtp_exp->tuple.src.u.udp.port),
263 NIPQUAD(rtp_exp->tuple.dst.u3.ip), 260 &rtp_exp->tuple.dst.u3.ip,
264 ntohs(rtp_exp->tuple.dst.u.udp.port)); 261 ntohs(rtp_exp->tuple.dst.u.udp.port));
265 pr_debug("nf_nat_h323: expect RTCP %u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 262 pr_debug("nf_nat_h323: expect RTCP %pI4:%hu->%pI4:%hu\n",
266 NIPQUAD(rtcp_exp->tuple.src.u3.ip), 263 &rtcp_exp->tuple.src.u3.ip,
267 ntohs(rtcp_exp->tuple.src.u.udp.port), 264 ntohs(rtcp_exp->tuple.src.u.udp.port),
268 NIPQUAD(rtcp_exp->tuple.dst.u3.ip), 265 &rtcp_exp->tuple.dst.u3.ip,
269 ntohs(rtcp_exp->tuple.dst.u.udp.port)); 266 ntohs(rtcp_exp->tuple.dst.u.udp.port));
270 267
271 return 0; 268 return 0;
@@ -307,10 +304,10 @@ static int nat_t120(struct sk_buff *skb, struct nf_conn *ct,
307 return -1; 304 return -1;
308 } 305 }
309 306
310 pr_debug("nf_nat_h323: expect T.120 %u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 307 pr_debug("nf_nat_h323: expect T.120 %pI4:%hu->%pI4:%hu\n",
311 NIPQUAD(exp->tuple.src.u3.ip), 308 &exp->tuple.src.u3.ip,
312 ntohs(exp->tuple.src.u.tcp.port), 309 ntohs(exp->tuple.src.u.tcp.port),
313 NIPQUAD(exp->tuple.dst.u3.ip), 310 &exp->tuple.dst.u3.ip,
314 ntohs(exp->tuple.dst.u.tcp.port)); 311 ntohs(exp->tuple.dst.u.tcp.port));
315 312
316 return 0; 313 return 0;
@@ -361,10 +358,10 @@ static int nat_h245(struct sk_buff *skb, struct nf_conn *ct,
361 return -1; 358 return -1;
362 } 359 }
363 360
364 pr_debug("nf_nat_q931: expect H.245 %u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 361 pr_debug("nf_nat_q931: expect H.245 %pI4:%hu->%pI4:%hu\n",
365 NIPQUAD(exp->tuple.src.u3.ip), 362 &exp->tuple.src.u3.ip,
366 ntohs(exp->tuple.src.u.tcp.port), 363 ntohs(exp->tuple.src.u.tcp.port),
367 NIPQUAD(exp->tuple.dst.u3.ip), 364 &exp->tuple.dst.u3.ip,
368 ntohs(exp->tuple.dst.u.tcp.port)); 365 ntohs(exp->tuple.dst.u.tcp.port));
369 366
370 return 0; 367 return 0;
@@ -455,10 +452,10 @@ static int nat_q931(struct sk_buff *skb, struct nf_conn *ct,
455 } 452 }
456 453
457 /* Success */ 454 /* Success */
458 pr_debug("nf_nat_ras: expect Q.931 %u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 455 pr_debug("nf_nat_ras: expect Q.931 %pI4:%hu->%pI4:%hu\n",
459 NIPQUAD(exp->tuple.src.u3.ip), 456 &exp->tuple.src.u3.ip,
460 ntohs(exp->tuple.src.u.tcp.port), 457 ntohs(exp->tuple.src.u.tcp.port),
461 NIPQUAD(exp->tuple.dst.u3.ip), 458 &exp->tuple.dst.u3.ip,
462 ntohs(exp->tuple.dst.u.tcp.port)); 459 ntohs(exp->tuple.dst.u.tcp.port));
463 460
464 return 0; 461 return 0;
@@ -524,11 +521,10 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct,
524 } 521 }
525 522
526 /* Success */ 523 /* Success */
527 pr_debug("nf_nat_q931: expect Call Forwarding " 524 pr_debug("nf_nat_q931: expect Call Forwarding %pI4:%hu->%pI4:%hu\n",
528 "%u.%u.%u.%u:%hu->%u.%u.%u.%u:%hu\n", 525 &exp->tuple.src.u3.ip,
529 NIPQUAD(exp->tuple.src.u3.ip),
530 ntohs(exp->tuple.src.u.tcp.port), 526 ntohs(exp->tuple.src.u.tcp.port),
531 NIPQUAD(exp->tuple.dst.u3.ip), 527 &exp->tuple.dst.u3.ip,
532 ntohs(exp->tuple.dst.u.tcp.port)); 528 ntohs(exp->tuple.dst.u.tcp.port));
533 529
534 return 0; 530 return 0;
diff --git a/net/ipv4/netfilter/nf_nat_irc.c b/net/ipv4/netfilter/nf_nat_irc.c
index fe6f9cef6c85..ea83a886b03e 100644
--- a/net/ipv4/netfilter/nf_nat_irc.c
+++ b/net/ipv4/netfilter/nf_nat_irc.c
@@ -55,8 +55,8 @@ static unsigned int help(struct sk_buff *skb,
55 55
56 ip = ntohl(exp->master->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip); 56 ip = ntohl(exp->master->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip);
57 sprintf(buffer, "%u %u", ip, port); 57 sprintf(buffer, "%u %u", ip, port);
58 pr_debug("nf_nat_irc: inserting '%s' == %u.%u.%u.%u, port %u\n", 58 pr_debug("nf_nat_irc: inserting '%s' == %pI4, port %u\n",
59 buffer, NIPQUAD(ip), port); 59 buffer, &ip, port);
60 60
61 ret = nf_nat_mangle_tcp_packet(skb, exp->master, ctinfo, 61 ret = nf_nat_mangle_tcp_packet(skb, exp->master, ctinfo,
62 matchoff, matchlen, buffer, 62 matchoff, matchlen, buffer,
diff --git a/net/ipv4/netfilter/nf_nat_rule.c b/net/ipv4/netfilter/nf_nat_rule.c
index bea54a685109..a4f1c3479e23 100644
--- a/net/ipv4/netfilter/nf_nat_rule.c
+++ b/net/ipv4/netfilter/nf_nat_rule.c
@@ -98,8 +98,7 @@ static void warn_if_extra_mangle(struct net *net, __be32 dstip, __be32 srcip)
98 98
99 if (rt->rt_src != srcip && !warned) { 99 if (rt->rt_src != srcip && !warned) {
100 printk("NAT: no longer support implicit source local NAT\n"); 100 printk("NAT: no longer support implicit source local NAT\n");
101 printk("NAT: packet src %u.%u.%u.%u -> dst %u.%u.%u.%u\n", 101 printk("NAT: packet src %pI4 -> dst %pI4\n", &srcip, &dstip);
102 NIPQUAD(srcip), NIPQUAD(dstip));
103 warned = 1; 102 warned = 1;
104 } 103 }
105 ip_rt_put(rt); 104 ip_rt_put(rt);
@@ -166,8 +165,7 @@ alloc_null_binding(struct nf_conn *ct, unsigned int hooknum)
166 struct nf_nat_range range 165 struct nf_nat_range range
167 = { IP_NAT_RANGE_MAP_IPS, ip, ip, { 0 }, { 0 } }; 166 = { IP_NAT_RANGE_MAP_IPS, ip, ip, { 0 }, { 0 } };
168 167
169 pr_debug("Allocating NULL binding for %p (%u.%u.%u.%u)\n", 168 pr_debug("Allocating NULL binding for %p (%pI4)\n", ct, &ip);
170 ct, NIPQUAD(ip));
171 return nf_nat_setup_info(ct, &range, HOOK2MANIP(hooknum)); 169 return nf_nat_setup_info(ct, &range, HOOK2MANIP(hooknum));
172} 170}
173 171
diff --git a/net/ipv4/netfilter/nf_nat_sip.c b/net/ipv4/netfilter/nf_nat_sip.c
index 14544320c545..07d61a57613c 100644
--- a/net/ipv4/netfilter/nf_nat_sip.c
+++ b/net/ipv4/netfilter/nf_nat_sip.c
@@ -74,8 +74,7 @@ static int map_addr(struct sk_buff *skb,
74 if (newaddr == addr->ip && newport == port) 74 if (newaddr == addr->ip && newport == port)
75 return 1; 75 return 1;
76 76
77 buflen = sprintf(buffer, "%u.%u.%u.%u:%u", 77 buflen = sprintf(buffer, "%pI4:%u", &newaddr, ntohs(newport));
78 NIPQUAD(newaddr), ntohs(newport));
79 78
80 return mangle_packet(skb, dptr, datalen, matchoff, matchlen, 79 return mangle_packet(skb, dptr, datalen, matchoff, matchlen,
81 buffer, buflen); 80 buffer, buflen);
@@ -152,8 +151,8 @@ static unsigned int ip_nat_sip(struct sk_buff *skb,
152 &addr) > 0 && 151 &addr) > 0 &&
153 addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && 152 addr.ip == ct->tuplehash[dir].tuple.src.u3.ip &&
154 addr.ip != ct->tuplehash[!dir].tuple.dst.u3.ip) { 153 addr.ip != ct->tuplehash[!dir].tuple.dst.u3.ip) {
155 __be32 ip = ct->tuplehash[!dir].tuple.dst.u3.ip; 154 buflen = sprintf(buffer, "%pI4",
156 buflen = sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); 155 &ct->tuplehash[!dir].tuple.dst.u3.ip);
157 if (!mangle_packet(skb, dptr, datalen, poff, plen, 156 if (!mangle_packet(skb, dptr, datalen, poff, plen,
158 buffer, buflen)) 157 buffer, buflen))
159 return NF_DROP; 158 return NF_DROP;
@@ -166,8 +165,8 @@ static unsigned int ip_nat_sip(struct sk_buff *skb,
166 &addr) > 0 && 165 &addr) > 0 &&
167 addr.ip == ct->tuplehash[dir].tuple.dst.u3.ip && 166 addr.ip == ct->tuplehash[dir].tuple.dst.u3.ip &&
168 addr.ip != ct->tuplehash[!dir].tuple.src.u3.ip) { 167 addr.ip != ct->tuplehash[!dir].tuple.src.u3.ip) {
169 __be32 ip = ct->tuplehash[!dir].tuple.src.u3.ip; 168 buflen = sprintf(buffer, "%pI4",
170 buflen = sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); 169 &ct->tuplehash[!dir].tuple.src.u3.ip);
171 if (!mangle_packet(skb, dptr, datalen, poff, plen, 170 if (!mangle_packet(skb, dptr, datalen, poff, plen,
172 buffer, buflen)) 171 buffer, buflen))
173 return NF_DROP; 172 return NF_DROP;
@@ -279,8 +278,7 @@ static unsigned int ip_nat_sip_expect(struct sk_buff *skb,
279 278
280 if (exp->tuple.dst.u3.ip != exp->saved_ip || 279 if (exp->tuple.dst.u3.ip != exp->saved_ip ||
281 exp->tuple.dst.u.udp.port != exp->saved_proto.udp.port) { 280 exp->tuple.dst.u.udp.port != exp->saved_proto.udp.port) {
282 buflen = sprintf(buffer, "%u.%u.%u.%u:%u", 281 buflen = sprintf(buffer, "%pI4:%u", &newip, port);
283 NIPQUAD(newip), port);
284 if (!mangle_packet(skb, dptr, datalen, matchoff, matchlen, 282 if (!mangle_packet(skb, dptr, datalen, matchoff, matchlen,
285 buffer, buflen)) 283 buffer, buflen))
286 goto err; 284 goto err;
@@ -345,7 +343,7 @@ static unsigned int ip_nat_sdp_addr(struct sk_buff *skb, const char **dptr,
345 char buffer[sizeof("nnn.nnn.nnn.nnn")]; 343 char buffer[sizeof("nnn.nnn.nnn.nnn")];
346 unsigned int buflen; 344 unsigned int buflen;
347 345
348 buflen = sprintf(buffer, NIPQUAD_FMT, NIPQUAD(addr->ip)); 346 buflen = sprintf(buffer, "%pI4", &addr->ip);
349 if (mangle_sdp_packet(skb, dptr, dataoff, datalen, type, term, 347 if (mangle_sdp_packet(skb, dptr, dataoff, datalen, type, term,
350 buffer, buflen)) 348 buffer, buflen))
351 return 0; 349 return 0;
@@ -380,7 +378,7 @@ static unsigned int ip_nat_sdp_session(struct sk_buff *skb, const char **dptr,
380 unsigned int buflen; 378 unsigned int buflen;
381 379
382 /* Mangle session description owner and contact addresses */ 380 /* Mangle session description owner and contact addresses */
383 buflen = sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(addr->ip)); 381 buflen = sprintf(buffer, "%pI4", &addr->ip);
384 if (mangle_sdp_packet(skb, dptr, dataoff, datalen, 382 if (mangle_sdp_packet(skb, dptr, dataoff, datalen,
385 SDP_HDR_OWNER_IP4, SDP_HDR_MEDIA, 383 SDP_HDR_OWNER_IP4, SDP_HDR_MEDIA,
386 buffer, buflen)) 384 buffer, buflen))
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
index 8303e4b406c0..182f845de92f 100644
--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
@@ -930,8 +930,8 @@ static inline void mangle_address(unsigned char *begin,
930 } 930 }
931 931
932 if (debug) 932 if (debug)
933 printk(KERN_DEBUG "bsalg: mapped %u.%u.%u.%u to " 933 printk(KERN_DEBUG "bsalg: mapped %pI4 to %pI4\n",
934 "%u.%u.%u.%u\n", NIPQUAD(old), NIPQUAD(*addr)); 934 &old, addr);
935 } 935 }
936} 936}
937 937
@@ -1267,9 +1267,8 @@ static int help(struct sk_buff *skb, unsigned int protoff,
1267 */ 1267 */
1268 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) { 1268 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) {
1269 if (net_ratelimit()) 1269 if (net_ratelimit())
1270 printk(KERN_WARNING "SNMP: dropping malformed packet " 1270 printk(KERN_WARNING "SNMP: dropping malformed packet src=%pI4 dst=%pI4\n",
1271 "src=%u.%u.%u.%u dst=%u.%u.%u.%u\n", 1271 &iph->saddr, &iph->daddr);
1272 NIPQUAD(iph->saddr), NIPQUAD(iph->daddr));
1273 return NF_DROP; 1272 return NF_DROP;
1274 } 1273 }
1275 1274