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/ipv4/route.c | |
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/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 40 |
1 files changed, 17 insertions, 23 deletions
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: |