diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-10-31 03:53:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:53:57 -0400 |
commit | 673d57e72398edfedc93fb50ff58048077c9d587 (patch) | |
tree | 4c6a83072ac64ef63ad73574c3e1c0a683524163 /net | |
parent | cffee385d7f367e80b288abf4261256477f7760e (diff) |
net: replace NIPQUAD() in net/ipv4/ net/ipv6/
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')
-rw-r--r-- | net/ipv4/af_inet.c | 7 | ||||
-rw-r--r-- | net/ipv4/arp.c | 4 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 6 | ||||
-rw-r--r-- | net/ipv4/icmp.c | 24 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 5 | ||||
-rw-r--r-- | net/ipv4/ip_input.c | 6 | ||||
-rw-r--r-- | net/ipv4/ipcomp.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 40 | ||||
-rw-r--r-- | net/ipv4/route.c | 40 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 13 | ||||
-rw-r--r-- | net/ipv4/tcp_probe.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_timer.c | 4 | ||||
-rw-r--r-- | net/ipv4/udp.c | 12 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_LOG.c | 5 |
15 files changed, 78 insertions, 103 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 1fbff5fa4241..e3286814c8d9 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1070,11 +1070,8 @@ static int inet_sk_reselect_saddr(struct sock *sk) | |||
1070 | return 0; | 1070 | return 0; |
1071 | 1071 | ||
1072 | if (sysctl_ip_dynaddr > 1) { | 1072 | if (sysctl_ip_dynaddr > 1) { |
1073 | printk(KERN_INFO "%s(): shifting inet->" | 1073 | printk(KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n", |
1074 | "saddr from " NIPQUAD_FMT " to " NIPQUAD_FMT "\n", | 1074 | __func__, &old_saddr, &new_saddr); |
1075 | __func__, | ||
1076 | NIPQUAD(old_saddr), | ||
1077 | NIPQUAD(new_saddr)); | ||
1078 | } | 1075 | } |
1079 | 1076 | ||
1080 | inet->saddr = inet->rcv_saddr = new_saddr; | 1077 | inet->saddr = inet->rcv_saddr = new_saddr; |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 1a9dd66511fc..051a62fc8189 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -1308,7 +1308,7 @@ static void arp_format_neigh_entry(struct seq_file *seq, | |||
1308 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | 1308 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) |
1309 | } | 1309 | } |
1310 | #endif | 1310 | #endif |
1311 | sprintf(tbuf, NIPQUAD_FMT, NIPQUAD(*(u32*)n->primary_key)); | 1311 | sprintf(tbuf, "%pI4", n->primary_key); |
1312 | seq_printf(seq, "%-16s 0x%-10x0x%-10x%s * %s\n", | 1312 | seq_printf(seq, "%-16s 0x%-10x0x%-10x%s * %s\n", |
1313 | tbuf, hatype, arp_state_to_flags(n), hbuffer, dev->name); | 1313 | tbuf, hatype, arp_state_to_flags(n), hbuffer, dev->name); |
1314 | read_unlock(&n->lock); | 1314 | read_unlock(&n->lock); |
@@ -1321,7 +1321,7 @@ static void arp_format_pneigh_entry(struct seq_file *seq, | |||
1321 | int hatype = dev ? dev->type : 0; | 1321 | int hatype = dev ? dev->type : 0; |
1322 | char tbuf[16]; | 1322 | char tbuf[16]; |
1323 | 1323 | ||
1324 | sprintf(tbuf, NIPQUAD_FMT, NIPQUAD(*(u32*)n->key)); | 1324 | sprintf(tbuf, "%pI4", n->key); |
1325 | seq_printf(seq, "%-16s 0x%-10x0x%-10x%s * %s\n", | 1325 | seq_printf(seq, "%-16s 0x%-10x0x%-10x%s * %s\n", |
1326 | tbuf, hatype, ATF_PUBL | ATF_PERM, "00:00:00:00:00:00", | 1326 | tbuf, hatype, ATF_PUBL | ATF_PERM, "00:00:00:00:00:00", |
1327 | dev ? dev->name : "*"); | 1327 | dev ? dev->name : "*"); |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 5cb72786a8af..ec0ae490f0b6 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -2399,8 +2399,8 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v) | |||
2399 | __be32 prf = htonl(mask_pfx(tn->key, tn->pos)); | 2399 | __be32 prf = htonl(mask_pfx(tn->key, tn->pos)); |
2400 | 2400 | ||
2401 | seq_indent(seq, iter->depth-1); | 2401 | seq_indent(seq, iter->depth-1); |
2402 | seq_printf(seq, " +-- " NIPQUAD_FMT "/%d %d %d %d\n", | 2402 | seq_printf(seq, " +-- %pI4/%d %d %d %d\n", |
2403 | NIPQUAD(prf), tn->pos, tn->bits, tn->full_children, | 2403 | &prf, tn->pos, tn->bits, tn->full_children, |
2404 | tn->empty_children); | 2404 | tn->empty_children); |
2405 | 2405 | ||
2406 | } else { | 2406 | } else { |
@@ -2410,7 +2410,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v) | |||
2410 | __be32 val = htonl(l->key); | 2410 | __be32 val = htonl(l->key); |
2411 | 2411 | ||
2412 | seq_indent(seq, iter->depth); | 2412 | seq_indent(seq, iter->depth); |
2413 | seq_printf(seq, " |-- " NIPQUAD_FMT "\n", NIPQUAD(val)); | 2413 | seq_printf(seq, " |-- %pI4\n", &val); |
2414 | 2414 | ||
2415 | hlist_for_each_entry_rcu(li, node, &l->list, hlist) { | 2415 | hlist_for_each_entry_rcu(li, node, &l->list, hlist) { |
2416 | struct fib_alias *fa; | 2416 | struct fib_alias *fa; |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index e9d6ea0b49ca..21e497efbd7f 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -683,10 +683,8 @@ static void icmp_unreach(struct sk_buff *skb) | |||
683 | break; | 683 | break; |
684 | case ICMP_FRAG_NEEDED: | 684 | case ICMP_FRAG_NEEDED: |
685 | if (ipv4_config.no_pmtu_disc) { | 685 | if (ipv4_config.no_pmtu_disc) { |
686 | LIMIT_NETDEBUG(KERN_INFO "ICMP: " NIPQUAD_FMT ": " | 686 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set.\n", |
687 | "fragmentation needed " | 687 | &iph->daddr); |
688 | "and DF set.\n", | ||
689 | NIPQUAD(iph->daddr)); | ||
690 | } else { | 688 | } else { |
691 | info = ip_rt_frag_needed(net, iph, | 689 | info = ip_rt_frag_needed(net, iph, |
692 | ntohs(icmph->un.frag.mtu), | 690 | ntohs(icmph->un.frag.mtu), |
@@ -696,9 +694,8 @@ static void icmp_unreach(struct sk_buff *skb) | |||
696 | } | 694 | } |
697 | break; | 695 | break; |
698 | case ICMP_SR_FAILED: | 696 | case ICMP_SR_FAILED: |
699 | LIMIT_NETDEBUG(KERN_INFO "ICMP: " NIPQUAD_FMT ": Source " | 697 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed.\n", |
700 | "Route Failed.\n", | 698 | &iph->daddr); |
701 | NIPQUAD(iph->daddr)); | ||
702 | break; | 699 | break; |
703 | default: | 700 | default: |
704 | break; | 701 | break; |
@@ -729,12 +726,12 @@ static void icmp_unreach(struct sk_buff *skb) | |||
729 | if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses && | 726 | if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses && |
730 | inet_addr_type(net, iph->daddr) == RTN_BROADCAST) { | 727 | inet_addr_type(net, iph->daddr) == RTN_BROADCAST) { |
731 | if (net_ratelimit()) | 728 | if (net_ratelimit()) |
732 | printk(KERN_WARNING NIPQUAD_FMT " sent an invalid ICMP " | 729 | printk(KERN_WARNING "%pI4 sent an invalid ICMP " |
733 | "type %u, code %u " | 730 | "type %u, code %u " |
734 | "error to a broadcast: " NIPQUAD_FMT " on %s\n", | 731 | "error to a broadcast: %pI4 on %s\n", |
735 | NIPQUAD(ip_hdr(skb)->saddr), | 732 | &ip_hdr(skb)->saddr, |
736 | icmph->type, icmph->code, | 733 | icmph->type, icmph->code, |
737 | NIPQUAD(iph->daddr), | 734 | &iph->daddr, |
738 | skb->dev->name); | 735 | skb->dev->name); |
739 | goto out; | 736 | goto out; |
740 | } | 737 | } |
@@ -952,9 +949,8 @@ static void icmp_address_reply(struct sk_buff *skb) | |||
952 | break; | 949 | break; |
953 | } | 950 | } |
954 | if (!ifa && net_ratelimit()) { | 951 | if (!ifa && net_ratelimit()) { |
955 | printk(KERN_INFO "Wrong address mask " NIPQUAD_FMT " from " | 952 | printk(KERN_INFO "Wrong address mask %pI4 from %s/%pI4\n", |
956 | "%s/" NIPQUAD_FMT "\n", | 953 | mp, dev->name, &rt->rt_src); |
957 | NIPQUAD(*mp), dev->name, NIPQUAD(rt->rt_src)); | ||
958 | } | 954 | } |
959 | } | 955 | } |
960 | rcu_read_unlock(); | 956 | rcu_read_unlock(); |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index e4f81f54befe..8c495e34d563 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -559,9 +559,8 @@ out_nomem: | |||
559 | goto out_fail; | 559 | goto out_fail; |
560 | out_oversize: | 560 | out_oversize: |
561 | if (net_ratelimit()) | 561 | if (net_ratelimit()) |
562 | printk(KERN_INFO | 562 | printk(KERN_INFO "Oversized IP packet from %pI4.\n", |
563 | "Oversized IP packet from " NIPQUAD_FMT ".\n", | 563 | &qp->saddr); |
564 | NIPQUAD(qp->saddr)); | ||
565 | out_fail: | 564 | out_fail: |
566 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMFAILS); | 565 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMFAILS); |
567 | return err; | 566 | return err; |
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 861978a4f1a8..1b6475c05eb4 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -294,10 +294,8 @@ static inline int ip_rcv_options(struct sk_buff *skb) | |||
294 | if (!IN_DEV_SOURCE_ROUTE(in_dev)) { | 294 | if (!IN_DEV_SOURCE_ROUTE(in_dev)) { |
295 | if (IN_DEV_LOG_MARTIANS(in_dev) && | 295 | if (IN_DEV_LOG_MARTIANS(in_dev) && |
296 | net_ratelimit()) | 296 | net_ratelimit()) |
297 | printk(KERN_INFO "source route option " | 297 | printk(KERN_INFO "source route option %pI4 -> %pI4\n", |
298 | NIPQUAD_FMT " -> " NIPQUAD_FMT "\n", | 298 | &iph->saddr, &iph->daddr); |
299 | NIPQUAD(iph->saddr), | ||
300 | NIPQUAD(iph->daddr)); | ||
301 | in_dev_put(in_dev); | 299 | in_dev_put(in_dev); |
302 | goto drop; | 300 | goto drop; |
303 | } | 301 | } |
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 38ccb6dfb02e..ec8264ae45c2 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -39,8 +39,8 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info) | |||
39 | spi, IPPROTO_COMP, AF_INET); | 39 | spi, IPPROTO_COMP, AF_INET); |
40 | if (!x) | 40 | if (!x) |
41 | return; | 41 | return; |
42 | NETDEBUG(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/" NIPQUAD_FMT "\n", | 42 | NETDEBUG(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI4\n", |
43 | spi, NIPQUAD(iph->daddr)); | 43 | spi, &iph->daddr); |
44 | xfrm_state_put(x); | 44 | xfrm_state_put(x); |
45 | } | 45 | } |
46 | 46 | ||
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 42065fff46c4..42a0f3dd3fd6 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -374,7 +374,7 @@ static int __init ic_defaults(void) | |||
374 | */ | 374 | */ |
375 | 375 | ||
376 | if (!ic_host_name_set) | 376 | if (!ic_host_name_set) |
377 | sprintf(init_utsname()->nodename, NIPQUAD_FMT, NIPQUAD(ic_myaddr)); | 377 | sprintf(init_utsname()->nodename, "%pI4", &ic_myaddr); |
378 | 378 | ||
379 | if (root_server_addr == NONE) | 379 | if (root_server_addr == NONE) |
380 | root_server_addr = ic_servaddr; | 380 | root_server_addr = ic_servaddr; |
@@ -387,11 +387,11 @@ static int __init ic_defaults(void) | |||
387 | else if (IN_CLASSC(ntohl(ic_myaddr))) | 387 | else if (IN_CLASSC(ntohl(ic_myaddr))) |
388 | ic_netmask = htonl(IN_CLASSC_NET); | 388 | ic_netmask = htonl(IN_CLASSC_NET); |
389 | else { | 389 | else { |
390 | printk(KERN_ERR "IP-Config: Unable to guess netmask for address " NIPQUAD_FMT "\n", | 390 | printk(KERN_ERR "IP-Config: Unable to guess netmask for address %pI4\n", |
391 | NIPQUAD(ic_myaddr)); | 391 | &ic_myaddr); |
392 | return -1; | 392 | return -1; |
393 | } | 393 | } |
394 | printk("IP-Config: Guessing netmask " NIPQUAD_FMT "\n", NIPQUAD(ic_netmask)); | 394 | printk("IP-Config: Guessing netmask %pI4\n", &ic_netmask); |
395 | } | 395 | } |
396 | 396 | ||
397 | return 0; | 397 | return 0; |
@@ -979,10 +979,8 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
979 | ic_myaddr = b->your_ip; | 979 | ic_myaddr = b->your_ip; |
980 | ic_servaddr = server_id; | 980 | ic_servaddr = server_id; |
981 | #ifdef IPCONFIG_DEBUG | 981 | #ifdef IPCONFIG_DEBUG |
982 | printk("DHCP: Offered address " NIPQUAD_FMT, | 982 | printk("DHCP: Offered address %pI4 by server %pI4\n", |
983 | NIPQUAD(ic_myaddr)); | 983 | &ic_myaddr, &ic_servaddr); |
984 | printk(" by server " NIPQUAD_FMT "\n", | ||
985 | NIPQUAD(ic_servaddr)); | ||
986 | #endif | 984 | #endif |
987 | /* The DHCP indicated server address takes | 985 | /* The DHCP indicated server address takes |
988 | * precedence over the bootp header one if | 986 | * precedence over the bootp header one if |
@@ -1177,11 +1175,11 @@ static int __init ic_dynamic(void) | |||
1177 | return -1; | 1175 | return -1; |
1178 | } | 1176 | } |
1179 | 1177 | ||
1180 | printk("IP-Config: Got %s answer from " NIPQUAD_FMT ", ", | 1178 | printk("IP-Config: Got %s answer from %pI4, ", |
1181 | ((ic_got_reply & IC_RARP) ? "RARP" | 1179 | ((ic_got_reply & IC_RARP) ? "RARP" |
1182 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), | 1180 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), |
1183 | NIPQUAD(ic_servaddr)); | 1181 | &ic_servaddr); |
1184 | printk("my address is " NIPQUAD_FMT "\n", NIPQUAD(ic_myaddr)); | 1182 | printk("my address is %pI4\n", &ic_myaddr); |
1185 | 1183 | ||
1186 | return 0; | 1184 | return 0; |
1187 | } | 1185 | } |
@@ -1206,14 +1204,12 @@ static int pnp_seq_show(struct seq_file *seq, void *v) | |||
1206 | "domain %s\n", ic_domain); | 1204 | "domain %s\n", ic_domain); |
1207 | for (i = 0; i < CONF_NAMESERVERS_MAX; i++) { | 1205 | for (i = 0; i < CONF_NAMESERVERS_MAX; i++) { |
1208 | if (ic_nameservers[i] != NONE) | 1206 | if (ic_nameservers[i] != NONE) |
1209 | seq_printf(seq, | 1207 | seq_printf(seq, "nameserver %pI4\n", |
1210 | "nameserver " NIPQUAD_FMT "\n", | 1208 | &ic_nameservers[i]); |
1211 | NIPQUAD(ic_nameservers[i])); | ||
1212 | } | 1209 | } |
1213 | if (ic_servaddr != NONE) | 1210 | if (ic_servaddr != NONE) |
1214 | seq_printf(seq, | 1211 | seq_printf(seq, "bootserver %pI4\n", |
1215 | "bootserver " NIPQUAD_FMT "\n", | 1212 | &ic_servaddr); |
1216 | NIPQUAD(ic_servaddr)); | ||
1217 | return 0; | 1213 | return 0; |
1218 | } | 1214 | } |
1219 | 1215 | ||
@@ -1387,13 +1383,13 @@ static int __init ip_auto_config(void) | |||
1387 | */ | 1383 | */ |
1388 | printk("IP-Config: Complete:"); | 1384 | printk("IP-Config: Complete:"); |
1389 | printk("\n device=%s", ic_dev->name); | 1385 | printk("\n device=%s", ic_dev->name); |
1390 | printk(", addr=" NIPQUAD_FMT, NIPQUAD(ic_myaddr)); | 1386 | printk(", addr=%pI4", &ic_myaddr); |
1391 | printk(", mask=" NIPQUAD_FMT, NIPQUAD(ic_netmask)); | 1387 | printk(", mask=%pI4", &ic_netmask); |
1392 | printk(", gw=" NIPQUAD_FMT, NIPQUAD(ic_gateway)); | 1388 | printk(", gw=%pI4", &ic_gateway); |
1393 | printk(",\n host=%s, domain=%s, nis-domain=%s", | 1389 | printk(",\n host=%s, domain=%s, nis-domain=%s", |
1394 | utsname()->nodename, ic_domain, utsname()->domainname); | 1390 | utsname()->nodename, ic_domain, utsname()->domainname); |
1395 | printk(",\n bootserver=" NIPQUAD_FMT, NIPQUAD(ic_servaddr)); | 1391 | printk(",\n bootserver=%pI4", &ic_servaddr); |
1396 | printk(", rootserver=" NIPQUAD_FMT, NIPQUAD(root_server_addr)); | 1392 | printk(", rootserver=%pI4", &root_server_addr); |
1397 | printk(", rootpath=%s", root_server_path); | 1393 | printk(", rootpath=%s", root_server_path); |
1398 | printk("\n"); | 1394 | printk("\n"); |
1399 | #endif /* !SILENT */ | 1395 | #endif /* !SILENT */ |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index e59b4dcf6778..f47b9db0db7f 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1214,10 +1214,9 @@ restart: | |||
1214 | #if RT_CACHE_DEBUG >= 2 | 1214 | #if RT_CACHE_DEBUG >= 2 |
1215 | if (rt->u.dst.rt_next) { | 1215 | if (rt->u.dst.rt_next) { |
1216 | struct rtable *trt; | 1216 | struct rtable *trt; |
1217 | printk(KERN_DEBUG "rt_cache @%02x: " NIPQUAD_FMT, hash, | 1217 | printk(KERN_DEBUG "rt_cache @%02x: %pI4", hash, &rt->rt_dst); |
1218 | NIPQUAD(rt->rt_dst)); | ||
1219 | for (trt = rt->u.dst.rt_next; trt; trt = trt->u.dst.rt_next) | 1218 | for (trt = rt->u.dst.rt_next; trt; trt = trt->u.dst.rt_next) |
1220 | printk(" . " NIPQUAD_FMT, NIPQUAD(trt->rt_dst)); | 1219 | printk(" . %pI4", &trt->rt_dst); |
1221 | printk("\n"); | 1220 | printk("\n"); |
1222 | } | 1221 | } |
1223 | #endif | 1222 | #endif |
@@ -1444,11 +1443,10 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
1444 | reject_redirect: | 1443 | reject_redirect: |
1445 | #ifdef CONFIG_IP_ROUTE_VERBOSE | 1444 | #ifdef CONFIG_IP_ROUTE_VERBOSE |
1446 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) | 1445 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) |
1447 | printk(KERN_INFO "Redirect from " NIPQUAD_FMT " on %s about " | 1446 | printk(KERN_INFO "Redirect from %pI4 on %s about %pI4 ignored.\n" |
1448 | NIPQUAD_FMT " ignored.\n" | 1447 | " Advised path = %pI4 -> %pI4\n", |
1449 | " Advised path = " NIPQUAD_FMT " -> " NIPQUAD_FMT "\n", | 1448 | &old_gw, dev->name, &new_gw, |
1450 | NIPQUAD(old_gw), dev->name, NIPQUAD(new_gw), | 1449 | &saddr, &daddr); |
1451 | NIPQUAD(saddr), NIPQUAD(daddr)); | ||
1452 | #endif | 1450 | #endif |
1453 | in_dev_put(in_dev); | 1451 | in_dev_put(in_dev); |
1454 | } | 1452 | } |
@@ -1468,9 +1466,8 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst) | |||
1468 | rt->fl.oif, | 1466 | rt->fl.oif, |
1469 | rt_genid(dev_net(dst->dev))); | 1467 | rt_genid(dev_net(dst->dev))); |
1470 | #if RT_CACHE_DEBUG >= 1 | 1468 | #if RT_CACHE_DEBUG >= 1 |
1471 | printk(KERN_DEBUG "ipv4_negative_advice: redirect to " | 1469 | printk(KERN_DEBUG "ipv4_negative_advice: redirect to %pI4/%02x dropped\n", |
1472 | NIPQUAD_FMT "/%02x dropped\n", | 1470 | &rt->rt_dst, rt->fl.fl4_tos); |
1473 | NIPQUAD(rt->rt_dst), rt->fl.fl4_tos); | ||
1474 | #endif | 1471 | #endif |
1475 | rt_del(hash, rt); | 1472 | rt_del(hash, rt); |
1476 | ret = NULL; | 1473 | ret = NULL; |
@@ -1534,10 +1531,9 @@ void ip_rt_send_redirect(struct sk_buff *skb) | |||
1534 | if (IN_DEV_LOG_MARTIANS(in_dev) && | 1531 | if (IN_DEV_LOG_MARTIANS(in_dev) && |
1535 | rt->u.dst.rate_tokens == ip_rt_redirect_number && | 1532 | rt->u.dst.rate_tokens == ip_rt_redirect_number && |
1536 | net_ratelimit()) | 1533 | net_ratelimit()) |
1537 | printk(KERN_WARNING "host " NIPQUAD_FMT "/if%d ignores " | 1534 | printk(KERN_WARNING "host %pI4/if%d ignores redirects for %pI4 to %pI4.\n", |
1538 | "redirects for " NIPQUAD_FMT " to " NIPQUAD_FMT ".\n", | 1535 | &rt->rt_src, rt->rt_iif, |
1539 | NIPQUAD(rt->rt_src), rt->rt_iif, | 1536 | &rt->rt_dst, &rt->rt_gateway); |
1540 | NIPQUAD(rt->rt_dst), NIPQUAD(rt->rt_gateway)); | ||
1541 | #endif | 1537 | #endif |
1542 | } | 1538 | } |
1543 | out: | 1539 | out: |
@@ -1730,8 +1726,8 @@ static void ipv4_link_failure(struct sk_buff *skb) | |||
1730 | 1726 | ||
1731 | static int ip_rt_bug(struct sk_buff *skb) | 1727 | static int ip_rt_bug(struct sk_buff *skb) |
1732 | { | 1728 | { |
1733 | printk(KERN_DEBUG "ip_rt_bug: " NIPQUAD_FMT " -> " NIPQUAD_FMT ", %s\n", | 1729 | printk(KERN_DEBUG "ip_rt_bug: %pI4 -> %pI4, %s\n", |
1734 | NIPQUAD(ip_hdr(skb)->saddr), NIPQUAD(ip_hdr(skb)->daddr), | 1730 | &ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, |
1735 | skb->dev ? skb->dev->name : "?"); | 1731 | skb->dev ? skb->dev->name : "?"); |
1736 | kfree_skb(skb); | 1732 | kfree_skb(skb); |
1737 | return 0; | 1733 | return 0; |
@@ -1908,9 +1904,8 @@ static void ip_handle_martian_source(struct net_device *dev, | |||
1908 | * RFC1812 recommendation, if source is martian, | 1904 | * RFC1812 recommendation, if source is martian, |
1909 | * the only hint is MAC header. | 1905 | * the only hint is MAC header. |
1910 | */ | 1906 | */ |
1911 | printk(KERN_WARNING "martian source " NIPQUAD_FMT " from " | 1907 | printk(KERN_WARNING "martian source %pI4 from %pI4, on dev %s\n", |
1912 | NIPQUAD_FMT", on dev %s\n", | 1908 | &daddr, &saddr, dev->name); |
1913 | NIPQUAD(daddr), NIPQUAD(saddr), dev->name); | ||
1914 | if (dev->hard_header_len && skb_mac_header_was_set(skb)) { | 1909 | if (dev->hard_header_len && skb_mac_header_was_set(skb)) { |
1915 | int i; | 1910 | int i; |
1916 | const unsigned char *p = skb_mac_header(skb); | 1911 | const unsigned char *p = skb_mac_header(skb); |
@@ -2219,9 +2214,8 @@ martian_destination: | |||
2219 | RT_CACHE_STAT_INC(in_martian_dst); | 2214 | RT_CACHE_STAT_INC(in_martian_dst); |
2220 | #ifdef CONFIG_IP_ROUTE_VERBOSE | 2215 | #ifdef CONFIG_IP_ROUTE_VERBOSE |
2221 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) | 2216 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) |
2222 | printk(KERN_WARNING "martian destination " NIPQUAD_FMT " from " | 2217 | printk(KERN_WARNING "martian destination %pI4 from %pI4, dev %s\n", |
2223 | NIPQUAD_FMT ", dev %s\n", | 2218 | &daddr, &saddr, dev->name); |
2224 | NIPQUAD(daddr), NIPQUAD(saddr), dev->name); | ||
2225 | #endif | 2219 | #endif |
2226 | 2220 | ||
2227 | e_hostunreach: | 2221 | e_hostunreach: |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 04909e4b3c4c..097294b7da3e 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2336,9 +2336,9 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
2336 | struct inet_sock *inet = inet_sk(sk); | 2336 | struct inet_sock *inet = inet_sk(sk); |
2337 | 2337 | ||
2338 | if (sk->sk_family == AF_INET) { | 2338 | if (sk->sk_family == AF_INET) { |
2339 | printk(KERN_DEBUG "Undo %s " NIPQUAD_FMT "/%u c%u l%u ss%u/%u p%u\n", | 2339 | printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n", |
2340 | msg, | 2340 | msg, |
2341 | NIPQUAD(inet->daddr), ntohs(inet->dport), | 2341 | &inet->daddr, ntohs(inet->dport), |
2342 | tp->snd_cwnd, tcp_left_out(tp), | 2342 | tp->snd_cwnd, tcp_left_out(tp), |
2343 | tp->snd_ssthresh, tp->prior_ssthresh, | 2343 | tp->snd_ssthresh, tp->prior_ssthresh, |
2344 | tp->packets_out); | 2344 | tp->packets_out); |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 5c8fa7f1e327..ef33246e6a6f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1139,10 +1139,9 @@ static int tcp_v4_inbound_md5_hash(struct sock *sk, struct sk_buff *skb) | |||
1139 | 1139 | ||
1140 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { | 1140 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { |
1141 | if (net_ratelimit()) { | 1141 | if (net_ratelimit()) { |
1142 | printk(KERN_INFO "MD5 Hash failed for " | 1142 | printk(KERN_INFO "MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", |
1143 | "(" NIPQUAD_FMT ", %d)->(" NIPQUAD_FMT ", %d)%s\n", | 1143 | &iph->saddr, ntohs(th->source), |
1144 | NIPQUAD(iph->saddr), ntohs(th->source), | 1144 | &iph->daddr, ntohs(th->dest), |
1145 | NIPQUAD(iph->daddr), ntohs(th->dest), | ||
1146 | genhash ? " tcp_v4_calc_md5_hash failed" : ""); | 1145 | genhash ? " tcp_v4_calc_md5_hash failed" : ""); |
1147 | } | 1146 | } |
1148 | return 1; | 1147 | return 1; |
@@ -1297,10 +1296,8 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1297 | * to destinations, already remembered | 1296 | * to destinations, already remembered |
1298 | * to the moment of synflood. | 1297 | * to the moment of synflood. |
1299 | */ | 1298 | */ |
1300 | LIMIT_NETDEBUG(KERN_DEBUG "TCP: drop open " | 1299 | LIMIT_NETDEBUG(KERN_DEBUG "TCP: drop open request from %pI4/%u\n", |
1301 | "request from " NIPQUAD_FMT "/%u\n", | 1300 | &saddr, ntohs(tcp_hdr(skb)->source)); |
1302 | NIPQUAD(saddr), | ||
1303 | ntohs(tcp_hdr(skb)->source)); | ||
1304 | goto drop_and_release; | 1301 | goto drop_and_release; |
1305 | } | 1302 | } |
1306 | 1303 | ||
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 7ddc30f0744f..25524d4e372a 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c | |||
@@ -153,12 +153,11 @@ static int tcpprobe_sprint(char *tbuf, int n) | |||
153 | = ktime_to_timespec(ktime_sub(p->tstamp, tcp_probe.start)); | 153 | = ktime_to_timespec(ktime_sub(p->tstamp, tcp_probe.start)); |
154 | 154 | ||
155 | return snprintf(tbuf, n, | 155 | return snprintf(tbuf, n, |
156 | "%lu.%09lu " NIPQUAD_FMT ":%u " NIPQUAD_FMT ":%u" | 156 | "%lu.%09lu %pI4:%u %pI4:%u %d %#x %#x %u %u %u %u\n", |
157 | " %d %#x %#x %u %u %u %u\n", | ||
158 | (unsigned long) tv.tv_sec, | 157 | (unsigned long) tv.tv_sec, |
159 | (unsigned long) tv.tv_nsec, | 158 | (unsigned long) tv.tv_nsec, |
160 | NIPQUAD(p->saddr), ntohs(p->sport), | 159 | &p->saddr, ntohs(p->sport), |
161 | NIPQUAD(p->daddr), ntohs(p->dport), | 160 | &p->daddr, ntohs(p->dport), |
162 | p->length, p->snd_nxt, p->snd_una, | 161 | p->length, p->snd_nxt, p->snd_una, |
163 | p->snd_cwnd, p->ssthresh, p->snd_wnd, p->srtt); | 162 | p->snd_cwnd, p->ssthresh, p->snd_wnd, p->srtt); |
164 | } | 163 | } |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 979c9d604eb0..9843f6cb40a5 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -299,8 +299,8 @@ static void tcp_retransmit_timer(struct sock *sk) | |||
299 | #ifdef TCP_DEBUG | 299 | #ifdef TCP_DEBUG |
300 | struct inet_sock *inet = inet_sk(sk); | 300 | struct inet_sock *inet = inet_sk(sk); |
301 | if (sk->sk_family == AF_INET) { | 301 | if (sk->sk_family == AF_INET) { |
302 | LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer " NIPQUAD_FMT ":%u/%u shrinks window %u:%u. Repaired.\n", | 302 | LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer %pI4:%u/%u shrinks window %u:%u. Repaired.\n", |
303 | NIPQUAD(inet->daddr), ntohs(inet->dport), | 303 | &inet->daddr, ntohs(inet->dport), |
304 | inet->num, tp->snd_una, tp->snd_nxt); | 304 | inet->num, tp->snd_una, tp->snd_nxt); |
305 | } | 305 | } |
306 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 306 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index f760b86e7530..bcb5def2b09e 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1263,13 +1263,13 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
1263 | return 0; | 1263 | return 0; |
1264 | 1264 | ||
1265 | short_packet: | 1265 | short_packet: |
1266 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: short packet: From " NIPQUAD_FMT ":%u %d/%d to " NIPQUAD_FMT ":%u\n", | 1266 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n", |
1267 | proto == IPPROTO_UDPLITE ? "-Lite" : "", | 1267 | proto == IPPROTO_UDPLITE ? "-Lite" : "", |
1268 | NIPQUAD(saddr), | 1268 | &saddr, |
1269 | ntohs(uh->source), | 1269 | ntohs(uh->source), |
1270 | ulen, | 1270 | ulen, |
1271 | skb->len, | 1271 | skb->len, |
1272 | NIPQUAD(daddr), | 1272 | &daddr, |
1273 | ntohs(uh->dest)); | 1273 | ntohs(uh->dest)); |
1274 | goto drop; | 1274 | goto drop; |
1275 | 1275 | ||
@@ -1278,11 +1278,11 @@ csum_error: | |||
1278 | * RFC1122: OK. Discards the bad packet silently (as far as | 1278 | * RFC1122: OK. Discards the bad packet silently (as far as |
1279 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). | 1279 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). |
1280 | */ | 1280 | */ |
1281 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: bad checksum. From " NIPQUAD_FMT ":%u to " NIPQUAD_FMT ":%u ulen %d\n", | 1281 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n", |
1282 | proto == IPPROTO_UDPLITE ? "-Lite" : "", | 1282 | proto == IPPROTO_UDPLITE ? "-Lite" : "", |
1283 | NIPQUAD(saddr), | 1283 | &saddr, |
1284 | ntohs(uh->source), | 1284 | ntohs(uh->source), |
1285 | NIPQUAD(daddr), | 1285 | &daddr, |
1286 | ntohs(uh->dest), | 1286 | ntohs(uh->dest), |
1287 | ulen); | 1287 | ulen); |
1288 | drop: | 1288 | drop: |
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index 02885e8bb69b..7c668c63f708 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
@@ -424,9 +424,8 @@ ip6t_log_packet(u_int8_t pf, | |||
424 | if (skb->dev->type == ARPHRD_SIT) { | 424 | if (skb->dev->type == ARPHRD_SIT) { |
425 | const struct iphdr *iph = | 425 | const struct iphdr *iph = |
426 | (struct iphdr *)skb_mac_header(skb); | 426 | (struct iphdr *)skb_mac_header(skb); |
427 | printk("TUNNEL=%u.%u.%u.%u->%u.%u.%u.%u ", | 427 | printk("TUNNEL=%pI4->%pI4 ", |
428 | NIPQUAD(iph->saddr), | 428 | &iph->saddr, &iph->daddr); |
429 | NIPQUAD(iph->daddr)); | ||
430 | } | 429 | } |
431 | } else | 430 | } else |
432 | printk(" "); | 431 | printk(" "); |