diff options
author | Joe Perches <joe@perches.com> | 2012-03-11 14:36:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-12 02:42:51 -0400 |
commit | 058bd4d2a4ff0aaa4a5381c67e776729d840c785 (patch) | |
tree | 4d1ea864a8740676c7e7c5a03cdaa67fc5f29418 /net/ipv4/icmp.c | |
parent | 43db362d3adda9e0a915ddb9a8d1a41186e19179 (diff) |
net: Convert printks to pr_<level>
Use a more current kernel messaging style.
Convert a printk block to print_hex_dump.
Coalesce formats, align arguments.
Use %s, __func__ instead of embedding function names.
Some messages that were prefixed with <foo>_close are
now prefixed with <foo>_fini. Some ah4 and esp messages
are now not prefixed with "ip ".
The intent of this patch is to later add something like
#define pr_fmt(fmt) "IPv4: " fmt.
to standardize the output messages.
Text size is trivially reduced. (x86-32 allyesconfig)
$ size net/ipv4/built-in.o*
text data bss dec hex filename
887888 31558 249696 1169142 11d6f6 net/ipv4/built-in.o.new
887934 31558 249800 1169292 11d78c net/ipv4/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index ab188ae12fd9..5c7323b7810f 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -670,7 +670,7 @@ static void icmp_unreach(struct sk_buff *skb) | |||
670 | break; | 670 | break; |
671 | case ICMP_FRAG_NEEDED: | 671 | case ICMP_FRAG_NEEDED: |
672 | if (ipv4_config.no_pmtu_disc) { | 672 | if (ipv4_config.no_pmtu_disc) { |
673 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set.\n", | 673 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set\n", |
674 | &iph->daddr); | 674 | &iph->daddr); |
675 | } else { | 675 | } else { |
676 | info = ip_rt_frag_needed(net, iph, | 676 | info = ip_rt_frag_needed(net, iph, |
@@ -681,7 +681,7 @@ static void icmp_unreach(struct sk_buff *skb) | |||
681 | } | 681 | } |
682 | break; | 682 | break; |
683 | case ICMP_SR_FAILED: | 683 | case ICMP_SR_FAILED: |
684 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed.\n", | 684 | LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed\n", |
685 | &iph->daddr); | 685 | &iph->daddr); |
686 | break; | 686 | break; |
687 | default: | 687 | default: |
@@ -713,13 +713,10 @@ static void icmp_unreach(struct sk_buff *skb) | |||
713 | if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses && | 713 | if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses && |
714 | inet_addr_type(net, iph->daddr) == RTN_BROADCAST) { | 714 | inet_addr_type(net, iph->daddr) == RTN_BROADCAST) { |
715 | if (net_ratelimit()) | 715 | if (net_ratelimit()) |
716 | printk(KERN_WARNING "%pI4 sent an invalid ICMP " | 716 | pr_warn("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n", |
717 | "type %u, code %u " | 717 | &ip_hdr(skb)->saddr, |
718 | "error to a broadcast: %pI4 on %s\n", | 718 | icmph->type, icmph->code, |
719 | &ip_hdr(skb)->saddr, | 719 | &iph->daddr, skb->dev->name); |
720 | icmph->type, icmph->code, | ||
721 | &iph->daddr, | ||
722 | skb->dev->name); | ||
723 | goto out; | 720 | goto out; |
724 | } | 721 | } |
725 | 722 | ||
@@ -946,8 +943,8 @@ static void icmp_address_reply(struct sk_buff *skb) | |||
946 | break; | 943 | break; |
947 | } | 944 | } |
948 | if (!ifa && net_ratelimit()) { | 945 | if (!ifa && net_ratelimit()) { |
949 | printk(KERN_INFO "Wrong address mask %pI4 from %s/%pI4\n", | 946 | pr_info("Wrong address mask %pI4 from %s/%pI4\n", |
950 | mp, dev->name, &ip_hdr(skb)->saddr); | 947 | mp, dev->name, &ip_hdr(skb)->saddr); |
951 | } | 948 | } |
952 | } | 949 | } |
953 | } | 950 | } |