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 | |
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>
-rw-r--r-- | net/ipv4/af_inet.c | 25 | ||||
-rw-r--r-- | net/ipv4/ah4.c | 14 | ||||
-rw-r--r-- | net/ipv4/esp4.c | 8 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 6 | ||||
-rw-r--r-- | net/ipv4/fib_semantics.c | 2 | ||||
-rw-r--r-- | net/ipv4/fib_trie.c | 5 | ||||
-rw-r--r-- | net/ipv4/icmp.c | 19 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 3 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 6 | ||||
-rw-r--r-- | net/ipv4/ip_input.c | 4 | ||||
-rw-r--r-- | net/ipv4/ip_options.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipcomp.c | 8 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 110 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 4 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 4 | ||||
-rw-r--r-- | net/ipv4/ping.c | 18 | ||||
-rw-r--r-- | net/ipv4/raw.c | 7 | ||||
-rw-r--r-- | net/ipv4/route.c | 43 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_cong.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 8 | ||||
-rw-r--r-- | net/ipv4/tunnel4.c | 8 | ||||
-rw-r--r-- | net/ipv4/udplite.c | 4 | ||||
-rw-r--r-- | net/ipv4/xfrm4_tunnel.c | 14 |
25 files changed, 163 insertions, 181 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index e588a34e85c2..b7a946611f2f 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1085,13 +1085,11 @@ out: | |||
1085 | return; | 1085 | return; |
1086 | 1086 | ||
1087 | out_permanent: | 1087 | out_permanent: |
1088 | printk(KERN_ERR "Attempt to override permanent protocol %d.\n", | 1088 | pr_err("Attempt to override permanent protocol %d\n", protocol); |
1089 | protocol); | ||
1090 | goto out; | 1089 | goto out; |
1091 | 1090 | ||
1092 | out_illegal: | 1091 | out_illegal: |
1093 | printk(KERN_ERR | 1092 | pr_err("Ignoring attempt to register invalid socket type %d\n", |
1094 | "Ignoring attempt to register invalid socket type %d.\n", | ||
1095 | p->type); | 1093 | p->type); |
1096 | goto out; | 1094 | goto out; |
1097 | } | 1095 | } |
@@ -1100,8 +1098,7 @@ EXPORT_SYMBOL(inet_register_protosw); | |||
1100 | void inet_unregister_protosw(struct inet_protosw *p) | 1098 | void inet_unregister_protosw(struct inet_protosw *p) |
1101 | { | 1099 | { |
1102 | if (INET_PROTOSW_PERMANENT & p->flags) { | 1100 | if (INET_PROTOSW_PERMANENT & p->flags) { |
1103 | printk(KERN_ERR | 1101 | pr_err("Attempt to unregister permanent protocol %d\n", |
1104 | "Attempt to unregister permanent protocol %d.\n", | ||
1105 | p->protocol); | 1102 | p->protocol); |
1106 | } else { | 1103 | } else { |
1107 | spin_lock_bh(&inetsw_lock); | 1104 | spin_lock_bh(&inetsw_lock); |
@@ -1150,8 +1147,8 @@ static int inet_sk_reselect_saddr(struct sock *sk) | |||
1150 | return 0; | 1147 | return 0; |
1151 | 1148 | ||
1152 | if (sysctl_ip_dynaddr > 1) { | 1149 | if (sysctl_ip_dynaddr > 1) { |
1153 | printk(KERN_INFO "%s(): shifting inet->saddr from %pI4 to %pI4\n", | 1150 | pr_info("%s(): shifting inet->saddr from %pI4 to %pI4\n", |
1154 | __func__, &old_saddr, &new_saddr); | 1151 | __func__, &old_saddr, &new_saddr); |
1155 | } | 1152 | } |
1156 | 1153 | ||
1157 | inet->inet_saddr = inet->inet_rcv_saddr = new_saddr; | 1154 | inet->inet_saddr = inet->inet_rcv_saddr = new_saddr; |
@@ -1680,14 +1677,14 @@ static int __init inet_init(void) | |||
1680 | */ | 1677 | */ |
1681 | 1678 | ||
1682 | if (inet_add_protocol(&icmp_protocol, IPPROTO_ICMP) < 0) | 1679 | if (inet_add_protocol(&icmp_protocol, IPPROTO_ICMP) < 0) |
1683 | printk(KERN_CRIT "inet_init: Cannot add ICMP protocol\n"); | 1680 | pr_crit("%s: Cannot add ICMP protocol\n", __func__); |
1684 | if (inet_add_protocol(&udp_protocol, IPPROTO_UDP) < 0) | 1681 | if (inet_add_protocol(&udp_protocol, IPPROTO_UDP) < 0) |
1685 | printk(KERN_CRIT "inet_init: Cannot add UDP protocol\n"); | 1682 | pr_crit("%s: Cannot add UDP protocol\n", __func__); |
1686 | if (inet_add_protocol(&tcp_protocol, IPPROTO_TCP) < 0) | 1683 | if (inet_add_protocol(&tcp_protocol, IPPROTO_TCP) < 0) |
1687 | printk(KERN_CRIT "inet_init: Cannot add TCP protocol\n"); | 1684 | pr_crit("%s: Cannot add TCP protocol\n", __func__); |
1688 | #ifdef CONFIG_IP_MULTICAST | 1685 | #ifdef CONFIG_IP_MULTICAST |
1689 | if (inet_add_protocol(&igmp_protocol, IPPROTO_IGMP) < 0) | 1686 | if (inet_add_protocol(&igmp_protocol, IPPROTO_IGMP) < 0) |
1690 | printk(KERN_CRIT "inet_init: Cannot add IGMP protocol\n"); | 1687 | pr_crit("%s: Cannot add IGMP protocol\n", __func__); |
1691 | #endif | 1688 | #endif |
1692 | 1689 | ||
1693 | /* Register the socket-side information for inet_create. */ | 1690 | /* Register the socket-side information for inet_create. */ |
@@ -1734,14 +1731,14 @@ static int __init inet_init(void) | |||
1734 | */ | 1731 | */ |
1735 | #if defined(CONFIG_IP_MROUTE) | 1732 | #if defined(CONFIG_IP_MROUTE) |
1736 | if (ip_mr_init()) | 1733 | if (ip_mr_init()) |
1737 | printk(KERN_CRIT "inet_init: Cannot init ipv4 mroute\n"); | 1734 | pr_crit("%s: Cannot init ipv4 mroute\n", __func__); |
1738 | #endif | 1735 | #endif |
1739 | /* | 1736 | /* |
1740 | * Initialise per-cpu ipv4 mibs | 1737 | * Initialise per-cpu ipv4 mibs |
1741 | */ | 1738 | */ |
1742 | 1739 | ||
1743 | if (init_ipv4_mibs()) | 1740 | if (init_ipv4_mibs()) |
1744 | printk(KERN_CRIT "inet_init: Cannot init ipv4 mibs\n"); | 1741 | pr_crit("%s: Cannot init ipv4 mibs\n", __func__); |
1745 | 1742 | ||
1746 | ipv4_proc_init(); | 1743 | ipv4_proc_init(); |
1747 | 1744 | ||
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 36d14406261e..b5524660c81d 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -445,9 +445,9 @@ static int ah_init_state(struct xfrm_state *x) | |||
445 | 445 | ||
446 | if (aalg_desc->uinfo.auth.icv_fullbits/8 != | 446 | if (aalg_desc->uinfo.auth.icv_fullbits/8 != |
447 | crypto_ahash_digestsize(ahash)) { | 447 | crypto_ahash_digestsize(ahash)) { |
448 | printk(KERN_INFO "AH: %s digestsize %u != %hu\n", | 448 | pr_info("AH: %s digestsize %u != %hu\n", |
449 | x->aalg->alg_name, crypto_ahash_digestsize(ahash), | 449 | x->aalg->alg_name, crypto_ahash_digestsize(ahash), |
450 | aalg_desc->uinfo.auth.icv_fullbits/8); | 450 | aalg_desc->uinfo.auth.icv_fullbits/8); |
451 | goto error; | 451 | goto error; |
452 | } | 452 | } |
453 | 453 | ||
@@ -510,11 +510,11 @@ static const struct net_protocol ah4_protocol = { | |||
510 | static int __init ah4_init(void) | 510 | static int __init ah4_init(void) |
511 | { | 511 | { |
512 | if (xfrm_register_type(&ah_type, AF_INET) < 0) { | 512 | if (xfrm_register_type(&ah_type, AF_INET) < 0) { |
513 | printk(KERN_INFO "ip ah init: can't add xfrm type\n"); | 513 | pr_info("%s: can't add xfrm type\n", __func__); |
514 | return -EAGAIN; | 514 | return -EAGAIN; |
515 | } | 515 | } |
516 | if (inet_add_protocol(&ah4_protocol, IPPROTO_AH) < 0) { | 516 | if (inet_add_protocol(&ah4_protocol, IPPROTO_AH) < 0) { |
517 | printk(KERN_INFO "ip ah init: can't add protocol\n"); | 517 | pr_info("%s: can't add protocol\n", __func__); |
518 | xfrm_unregister_type(&ah_type, AF_INET); | 518 | xfrm_unregister_type(&ah_type, AF_INET); |
519 | return -EAGAIN; | 519 | return -EAGAIN; |
520 | } | 520 | } |
@@ -524,9 +524,9 @@ static int __init ah4_init(void) | |||
524 | static void __exit ah4_fini(void) | 524 | static void __exit ah4_fini(void) |
525 | { | 525 | { |
526 | if (inet_del_protocol(&ah4_protocol, IPPROTO_AH) < 0) | 526 | if (inet_del_protocol(&ah4_protocol, IPPROTO_AH) < 0) |
527 | printk(KERN_INFO "ip ah close: can't remove protocol\n"); | 527 | pr_info("%s: can't remove protocol\n", __func__); |
528 | if (xfrm_unregister_type(&ah_type, AF_INET) < 0) | 528 | if (xfrm_unregister_type(&ah_type, AF_INET) < 0) |
529 | printk(KERN_INFO "ip ah close: can't remove xfrm type\n"); | 529 | pr_info("%s: can't remove xfrm type\n", __func__); |
530 | } | 530 | } |
531 | 531 | ||
532 | module_init(ah4_init); | 532 | module_init(ah4_init); |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index a5b413416da3..0a86dbe9454b 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -706,11 +706,11 @@ static const struct net_protocol esp4_protocol = { | |||
706 | static int __init esp4_init(void) | 706 | static int __init esp4_init(void) |
707 | { | 707 | { |
708 | if (xfrm_register_type(&esp_type, AF_INET) < 0) { | 708 | if (xfrm_register_type(&esp_type, AF_INET) < 0) { |
709 | printk(KERN_INFO "ip esp init: can't add xfrm type\n"); | 709 | pr_info("%s: can't add xfrm type\n", __func__); |
710 | return -EAGAIN; | 710 | return -EAGAIN; |
711 | } | 711 | } |
712 | if (inet_add_protocol(&esp4_protocol, IPPROTO_ESP) < 0) { | 712 | if (inet_add_protocol(&esp4_protocol, IPPROTO_ESP) < 0) { |
713 | printk(KERN_INFO "ip esp init: can't add protocol\n"); | 713 | pr_info("%s: can't add protocol\n", __func__); |
714 | xfrm_unregister_type(&esp_type, AF_INET); | 714 | xfrm_unregister_type(&esp_type, AF_INET); |
715 | return -EAGAIN; | 715 | return -EAGAIN; |
716 | } | 716 | } |
@@ -720,9 +720,9 @@ static int __init esp4_init(void) | |||
720 | static void __exit esp4_fini(void) | 720 | static void __exit esp4_fini(void) |
721 | { | 721 | { |
722 | if (inet_del_protocol(&esp4_protocol, IPPROTO_ESP) < 0) | 722 | if (inet_del_protocol(&esp4_protocol, IPPROTO_ESP) < 0) |
723 | printk(KERN_INFO "ip esp close: can't remove protocol\n"); | 723 | pr_info("%s: can't remove protocol\n", __func__); |
724 | if (xfrm_unregister_type(&esp_type, AF_INET) < 0) | 724 | if (xfrm_unregister_type(&esp_type, AF_INET) < 0) |
725 | printk(KERN_INFO "ip esp close: can't remove xfrm type\n"); | 725 | pr_info("%s: can't remove xfrm type\n", __func__); |
726 | } | 726 | } |
727 | 727 | ||
728 | module_init(esp4_init); | 728 | module_init(esp4_init); |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 92fc5f69f5da..76e72bacc217 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -695,7 +695,7 @@ void fib_add_ifaddr(struct in_ifaddr *ifa) | |||
695 | if (ifa->ifa_flags & IFA_F_SECONDARY) { | 695 | if (ifa->ifa_flags & IFA_F_SECONDARY) { |
696 | prim = inet_ifa_byprefix(in_dev, prefix, mask); | 696 | prim = inet_ifa_byprefix(in_dev, prefix, mask); |
697 | if (prim == NULL) { | 697 | if (prim == NULL) { |
698 | printk(KERN_WARNING "fib_add_ifaddr: bug: prim == NULL\n"); | 698 | pr_warn("%s: bug: prim == NULL\n", __func__); |
699 | return; | 699 | return; |
700 | } | 700 | } |
701 | } | 701 | } |
@@ -749,11 +749,11 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim) | |||
749 | if (ifa->ifa_flags & IFA_F_SECONDARY) { | 749 | if (ifa->ifa_flags & IFA_F_SECONDARY) { |
750 | prim = inet_ifa_byprefix(in_dev, any, ifa->ifa_mask); | 750 | prim = inet_ifa_byprefix(in_dev, any, ifa->ifa_mask); |
751 | if (prim == NULL) { | 751 | if (prim == NULL) { |
752 | printk(KERN_WARNING "fib_del_ifaddr: bug: prim == NULL\n"); | 752 | pr_warn("%s: bug: prim == NULL\n", __func__); |
753 | return; | 753 | return; |
754 | } | 754 | } |
755 | if (iprim && iprim != prim) { | 755 | if (iprim && iprim != prim) { |
756 | printk(KERN_WARNING "fib_del_ifaddr: bug: iprim != prim\n"); | 756 | pr_warn("%s: bug: iprim != prim\n", __func__); |
757 | return; | 757 | return; |
758 | } | 758 | } |
759 | } else if (!ipv4_is_zeronet(any) && | 759 | } else if (!ipv4_is_zeronet(any) && |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 80106d89d548..a8c5c1d6715b 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -154,7 +154,7 @@ static void free_fib_info_rcu(struct rcu_head *head) | |||
154 | void free_fib_info(struct fib_info *fi) | 154 | void free_fib_info(struct fib_info *fi) |
155 | { | 155 | { |
156 | if (fi->fib_dead == 0) { | 156 | if (fi->fib_dead == 0) { |
157 | pr_warning("Freeing alive fib_info %p\n", fi); | 157 | pr_warn("Freeing alive fib_info %p\n", fi); |
158 | return; | 158 | return; |
159 | } | 159 | } |
160 | change_nexthops(fi) { | 160 | change_nexthops(fi) { |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 2b555a5521e0..da9b9cb2282d 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1170,9 +1170,8 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen) | |||
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | if (tp && tp->pos + tp->bits > 32) | 1172 | if (tp && tp->pos + tp->bits > 32) |
1173 | pr_warning("fib_trie" | 1173 | pr_warn("fib_trie tp=%p pos=%d, bits=%d, key=%0x plen=%d\n", |
1174 | " tp=%p pos=%d, bits=%d, key=%0x plen=%d\n", | 1174 | tp, tp->pos, tp->bits, key, plen); |
1175 | tp, tp->pos, tp->bits, key, plen); | ||
1176 | 1175 | ||
1177 | /* Rebalance the trie */ | 1176 | /* Rebalance the trie */ |
1178 | 1177 | ||
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 | } |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 1f23a57aa9e6..b2fd333abd59 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -643,8 +643,7 @@ out_nomem: | |||
643 | goto out_fail; | 643 | goto out_fail; |
644 | out_oversize: | 644 | out_oversize: |
645 | if (net_ratelimit()) | 645 | if (net_ratelimit()) |
646 | printk(KERN_INFO "Oversized IP packet from %pI4.\n", | 646 | pr_info("Oversized IP packet from %pI4\n", &qp->saddr); |
647 | &qp->saddr); | ||
648 | out_fail: | 647 | out_fail: |
649 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); | 648 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); |
650 | return err; | 649 | return err; |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 6ef66af12291..185e0a75ecec 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -1716,7 +1716,7 @@ static int __init ipgre_init(void) | |||
1716 | { | 1716 | { |
1717 | int err; | 1717 | int err; |
1718 | 1718 | ||
1719 | printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); | 1719 | pr_info("GRE over IPv4 tunneling driver\n"); |
1720 | 1720 | ||
1721 | err = register_pernet_device(&ipgre_net_ops); | 1721 | err = register_pernet_device(&ipgre_net_ops); |
1722 | if (err < 0) | 1722 | if (err < 0) |
@@ -1724,7 +1724,7 @@ static int __init ipgre_init(void) | |||
1724 | 1724 | ||
1725 | err = gre_add_protocol(&ipgre_protocol, GREPROTO_CISCO); | 1725 | err = gre_add_protocol(&ipgre_protocol, GREPROTO_CISCO); |
1726 | if (err < 0) { | 1726 | if (err < 0) { |
1727 | printk(KERN_INFO "ipgre init: can't add protocol\n"); | 1727 | pr_info("%s: can't add protocol\n", __func__); |
1728 | goto add_proto_failed; | 1728 | goto add_proto_failed; |
1729 | } | 1729 | } |
1730 | 1730 | ||
@@ -1753,7 +1753,7 @@ static void __exit ipgre_fini(void) | |||
1753 | rtnl_link_unregister(&ipgre_tap_ops); | 1753 | rtnl_link_unregister(&ipgre_tap_ops); |
1754 | rtnl_link_unregister(&ipgre_link_ops); | 1754 | rtnl_link_unregister(&ipgre_link_ops); |
1755 | if (gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO) < 0) | 1755 | if (gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO) < 0) |
1756 | printk(KERN_INFO "ipgre close: can't remove protocol\n"); | 1756 | pr_info("%s: can't remove protocol\n", __func__); |
1757 | unregister_pernet_device(&ipgre_net_ops); | 1757 | unregister_pernet_device(&ipgre_net_ops); |
1758 | } | 1758 | } |
1759 | 1759 | ||
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index bdaa2c5c28e4..de8e9be4aac8 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -299,8 +299,8 @@ static inline bool ip_rcv_options(struct sk_buff *skb) | |||
299 | if (!IN_DEV_SOURCE_ROUTE(in_dev)) { | 299 | if (!IN_DEV_SOURCE_ROUTE(in_dev)) { |
300 | if (IN_DEV_LOG_MARTIANS(in_dev) && | 300 | if (IN_DEV_LOG_MARTIANS(in_dev) && |
301 | net_ratelimit()) | 301 | net_ratelimit()) |
302 | printk(KERN_INFO "source route option %pI4 -> %pI4\n", | 302 | pr_info("source route option %pI4 -> %pI4\n", |
303 | &iph->saddr, &iph->daddr); | 303 | &iph->saddr, &iph->daddr); |
304 | goto drop; | 304 | goto drop; |
305 | } | 305 | } |
306 | } | 306 | } |
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 42dd1a90edea..e25ee7c8bdde 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -577,7 +577,7 @@ void ip_forward_options(struct sk_buff *skb) | |||
577 | ip_rt_get_source(&optptr[srrptr-1], skb, rt); | 577 | ip_rt_get_source(&optptr[srrptr-1], skb, rt); |
578 | optptr[2] = srrptr+4; | 578 | optptr[2] = srrptr+4; |
579 | } else if (net_ratelimit()) | 579 | } else if (net_ratelimit()) |
580 | printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n"); | 580 | pr_crit("%s(): Argh! Destination lost!\n", __func__); |
581 | if (opt->ts_needaddr) { | 581 | if (opt->ts_needaddr) { |
582 | optptr = raw + opt->ts; | 582 | optptr = raw + opt->ts; |
583 | ip_rt_get_source(&optptr[optptr[2]-9], skb, rt); | 583 | ip_rt_get_source(&optptr[optptr[2]-9], skb, rt); |
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index c857f6f49b03..63b64c45a826 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -156,11 +156,11 @@ static const struct net_protocol ipcomp4_protocol = { | |||
156 | static int __init ipcomp4_init(void) | 156 | static int __init ipcomp4_init(void) |
157 | { | 157 | { |
158 | if (xfrm_register_type(&ipcomp_type, AF_INET) < 0) { | 158 | if (xfrm_register_type(&ipcomp_type, AF_INET) < 0) { |
159 | printk(KERN_INFO "ipcomp init: can't add xfrm type\n"); | 159 | pr_info("%s: can't add xfrm type\n", __func__); |
160 | return -EAGAIN; | 160 | return -EAGAIN; |
161 | } | 161 | } |
162 | if (inet_add_protocol(&ipcomp4_protocol, IPPROTO_COMP) < 0) { | 162 | if (inet_add_protocol(&ipcomp4_protocol, IPPROTO_COMP) < 0) { |
163 | printk(KERN_INFO "ipcomp init: can't add protocol\n"); | 163 | pr_info("%s: can't add protocol\n", __func__); |
164 | xfrm_unregister_type(&ipcomp_type, AF_INET); | 164 | xfrm_unregister_type(&ipcomp_type, AF_INET); |
165 | return -EAGAIN; | 165 | return -EAGAIN; |
166 | } | 166 | } |
@@ -170,9 +170,9 @@ static int __init ipcomp4_init(void) | |||
170 | static void __exit ipcomp4_fini(void) | 170 | static void __exit ipcomp4_fini(void) |
171 | { | 171 | { |
172 | if (inet_del_protocol(&ipcomp4_protocol, IPPROTO_COMP) < 0) | 172 | if (inet_del_protocol(&ipcomp4_protocol, IPPROTO_COMP) < 0) |
173 | printk(KERN_INFO "ip ipcomp close: can't remove protocol\n"); | 173 | pr_info("%s: can't remove protocol\n", __func__); |
174 | if (xfrm_unregister_type(&ipcomp_type, AF_INET) < 0) | 174 | if (xfrm_unregister_type(&ipcomp_type, AF_INET) < 0) |
175 | printk(KERN_INFO "ip ipcomp close: can't remove xfrm type\n"); | 175 | pr_info("%s: can't remove xfrm type\n", __func__); |
176 | } | 176 | } |
177 | 177 | ||
178 | module_init(ipcomp4_init); | 178 | module_init(ipcomp4_init); |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 6e412a60a91f..92ac7e7363a0 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -214,7 +214,7 @@ static int __init ic_open_devs(void) | |||
214 | if (!(dev->flags & IFF_LOOPBACK)) | 214 | if (!(dev->flags & IFF_LOOPBACK)) |
215 | continue; | 215 | continue; |
216 | if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) | 216 | if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) |
217 | printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name); | 217 | pr_err("IP-Config: Failed to open %s\n", dev->name); |
218 | } | 218 | } |
219 | 219 | ||
220 | for_each_netdev(&init_net, dev) { | 220 | for_each_netdev(&init_net, dev) { |
@@ -223,7 +223,8 @@ static int __init ic_open_devs(void) | |||
223 | if (dev->mtu >= 364) | 223 | if (dev->mtu >= 364) |
224 | able |= IC_BOOTP; | 224 | able |= IC_BOOTP; |
225 | else | 225 | else |
226 | printk(KERN_WARNING "DHCP/BOOTP: Ignoring device %s, MTU %d too small", dev->name, dev->mtu); | 226 | pr_warn("DHCP/BOOTP: Ignoring device %s, MTU %d too small", |
227 | dev->name, dev->mtu); | ||
227 | if (!(dev->flags & IFF_NOARP)) | 228 | if (!(dev->flags & IFF_NOARP)) |
228 | able |= IC_RARP; | 229 | able |= IC_RARP; |
229 | able &= ic_proto_enabled; | 230 | able &= ic_proto_enabled; |
@@ -231,7 +232,8 @@ static int __init ic_open_devs(void) | |||
231 | continue; | 232 | continue; |
232 | oflags = dev->flags; | 233 | oflags = dev->flags; |
233 | if (dev_change_flags(dev, oflags | IFF_UP) < 0) { | 234 | if (dev_change_flags(dev, oflags | IFF_UP) < 0) { |
234 | printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name); | 235 | pr_err("IP-Config: Failed to open %s\n", |
236 | dev->name); | ||
235 | continue; | 237 | continue; |
236 | } | 238 | } |
237 | if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) { | 239 | if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) { |
@@ -273,9 +275,10 @@ have_carrier: | |||
273 | 275 | ||
274 | if (!ic_first_dev) { | 276 | if (!ic_first_dev) { |
275 | if (user_dev_name[0]) | 277 | if (user_dev_name[0]) |
276 | printk(KERN_ERR "IP-Config: Device `%s' not found.\n", user_dev_name); | 278 | pr_err("IP-Config: Device `%s' not found\n", |
279 | user_dev_name); | ||
277 | else | 280 | else |
278 | printk(KERN_ERR "IP-Config: No network devices available.\n"); | 281 | pr_err("IP-Config: No network devices available\n"); |
279 | return -ENODEV; | 282 | return -ENODEV; |
280 | } | 283 | } |
281 | return 0; | 284 | return 0; |
@@ -359,17 +362,20 @@ static int __init ic_setup_if(void) | |||
359 | strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); | 362 | strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name); |
360 | set_sockaddr(sin, ic_myaddr, 0); | 363 | set_sockaddr(sin, ic_myaddr, 0); |
361 | if ((err = ic_devinet_ioctl(SIOCSIFADDR, &ir)) < 0) { | 364 | if ((err = ic_devinet_ioctl(SIOCSIFADDR, &ir)) < 0) { |
362 | printk(KERN_ERR "IP-Config: Unable to set interface address (%d).\n", err); | 365 | pr_err("IP-Config: Unable to set interface address (%d)\n", |
366 | err); | ||
363 | return -1; | 367 | return -1; |
364 | } | 368 | } |
365 | set_sockaddr(sin, ic_netmask, 0); | 369 | set_sockaddr(sin, ic_netmask, 0); |
366 | if ((err = ic_devinet_ioctl(SIOCSIFNETMASK, &ir)) < 0) { | 370 | if ((err = ic_devinet_ioctl(SIOCSIFNETMASK, &ir)) < 0) { |
367 | printk(KERN_ERR "IP-Config: Unable to set interface netmask (%d).\n", err); | 371 | pr_err("IP-Config: Unable to set interface netmask (%d)\n", |
372 | err); | ||
368 | return -1; | 373 | return -1; |
369 | } | 374 | } |
370 | set_sockaddr(sin, ic_myaddr | ~ic_netmask, 0); | 375 | set_sockaddr(sin, ic_myaddr | ~ic_netmask, 0); |
371 | if ((err = ic_devinet_ioctl(SIOCSIFBRDADDR, &ir)) < 0) { | 376 | if ((err = ic_devinet_ioctl(SIOCSIFBRDADDR, &ir)) < 0) { |
372 | printk(KERN_ERR "IP-Config: Unable to set interface broadcast address (%d).\n", err); | 377 | pr_err("IP-Config: Unable to set interface broadcast address (%d)\n", |
378 | err); | ||
373 | return -1; | 379 | return -1; |
374 | } | 380 | } |
375 | /* Handle the case where we need non-standard MTU on the boot link (a network | 381 | /* Handle the case where we need non-standard MTU on the boot link (a network |
@@ -380,8 +386,8 @@ static int __init ic_setup_if(void) | |||
380 | strcpy(ir.ifr_name, ic_dev->name); | 386 | strcpy(ir.ifr_name, ic_dev->name); |
381 | ir.ifr_mtu = ic_dev_mtu; | 387 | ir.ifr_mtu = ic_dev_mtu; |
382 | if ((err = ic_dev_ioctl(SIOCSIFMTU, &ir)) < 0) | 388 | if ((err = ic_dev_ioctl(SIOCSIFMTU, &ir)) < 0) |
383 | printk(KERN_ERR "IP-Config: Unable to set interface mtu to %d (%d).\n", | 389 | pr_err("IP-Config: Unable to set interface mtu to %d (%d)\n", |
384 | ic_dev_mtu, err); | 390 | ic_dev_mtu, err); |
385 | } | 391 | } |
386 | return 0; | 392 | return 0; |
387 | } | 393 | } |
@@ -396,7 +402,7 @@ static int __init ic_setup_routes(void) | |||
396 | 402 | ||
397 | memset(&rm, 0, sizeof(rm)); | 403 | memset(&rm, 0, sizeof(rm)); |
398 | if ((ic_gateway ^ ic_myaddr) & ic_netmask) { | 404 | if ((ic_gateway ^ ic_myaddr) & ic_netmask) { |
399 | printk(KERN_ERR "IP-Config: Gateway not on directly connected network.\n"); | 405 | pr_err("IP-Config: Gateway not on directly connected network\n"); |
400 | return -1; | 406 | return -1; |
401 | } | 407 | } |
402 | set_sockaddr((struct sockaddr_in *) &rm.rt_dst, 0, 0); | 408 | set_sockaddr((struct sockaddr_in *) &rm.rt_dst, 0, 0); |
@@ -404,7 +410,8 @@ static int __init ic_setup_routes(void) | |||
404 | set_sockaddr((struct sockaddr_in *) &rm.rt_gateway, ic_gateway, 0); | 410 | set_sockaddr((struct sockaddr_in *) &rm.rt_gateway, ic_gateway, 0); |
405 | rm.rt_flags = RTF_UP | RTF_GATEWAY; | 411 | rm.rt_flags = RTF_UP | RTF_GATEWAY; |
406 | if ((err = ic_route_ioctl(SIOCADDRT, &rm)) < 0) { | 412 | if ((err = ic_route_ioctl(SIOCADDRT, &rm)) < 0) { |
407 | printk(KERN_ERR "IP-Config: Cannot add default route (%d).\n", err); | 413 | pr_err("IP-Config: Cannot add default route (%d)\n", |
414 | err); | ||
408 | return -1; | 415 | return -1; |
409 | } | 416 | } |
410 | } | 417 | } |
@@ -437,8 +444,8 @@ static int __init ic_defaults(void) | |||
437 | else if (IN_CLASSC(ntohl(ic_myaddr))) | 444 | else if (IN_CLASSC(ntohl(ic_myaddr))) |
438 | ic_netmask = htonl(IN_CLASSC_NET); | 445 | ic_netmask = htonl(IN_CLASSC_NET); |
439 | else { | 446 | else { |
440 | printk(KERN_ERR "IP-Config: Unable to guess netmask for address %pI4\n", | 447 | pr_err("IP-Config: Unable to guess netmask for address %pI4\n", |
441 | &ic_myaddr); | 448 | &ic_myaddr); |
442 | return -1; | 449 | return -1; |
443 | } | 450 | } |
444 | printk("IP-Config: Guessing netmask %pI4\n", &ic_netmask); | 451 | printk("IP-Config: Guessing netmask %pI4\n", &ic_netmask); |
@@ -688,8 +695,8 @@ ic_dhcp_init_options(u8 *options) | |||
688 | e += len; | 695 | e += len; |
689 | } | 696 | } |
690 | if (*vendor_class_identifier) { | 697 | if (*vendor_class_identifier) { |
691 | printk(KERN_INFO "DHCP: sending class identifier \"%s\"\n", | 698 | pr_info("DHCP: sending class identifier \"%s\"\n", |
692 | vendor_class_identifier); | 699 | vendor_class_identifier); |
693 | *e++ = 60; /* Class-identifier */ | 700 | *e++ = 60; /* Class-identifier */ |
694 | len = strlen(vendor_class_identifier); | 701 | len = strlen(vendor_class_identifier); |
695 | *e++ = len; | 702 | *e++ = len; |
@@ -949,8 +956,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
949 | /* Fragments are not supported */ | 956 | /* Fragments are not supported */ |
950 | if (ip_is_fragment(h)) { | 957 | if (ip_is_fragment(h)) { |
951 | if (net_ratelimit()) | 958 | if (net_ratelimit()) |
952 | printk(KERN_ERR "DHCP/BOOTP: Ignoring fragmented " | 959 | pr_err("DHCP/BOOTP: Ignoring fragmented reply\n"); |
953 | "reply.\n"); | ||
954 | goto drop; | 960 | goto drop; |
955 | } | 961 | } |
956 | 962 | ||
@@ -999,8 +1005,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
999 | if (b->op != BOOTP_REPLY || | 1005 | if (b->op != BOOTP_REPLY || |
1000 | b->xid != d->xid) { | 1006 | b->xid != d->xid) { |
1001 | if (net_ratelimit()) | 1007 | if (net_ratelimit()) |
1002 | printk(KERN_ERR "DHCP/BOOTP: Reply not for us, " | 1008 | pr_err("DHCP/BOOTP: Reply not for us, op[%x] xid[%x]\n", |
1003 | "op[%x] xid[%x]\n", | ||
1004 | b->op, b->xid); | 1009 | b->op, b->xid); |
1005 | goto drop_unlock; | 1010 | goto drop_unlock; |
1006 | } | 1011 | } |
@@ -1008,7 +1013,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
1008 | /* Is it a reply for the device we are configuring? */ | 1013 | /* Is it a reply for the device we are configuring? */ |
1009 | if (b->xid != ic_dev_xid) { | 1014 | if (b->xid != ic_dev_xid) { |
1010 | if (net_ratelimit()) | 1015 | if (net_ratelimit()) |
1011 | printk(KERN_ERR "DHCP/BOOTP: Ignoring delayed packet\n"); | 1016 | pr_err("DHCP/BOOTP: Ignoring delayed packet\n"); |
1012 | goto drop_unlock; | 1017 | goto drop_unlock; |
1013 | } | 1018 | } |
1014 | 1019 | ||
@@ -1146,17 +1151,17 @@ static int __init ic_dynamic(void) | |||
1146 | * are missing, and without DHCP/BOOTP/RARP we are unable to get it. | 1151 | * are missing, and without DHCP/BOOTP/RARP we are unable to get it. |
1147 | */ | 1152 | */ |
1148 | if (!ic_proto_enabled) { | 1153 | if (!ic_proto_enabled) { |
1149 | printk(KERN_ERR "IP-Config: Incomplete network configuration information.\n"); | 1154 | pr_err("IP-Config: Incomplete network configuration information\n"); |
1150 | return -1; | 1155 | return -1; |
1151 | } | 1156 | } |
1152 | 1157 | ||
1153 | #ifdef IPCONFIG_BOOTP | 1158 | #ifdef IPCONFIG_BOOTP |
1154 | if ((ic_proto_enabled ^ ic_proto_have_if) & IC_BOOTP) | 1159 | if ((ic_proto_enabled ^ ic_proto_have_if) & IC_BOOTP) |
1155 | printk(KERN_ERR "DHCP/BOOTP: No suitable device found.\n"); | 1160 | pr_err("DHCP/BOOTP: No suitable device found\n"); |
1156 | #endif | 1161 | #endif |
1157 | #ifdef IPCONFIG_RARP | 1162 | #ifdef IPCONFIG_RARP |
1158 | if ((ic_proto_enabled ^ ic_proto_have_if) & IC_RARP) | 1163 | if ((ic_proto_enabled ^ ic_proto_have_if) & IC_RARP) |
1159 | printk(KERN_ERR "RARP: No suitable device found.\n"); | 1164 | pr_err("RARP: No suitable device found\n"); |
1160 | #endif | 1165 | #endif |
1161 | 1166 | ||
1162 | if (!ic_proto_have_if) | 1167 | if (!ic_proto_have_if) |
@@ -1183,11 +1188,11 @@ static int __init ic_dynamic(void) | |||
1183 | * [Actually we could now, but the nothing else running note still | 1188 | * [Actually we could now, but the nothing else running note still |
1184 | * applies.. - AC] | 1189 | * applies.. - AC] |
1185 | */ | 1190 | */ |
1186 | printk(KERN_NOTICE "Sending %s%s%s requests .", | 1191 | pr_notice("Sending %s%s%s requests .", |
1187 | do_bootp | 1192 | do_bootp |
1188 | ? ((ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP") : "", | 1193 | ? ((ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP") : "", |
1189 | (do_bootp && do_rarp) ? " and " : "", | 1194 | (do_bootp && do_rarp) ? " and " : "", |
1190 | do_rarp ? "RARP" : ""); | 1195 | do_rarp ? "RARP" : ""); |
1191 | 1196 | ||
1192 | start_jiffies = jiffies; | 1197 | start_jiffies = jiffies; |
1193 | d = ic_first_dev; | 1198 | d = ic_first_dev; |
@@ -1216,13 +1221,13 @@ static int __init ic_dynamic(void) | |||
1216 | (ic_proto_enabled & IC_USE_DHCP) && | 1221 | (ic_proto_enabled & IC_USE_DHCP) && |
1217 | ic_dhcp_msgtype != DHCPACK) { | 1222 | ic_dhcp_msgtype != DHCPACK) { |
1218 | ic_got_reply = 0; | 1223 | ic_got_reply = 0; |
1219 | printk(KERN_CONT ","); | 1224 | pr_cont(","); |
1220 | continue; | 1225 | continue; |
1221 | } | 1226 | } |
1222 | #endif /* IPCONFIG_DHCP */ | 1227 | #endif /* IPCONFIG_DHCP */ |
1223 | 1228 | ||
1224 | if (ic_got_reply) { | 1229 | if (ic_got_reply) { |
1225 | printk(KERN_CONT " OK\n"); | 1230 | pr_cont(" OK\n"); |
1226 | break; | 1231 | break; |
1227 | } | 1232 | } |
1228 | 1233 | ||
@@ -1230,7 +1235,7 @@ static int __init ic_dynamic(void) | |||
1230 | continue; | 1235 | continue; |
1231 | 1236 | ||
1232 | if (! --retries) { | 1237 | if (! --retries) { |
1233 | printk(KERN_CONT " timed out!\n"); | 1238 | pr_cont(" timed out!\n"); |
1234 | break; | 1239 | break; |
1235 | } | 1240 | } |
1236 | 1241 | ||
@@ -1240,7 +1245,7 @@ static int __init ic_dynamic(void) | |||
1240 | if (timeout > CONF_TIMEOUT_MAX) | 1245 | if (timeout > CONF_TIMEOUT_MAX) |
1241 | timeout = CONF_TIMEOUT_MAX; | 1246 | timeout = CONF_TIMEOUT_MAX; |
1242 | 1247 | ||
1243 | printk(KERN_CONT "."); | 1248 | pr_cont("."); |
1244 | } | 1249 | } |
1245 | 1250 | ||
1246 | #ifdef IPCONFIG_BOOTP | 1251 | #ifdef IPCONFIG_BOOTP |
@@ -1260,8 +1265,8 @@ static int __init ic_dynamic(void) | |||
1260 | printk("IP-Config: Got %s answer from %pI4, ", | 1265 | printk("IP-Config: Got %s answer from %pI4, ", |
1261 | ((ic_got_reply & IC_RARP) ? "RARP" | 1266 | ((ic_got_reply & IC_RARP) ? "RARP" |
1262 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), | 1267 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), |
1263 | &ic_servaddr); | 1268 | &ic_servaddr); |
1264 | printk(KERN_CONT "my address is %pI4\n", &ic_myaddr); | 1269 | pr_cont("my address is %pI4\n", &ic_myaddr); |
1265 | 1270 | ||
1266 | return 0; | 1271 | return 0; |
1267 | } | 1272 | } |
@@ -1437,24 +1442,22 @@ static int __init ip_auto_config(void) | |||
1437 | */ | 1442 | */ |
1438 | #ifdef CONFIG_ROOT_NFS | 1443 | #ifdef CONFIG_ROOT_NFS |
1439 | if (ROOT_DEV == Root_NFS) { | 1444 | if (ROOT_DEV == Root_NFS) { |
1440 | printk(KERN_ERR | 1445 | pr_err("IP-Config: Retrying forever (NFS root)...\n"); |
1441 | "IP-Config: Retrying forever (NFS root)...\n"); | ||
1442 | goto try_try_again; | 1446 | goto try_try_again; |
1443 | } | 1447 | } |
1444 | #endif | 1448 | #endif |
1445 | 1449 | ||
1446 | if (--retries) { | 1450 | if (--retries) { |
1447 | printk(KERN_ERR | 1451 | pr_err("IP-Config: Reopening network devices...\n"); |
1448 | "IP-Config: Reopening network devices...\n"); | ||
1449 | goto try_try_again; | 1452 | goto try_try_again; |
1450 | } | 1453 | } |
1451 | 1454 | ||
1452 | /* Oh, well. At least we tried. */ | 1455 | /* Oh, well. At least we tried. */ |
1453 | printk(KERN_ERR "IP-Config: Auto-configuration of network failed.\n"); | 1456 | pr_err("IP-Config: Auto-configuration of network failed\n"); |
1454 | return -1; | 1457 | return -1; |
1455 | } | 1458 | } |
1456 | #else /* !DYNAMIC */ | 1459 | #else /* !DYNAMIC */ |
1457 | printk(KERN_ERR "IP-Config: Incomplete network configuration information.\n"); | 1460 | pr_err("IP-Config: Incomplete network configuration information\n"); |
1458 | ic_close_devs(); | 1461 | ic_close_devs(); |
1459 | return -1; | 1462 | return -1; |
1460 | #endif /* IPCONFIG_DYNAMIC */ | 1463 | #endif /* IPCONFIG_DYNAMIC */ |
@@ -1492,19 +1495,16 @@ static int __init ip_auto_config(void) | |||
1492 | /* | 1495 | /* |
1493 | * Clue in the operator. | 1496 | * Clue in the operator. |
1494 | */ | 1497 | */ |
1495 | printk("IP-Config: Complete:\n"); | 1498 | pr_info("IP-Config: Complete:\n"); |
1496 | printk(" device=%s", ic_dev->name); | 1499 | pr_info(" device=%s, addr=%pI4, mask=%pI4, gw=%pI4\n", |
1497 | printk(KERN_CONT ", addr=%pI4", &ic_myaddr); | 1500 | ic_dev->name, &ic_myaddr, &ic_netmask, &ic_gateway); |
1498 | printk(KERN_CONT ", mask=%pI4", &ic_netmask); | 1501 | pr_info(" host=%s, domain=%s, nis-domain=%s\n", |
1499 | printk(KERN_CONT ", gw=%pI4", &ic_gateway); | 1502 | utsname()->nodename, ic_domain, utsname()->domainname); |
1500 | printk(KERN_CONT ",\n host=%s, domain=%s, nis-domain=%s", | 1503 | pr_info(" bootserver=%pI4, rootserver=%pI4, rootpath=%s", |
1501 | utsname()->nodename, ic_domain, utsname()->domainname); | 1504 | &ic_servaddr, &root_server_addr, root_server_path); |
1502 | printk(KERN_CONT ",\n bootserver=%pI4", &ic_servaddr); | ||
1503 | printk(KERN_CONT ", rootserver=%pI4", &root_server_addr); | ||
1504 | printk(KERN_CONT ", rootpath=%s", root_server_path); | ||
1505 | if (ic_dev_mtu) | 1505 | if (ic_dev_mtu) |
1506 | printk(KERN_CONT ", mtu=%d", ic_dev_mtu); | 1506 | pr_cont(", mtu=%d", ic_dev_mtu); |
1507 | printk(KERN_CONT "\n"); | 1507 | pr_cont("\n"); |
1508 | #endif /* !SILENT */ | 1508 | #endif /* !SILENT */ |
1509 | 1509 | ||
1510 | return 0; | 1510 | return 0; |
@@ -1637,8 +1637,8 @@ static int __init vendor_class_identifier_setup(char *addrs) | |||
1637 | if (strlcpy(vendor_class_identifier, addrs, | 1637 | if (strlcpy(vendor_class_identifier, addrs, |
1638 | sizeof(vendor_class_identifier)) | 1638 | sizeof(vendor_class_identifier)) |
1639 | >= sizeof(vendor_class_identifier)) | 1639 | >= sizeof(vendor_class_identifier)) |
1640 | printk(KERN_WARNING "DHCP: vendorclass too long, truncated to \"%s\"", | 1640 | pr_warn("DHCP: vendorclass too long, truncated to \"%s\"", |
1641 | vendor_class_identifier); | 1641 | vendor_class_identifier); |
1642 | return 1; | 1642 | return 1; |
1643 | } | 1643 | } |
1644 | 1644 | ||
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index f84ebff5cdb0..ae1413e3f2f8 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -892,7 +892,7 @@ static int __init ipip_init(void) | |||
892 | err = xfrm4_tunnel_register(&ipip_handler, AF_INET); | 892 | err = xfrm4_tunnel_register(&ipip_handler, AF_INET); |
893 | if (err < 0) { | 893 | if (err < 0) { |
894 | unregister_pernet_device(&ipip_net_ops); | 894 | unregister_pernet_device(&ipip_net_ops); |
895 | printk(KERN_INFO "ipip init: can't register tunnel\n"); | 895 | pr_info("%s: can't register tunnel\n", __func__); |
896 | } | 896 | } |
897 | return err; | 897 | return err; |
898 | } | 898 | } |
@@ -900,7 +900,7 @@ static int __init ipip_init(void) | |||
900 | static void __exit ipip_fini(void) | 900 | static void __exit ipip_fini(void) |
901 | { | 901 | { |
902 | if (xfrm4_tunnel_deregister(&ipip_handler, AF_INET)) | 902 | if (xfrm4_tunnel_deregister(&ipip_handler, AF_INET)) |
903 | printk(KERN_INFO "ipip close: can't deregister tunnel\n"); | 903 | pr_info("%s: can't deregister tunnel\n", __func__); |
904 | 904 | ||
905 | unregister_pernet_device(&ipip_net_ops); | 905 | unregister_pernet_device(&ipip_net_ops); |
906 | } | 906 | } |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 7bc2db6db8d4..0518a4fb177b 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -951,7 +951,7 @@ static int ipmr_cache_report(struct mr_table *mrt, | |||
951 | rcu_read_unlock(); | 951 | rcu_read_unlock(); |
952 | if (ret < 0) { | 952 | if (ret < 0) { |
953 | if (net_ratelimit()) | 953 | if (net_ratelimit()) |
954 | printk(KERN_WARNING "mroute: pending queue full, dropping entries.\n"); | 954 | pr_warn("mroute: pending queue full, dropping entries\n"); |
955 | kfree_skb(skb); | 955 | kfree_skb(skb); |
956 | } | 956 | } |
957 | 957 | ||
@@ -2538,7 +2538,7 @@ int __init ip_mr_init(void) | |||
2538 | goto reg_notif_fail; | 2538 | goto reg_notif_fail; |
2539 | #ifdef CONFIG_IP_PIMSM_V2 | 2539 | #ifdef CONFIG_IP_PIMSM_V2 |
2540 | if (inet_add_protocol(&pim_protocol, IPPROTO_PIM) < 0) { | 2540 | if (inet_add_protocol(&pim_protocol, IPPROTO_PIM) < 0) { |
2541 | printk(KERN_ERR "ip_mr_init: can't add PIM protocol\n"); | 2541 | pr_err("%s: can't add PIM protocol\n", __func__); |
2542 | err = -EAGAIN; | 2542 | err = -EAGAIN; |
2543 | goto add_proto_fail; | 2543 | goto add_proto_fail; |
2544 | } | 2544 | } |
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 4398a45a9600..ab6b36e6da15 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -156,7 +156,7 @@ static struct sock *ping_v4_lookup(struct net *net, __be32 saddr, __be32 daddr, | |||
156 | struct hlist_nulls_node *hnode; | 156 | struct hlist_nulls_node *hnode; |
157 | 157 | ||
158 | pr_debug("try to find: num = %d, daddr = %pI4, dif = %d\n", | 158 | pr_debug("try to find: num = %d, daddr = %pI4, dif = %d\n", |
159 | (int)ident, &daddr, dif); | 159 | (int)ident, &daddr, dif); |
160 | read_lock_bh(&ping_table.lock); | 160 | read_lock_bh(&ping_table.lock); |
161 | 161 | ||
162 | ping_portaddr_for_each_entry(sk, hnode, hslot) { | 162 | ping_portaddr_for_each_entry(sk, hnode, hslot) { |
@@ -229,7 +229,7 @@ static int ping_init_sock(struct sock *sk) | |||
229 | static void ping_close(struct sock *sk, long timeout) | 229 | static void ping_close(struct sock *sk, long timeout) |
230 | { | 230 | { |
231 | pr_debug("ping_close(sk=%p,sk->num=%u)\n", | 231 | pr_debug("ping_close(sk=%p,sk->num=%u)\n", |
232 | inet_sk(sk), inet_sk(sk)->inet_num); | 232 | inet_sk(sk), inet_sk(sk)->inet_num); |
233 | pr_debug("isk->refcnt = %d\n", sk->sk_refcnt.counter); | 233 | pr_debug("isk->refcnt = %d\n", sk->sk_refcnt.counter); |
234 | 234 | ||
235 | sk_common_release(sk); | 235 | sk_common_release(sk); |
@@ -252,7 +252,7 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
252 | return -EINVAL; | 252 | return -EINVAL; |
253 | 253 | ||
254 | pr_debug("ping_v4_bind(sk=%p,sa_addr=%08x,sa_port=%d)\n", | 254 | pr_debug("ping_v4_bind(sk=%p,sa_addr=%08x,sa_port=%d)\n", |
255 | sk, addr->sin_addr.s_addr, ntohs(addr->sin_port)); | 255 | sk, addr->sin_addr.s_addr, ntohs(addr->sin_port)); |
256 | 256 | ||
257 | chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); | 257 | chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); |
258 | if (addr->sin_addr.s_addr == htonl(INADDR_ANY)) | 258 | if (addr->sin_addr.s_addr == htonl(INADDR_ANY)) |
@@ -280,9 +280,9 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | pr_debug("after bind(): num = %d, daddr = %pI4, dif = %d\n", | 282 | pr_debug("after bind(): num = %d, daddr = %pI4, dif = %d\n", |
283 | (int)isk->inet_num, | 283 | (int)isk->inet_num, |
284 | &isk->inet_rcv_saddr, | 284 | &isk->inet_rcv_saddr, |
285 | (int)sk->sk_bound_dev_if); | 285 | (int)sk->sk_bound_dev_if); |
286 | 286 | ||
287 | err = 0; | 287 | err = 0; |
288 | if (isk->inet_rcv_saddr) | 288 | if (isk->inet_rcv_saddr) |
@@ -335,7 +335,7 @@ void ping_err(struct sk_buff *skb, u32 info) | |||
335 | return; | 335 | return; |
336 | 336 | ||
337 | pr_debug("ping_err(type=%04x,code=%04x,id=%04x,seq=%04x)\n", type, | 337 | pr_debug("ping_err(type=%04x,code=%04x,id=%04x,seq=%04x)\n", type, |
338 | code, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); | 338 | code, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); |
339 | 339 | ||
340 | sk = ping_v4_lookup(net, iph->daddr, iph->saddr, | 340 | sk = ping_v4_lookup(net, iph->daddr, iph->saddr, |
341 | ntohs(icmph->un.echo.id), skb->dev->ifindex); | 341 | ntohs(icmph->un.echo.id), skb->dev->ifindex); |
@@ -679,7 +679,7 @@ out: | |||
679 | static int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | 679 | static int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) |
680 | { | 680 | { |
681 | pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n", | 681 | pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n", |
682 | inet_sk(sk), inet_sk(sk)->inet_num, skb); | 682 | inet_sk(sk), inet_sk(sk)->inet_num, skb); |
683 | if (sock_queue_rcv_skb(sk, skb) < 0) { | 683 | if (sock_queue_rcv_skb(sk, skb) < 0) { |
684 | kfree_skb(skb); | 684 | kfree_skb(skb); |
685 | pr_debug("ping_queue_rcv_skb -> failed\n"); | 685 | pr_debug("ping_queue_rcv_skb -> failed\n"); |
@@ -705,7 +705,7 @@ void ping_rcv(struct sk_buff *skb) | |||
705 | /* We assume the packet has already been checked by icmp_rcv */ | 705 | /* We assume the packet has already been checked by icmp_rcv */ |
706 | 706 | ||
707 | pr_debug("ping_rcv(skb=%p,id=%04x,seq=%04x)\n", | 707 | pr_debug("ping_rcv(skb=%p,id=%04x,seq=%04x)\n", |
708 | skb, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); | 708 | skb, ntohs(icmph->un.echo.id), ntohs(icmph->un.echo.sequence)); |
709 | 709 | ||
710 | /* Push ICMP header back */ | 710 | /* Push ICMP header back */ |
711 | skb_push(skb, skb->data - (u8 *)icmph); | 711 | skb_push(skb, skb->data - (u8 *)icmph); |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index ab466305b629..bbd604c68e68 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -491,11 +491,8 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
491 | if (msg->msg_namelen < sizeof(*usin)) | 491 | if (msg->msg_namelen < sizeof(*usin)) |
492 | goto out; | 492 | goto out; |
493 | if (usin->sin_family != AF_INET) { | 493 | if (usin->sin_family != AF_INET) { |
494 | static int complained; | 494 | pr_info_once("%s: %s forgot to set AF_INET. Fix it!\n", |
495 | if (!complained++) | 495 | __func__, current->comm); |
496 | printk(KERN_INFO "%s forgot to set AF_INET in " | ||
497 | "raw sendmsg. Fix it!\n", | ||
498 | current->comm); | ||
499 | err = -EAFNOSUPPORT; | 496 | err = -EAFNOSUPPORT; |
500 | if (usin->sin_family) | 497 | if (usin->sin_family) |
501 | goto out; | 498 | goto out; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 815989b90dea..cbda6de0a77c 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -959,7 +959,7 @@ void rt_cache_flush_batch(struct net *net) | |||
959 | static void rt_emergency_hash_rebuild(struct net *net) | 959 | static void rt_emergency_hash_rebuild(struct net *net) |
960 | { | 960 | { |
961 | if (net_ratelimit()) | 961 | if (net_ratelimit()) |
962 | printk(KERN_WARNING "Route hash chain too long!\n"); | 962 | pr_warn("Route hash chain too long!\n"); |
963 | rt_cache_invalidate(net); | 963 | rt_cache_invalidate(net); |
964 | } | 964 | } |
965 | 965 | ||
@@ -1083,7 +1083,7 @@ static int rt_garbage_collect(struct dst_ops *ops) | |||
1083 | if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size) | 1083 | if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size) |
1084 | goto out; | 1084 | goto out; |
1085 | if (net_ratelimit()) | 1085 | if (net_ratelimit()) |
1086 | printk(KERN_WARNING "dst cache overflow\n"); | 1086 | pr_warn("dst cache overflow\n"); |
1087 | RT_CACHE_STAT_INC(gc_dst_overflow); | 1087 | RT_CACHE_STAT_INC(gc_dst_overflow); |
1088 | return 1; | 1088 | return 1; |
1089 | 1089 | ||
@@ -1181,8 +1181,7 @@ restart: | |||
1181 | int err = rt_bind_neighbour(rt); | 1181 | int err = rt_bind_neighbour(rt); |
1182 | if (err) { | 1182 | if (err) { |
1183 | if (net_ratelimit()) | 1183 | if (net_ratelimit()) |
1184 | printk(KERN_WARNING | 1184 | pr_warn("Neighbour table failure & not caching routes\n"); |
1185 | "Neighbour table failure & not caching routes.\n"); | ||
1186 | ip_rt_put(rt); | 1185 | ip_rt_put(rt); |
1187 | return ERR_PTR(err); | 1186 | return ERR_PTR(err); |
1188 | } | 1187 | } |
@@ -1258,7 +1257,7 @@ restart: | |||
1258 | struct net *net = dev_net(rt->dst.dev); | 1257 | struct net *net = dev_net(rt->dst.dev); |
1259 | int num = ++net->ipv4.current_rt_cache_rebuild_count; | 1258 | int num = ++net->ipv4.current_rt_cache_rebuild_count; |
1260 | if (!rt_caching(net)) { | 1259 | if (!rt_caching(net)) { |
1261 | printk(KERN_WARNING "%s: %d rebuilds is over limit, route caching disabled\n", | 1260 | pr_warn("%s: %d rebuilds is over limit, route caching disabled\n", |
1262 | rt->dst.dev->name, num); | 1261 | rt->dst.dev->name, num); |
1263 | } | 1262 | } |
1264 | rt_emergency_hash_rebuild(net); | 1263 | rt_emergency_hash_rebuild(net); |
@@ -1299,7 +1298,7 @@ restart: | |||
1299 | } | 1298 | } |
1300 | 1299 | ||
1301 | if (net_ratelimit()) | 1300 | if (net_ratelimit()) |
1302 | printk(KERN_WARNING "ipv4: Neighbour table overflow.\n"); | 1301 | pr_warn("ipv4: Neighbour table overflow\n"); |
1303 | rt_drop(rt); | 1302 | rt_drop(rt); |
1304 | return ERR_PTR(-ENOBUFS); | 1303 | return ERR_PTR(-ENOBUFS); |
1305 | } | 1304 | } |
@@ -1503,10 +1502,10 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
1503 | reject_redirect: | 1502 | reject_redirect: |
1504 | #ifdef CONFIG_IP_ROUTE_VERBOSE | 1503 | #ifdef CONFIG_IP_ROUTE_VERBOSE |
1505 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) | 1504 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) |
1506 | printk(KERN_INFO "Redirect from %pI4 on %s about %pI4 ignored.\n" | 1505 | pr_info("Redirect from %pI4 on %s about %pI4 ignored\n" |
1507 | " Advised path = %pI4 -> %pI4\n", | 1506 | " Advised path = %pI4 -> %pI4\n", |
1508 | &old_gw, dev->name, &new_gw, | 1507 | &old_gw, dev->name, &new_gw, |
1509 | &saddr, &daddr); | 1508 | &saddr, &daddr); |
1510 | #endif | 1509 | #endif |
1511 | ; | 1510 | ; |
1512 | } | 1511 | } |
@@ -1618,8 +1617,8 @@ void ip_rt_send_redirect(struct sk_buff *skb) | |||
1618 | if (log_martians && | 1617 | if (log_martians && |
1619 | peer->rate_tokens == ip_rt_redirect_number && | 1618 | peer->rate_tokens == ip_rt_redirect_number && |
1620 | net_ratelimit()) | 1619 | net_ratelimit()) |
1621 | printk(KERN_WARNING "host %pI4/if%d ignores redirects for %pI4 to %pI4.\n", | 1620 | pr_warn("host %pI4/if%d ignores redirects for %pI4 to %pI4\n", |
1622 | &ip_hdr(skb)->saddr, rt->rt_iif, | 1621 | &ip_hdr(skb)->saddr, rt->rt_iif, |
1623 | &rt->rt_dst, &rt->rt_gateway); | 1622 | &rt->rt_dst, &rt->rt_gateway); |
1624 | #endif | 1623 | #endif |
1625 | } | 1624 | } |
@@ -2105,18 +2104,13 @@ static void ip_handle_martian_source(struct net_device *dev, | |||
2105 | * RFC1812 recommendation, if source is martian, | 2104 | * RFC1812 recommendation, if source is martian, |
2106 | * the only hint is MAC header. | 2105 | * the only hint is MAC header. |
2107 | */ | 2106 | */ |
2108 | printk(KERN_WARNING "martian source %pI4 from %pI4, on dev %s\n", | 2107 | pr_warn("martian source %pI4 from %pI4, on dev %s\n", |
2109 | &daddr, &saddr, dev->name); | 2108 | &daddr, &saddr, dev->name); |
2110 | if (dev->hard_header_len && skb_mac_header_was_set(skb)) { | 2109 | if (dev->hard_header_len && skb_mac_header_was_set(skb)) { |
2111 | int i; | 2110 | print_hex_dump(KERN_WARNING, "ll header: ", |
2112 | const unsigned char *p = skb_mac_header(skb); | 2111 | DUMP_PREFIX_OFFSET, 16, 1, |
2113 | printk(KERN_WARNING "ll header: "); | 2112 | skb_mac_header(skb), |
2114 | for (i = 0; i < dev->hard_header_len; i++, p++) { | 2113 | dev->hard_header_len, true); |
2115 | printk("%02x", *p); | ||
2116 | if (i < (dev->hard_header_len - 1)) | ||
2117 | printk(":"); | ||
2118 | } | ||
2119 | printk("\n"); | ||
2120 | } | 2114 | } |
2121 | } | 2115 | } |
2122 | #endif | 2116 | #endif |
@@ -2140,8 +2134,7 @@ static int __mkroute_input(struct sk_buff *skb, | |||
2140 | out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res)); | 2134 | out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res)); |
2141 | if (out_dev == NULL) { | 2135 | if (out_dev == NULL) { |
2142 | if (net_ratelimit()) | 2136 | if (net_ratelimit()) |
2143 | printk(KERN_CRIT "Bug in ip_route_input" \ | 2137 | pr_crit("Bug in ip_route_input_slow(). Please report.\n"); |
2144 | "_slow(). Please, report\n"); | ||
2145 | return -EINVAL; | 2138 | return -EINVAL; |
2146 | } | 2139 | } |
2147 | 2140 | ||
@@ -2413,7 +2406,7 @@ martian_destination: | |||
2413 | RT_CACHE_STAT_INC(in_martian_dst); | 2406 | RT_CACHE_STAT_INC(in_martian_dst); |
2414 | #ifdef CONFIG_IP_ROUTE_VERBOSE | 2407 | #ifdef CONFIG_IP_ROUTE_VERBOSE |
2415 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) | 2408 | if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) |
2416 | printk(KERN_WARNING "martian destination %pI4 from %pI4, dev %s\n", | 2409 | pr_warn("martian destination %pI4 from %pI4, dev %s\n", |
2417 | &daddr, &saddr, dev->name); | 2410 | &daddr, &saddr, dev->name); |
2418 | #endif | 2411 | #endif |
2419 | 2412 | ||
@@ -3490,7 +3483,7 @@ int __init ip_rt_init(void) | |||
3490 | net_random() % ip_rt_gc_interval + ip_rt_gc_interval); | 3483 | net_random() % ip_rt_gc_interval + ip_rt_gc_interval); |
3491 | 3484 | ||
3492 | if (ip_rt_proc_init()) | 3485 | if (ip_rt_proc_init()) |
3493 | printk(KERN_ERR "Unable to create route proc files\n"); | 3486 | pr_err("Unable to create route proc files\n"); |
3494 | #ifdef CONFIG_XFRM | 3487 | #ifdef CONFIG_XFRM |
3495 | xfrm_init(); | 3488 | xfrm_init(); |
3496 | xfrm4_init(ip_rt_max_size); | 3489 | xfrm4_init(ip_rt_max_size); |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 22ef5f9fd2ff..2baba1bed810 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1675,7 +1675,7 @@ do_prequeue: | |||
1675 | 1675 | ||
1676 | if (tp->ucopy.dma_cookie < 0) { | 1676 | if (tp->ucopy.dma_cookie < 0) { |
1677 | 1677 | ||
1678 | printk(KERN_ALERT "dma_cookie < 0\n"); | 1678 | pr_alert("dma_cookie < 0\n"); |
1679 | 1679 | ||
1680 | /* Exception. Bailout! */ | 1680 | /* Exception. Bailout! */ |
1681 | if (!copied) | 1681 | if (!copied) |
@@ -3311,9 +3311,8 @@ void __init tcp_init(void) | |||
3311 | sysctl_tcp_rmem[1] = 87380; | 3311 | sysctl_tcp_rmem[1] = 87380; |
3312 | sysctl_tcp_rmem[2] = max(87380, max_share); | 3312 | sysctl_tcp_rmem[2] = max(87380, max_share); |
3313 | 3313 | ||
3314 | printk(KERN_INFO "TCP: Hash tables configured " | 3314 | pr_info("TCP: Hash tables configured (established %u bind %u)\n", |
3315 | "(established %u bind %u)\n", | 3315 | tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); |
3316 | tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); | ||
3317 | 3316 | ||
3318 | tcp_register_congestion_control(&tcp_reno); | 3317 | tcp_register_congestion_control(&tcp_reno); |
3319 | 3318 | ||
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index fc6d475f488f..67bab75f441f 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c | |||
@@ -41,18 +41,17 @@ int tcp_register_congestion_control(struct tcp_congestion_ops *ca) | |||
41 | 41 | ||
42 | /* all algorithms must implement ssthresh and cong_avoid ops */ | 42 | /* all algorithms must implement ssthresh and cong_avoid ops */ |
43 | if (!ca->ssthresh || !ca->cong_avoid) { | 43 | if (!ca->ssthresh || !ca->cong_avoid) { |
44 | printk(KERN_ERR "TCP %s does not implement required ops\n", | 44 | pr_err("TCP %s does not implement required ops\n", ca->name); |
45 | ca->name); | ||
46 | return -EINVAL; | 45 | return -EINVAL; |
47 | } | 46 | } |
48 | 47 | ||
49 | spin_lock(&tcp_cong_list_lock); | 48 | spin_lock(&tcp_cong_list_lock); |
50 | if (tcp_ca_find(ca->name)) { | 49 | if (tcp_ca_find(ca->name)) { |
51 | printk(KERN_NOTICE "TCP %s already registered\n", ca->name); | 50 | pr_notice("TCP %s already registered\n", ca->name); |
52 | ret = -EEXIST; | 51 | ret = -EEXIST; |
53 | } else { | 52 | } else { |
54 | list_add_tail_rcu(&ca->list, &tcp_cong_list); | 53 | list_add_tail_rcu(&ca->list, &tcp_cong_list); |
55 | printk(KERN_INFO "TCP %s registered\n", ca->name); | 54 | pr_info("TCP %s registered\n", ca->name); |
56 | } | 55 | } |
57 | spin_unlock(&tcp_cong_list_lock); | 56 | spin_unlock(&tcp_cong_list_lock); |
58 | 57 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index b5e315f13641..23ca3663d1e8 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -3867,9 +3867,9 @@ void tcp_parse_options(const struct sk_buff *skb, struct tcp_options_received *o | |||
3867 | opt_rx->wscale_ok = 1; | 3867 | opt_rx->wscale_ok = 1; |
3868 | if (snd_wscale > 14) { | 3868 | if (snd_wscale > 14) { |
3869 | if (net_ratelimit()) | 3869 | if (net_ratelimit()) |
3870 | printk(KERN_INFO "tcp_parse_options: Illegal window " | 3870 | pr_info("%s: Illegal window scaling value %d >14 received\n", |
3871 | "scaling value %d >14 received.\n", | 3871 | __func__, |
3872 | snd_wscale); | 3872 | snd_wscale); |
3873 | snd_wscale = 14; | 3873 | snd_wscale = 14; |
3874 | } | 3874 | } |
3875 | opt_rx->snd_wscale = snd_wscale; | 3875 | opt_rx->snd_wscale = snd_wscale; |
@@ -4191,7 +4191,7 @@ static void tcp_fin(struct sock *sk) | |||
4191 | /* Only TCP_LISTEN and TCP_CLOSE are left, in these | 4191 | /* Only TCP_LISTEN and TCP_CLOSE are left, in these |
4192 | * cases we should never reach this piece of code. | 4192 | * cases we should never reach this piece of code. |
4193 | */ | 4193 | */ |
4194 | printk(KERN_ERR "%s: Impossible, sk->sk_state=%d\n", | 4194 | pr_err("%s: Impossible, sk->sk_state=%d\n", |
4195 | __func__, sk->sk_state); | 4195 | __func__, sk->sk_state); |
4196 | break; | 4196 | break; |
4197 | } | 4197 | } |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 507924b640ef..257dba66eaca 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1227,10 +1227,10 @@ static int tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) | |||
1227 | 1227 | ||
1228 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { | 1228 | if (genhash || memcmp(hash_location, newhash, 16) != 0) { |
1229 | if (net_ratelimit()) { | 1229 | if (net_ratelimit()) { |
1230 | printk(KERN_INFO "MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", | 1230 | pr_info("MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", |
1231 | &iph->saddr, ntohs(th->source), | 1231 | &iph->saddr, ntohs(th->source), |
1232 | &iph->daddr, ntohs(th->dest), | 1232 | &iph->daddr, ntohs(th->dest), |
1233 | genhash ? " tcp_v4_calc_md5_hash failed" : ""); | 1233 | genhash ? " tcp_v4_calc_md5_hash failed" : ""); |
1234 | } | 1234 | } |
1235 | return 1; | 1235 | return 1; |
1236 | } | 1236 | } |
diff --git a/net/ipv4/tunnel4.c b/net/ipv4/tunnel4.c index 01775983b997..0d0171830620 100644 --- a/net/ipv4/tunnel4.c +++ b/net/ipv4/tunnel4.c | |||
@@ -164,12 +164,12 @@ static const struct net_protocol tunnel64_protocol = { | |||
164 | static int __init tunnel4_init(void) | 164 | static int __init tunnel4_init(void) |
165 | { | 165 | { |
166 | if (inet_add_protocol(&tunnel4_protocol, IPPROTO_IPIP)) { | 166 | if (inet_add_protocol(&tunnel4_protocol, IPPROTO_IPIP)) { |
167 | printk(KERN_ERR "tunnel4 init: can't add protocol\n"); | 167 | pr_err("%s: can't add protocol\n", __func__); |
168 | return -EAGAIN; | 168 | return -EAGAIN; |
169 | } | 169 | } |
170 | #if IS_ENABLED(CONFIG_IPV6) | 170 | #if IS_ENABLED(CONFIG_IPV6) |
171 | if (inet_add_protocol(&tunnel64_protocol, IPPROTO_IPV6)) { | 171 | if (inet_add_protocol(&tunnel64_protocol, IPPROTO_IPV6)) { |
172 | printk(KERN_ERR "tunnel64 init: can't add protocol\n"); | 172 | pr_err("tunnel64 init: can't add protocol\n"); |
173 | inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP); | 173 | inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP); |
174 | return -EAGAIN; | 174 | return -EAGAIN; |
175 | } | 175 | } |
@@ -181,10 +181,10 @@ static void __exit tunnel4_fini(void) | |||
181 | { | 181 | { |
182 | #if IS_ENABLED(CONFIG_IPV6) | 182 | #if IS_ENABLED(CONFIG_IPV6) |
183 | if (inet_del_protocol(&tunnel64_protocol, IPPROTO_IPV6)) | 183 | if (inet_del_protocol(&tunnel64_protocol, IPPROTO_IPV6)) |
184 | printk(KERN_ERR "tunnel64 close: can't remove protocol\n"); | 184 | pr_err("tunnel64 close: can't remove protocol\n"); |
185 | #endif | 185 | #endif |
186 | if (inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP)) | 186 | if (inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP)) |
187 | printk(KERN_ERR "tunnel4 close: can't remove protocol\n"); | 187 | pr_err("tunnel4 close: can't remove protocol\n"); |
188 | } | 188 | } |
189 | 189 | ||
190 | module_init(tunnel4_init); | 190 | module_init(tunnel4_init); |
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index 12e9499a1a6c..280bfb12adcc 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c | |||
@@ -129,11 +129,11 @@ void __init udplite4_register(void) | |||
129 | inet_register_protosw(&udplite4_protosw); | 129 | inet_register_protosw(&udplite4_protosw); |
130 | 130 | ||
131 | if (udplite4_proc_init()) | 131 | if (udplite4_proc_init()) |
132 | printk(KERN_ERR "%s: Cannot register /proc!\n", __func__); | 132 | pr_err("%s: Cannot register /proc!\n", __func__); |
133 | return; | 133 | return; |
134 | 134 | ||
135 | out_unregister_proto: | 135 | out_unregister_proto: |
136 | proto_unregister(&udplite_prot); | 136 | proto_unregister(&udplite_prot); |
137 | out_register_err: | 137 | out_register_err: |
138 | printk(KERN_CRIT "%s: Cannot add UDP-Lite protocol.\n", __func__); | 138 | pr_crit("%s: Cannot add UDP-Lite protocol\n", __func__); |
139 | } | 139 | } |
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c index 9247d9d70e9d..5b48f49df0ba 100644 --- a/net/ipv4/xfrm4_tunnel.c +++ b/net/ipv4/xfrm4_tunnel.c | |||
@@ -75,18 +75,18 @@ static struct xfrm_tunnel xfrm64_tunnel_handler __read_mostly = { | |||
75 | static int __init ipip_init(void) | 75 | static int __init ipip_init(void) |
76 | { | 76 | { |
77 | if (xfrm_register_type(&ipip_type, AF_INET) < 0) { | 77 | if (xfrm_register_type(&ipip_type, AF_INET) < 0) { |
78 | printk(KERN_INFO "ipip init: can't add xfrm type\n"); | 78 | pr_info("%s: can't add xfrm type\n", __func__); |
79 | return -EAGAIN; | 79 | return -EAGAIN; |
80 | } | 80 | } |
81 | 81 | ||
82 | if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET)) { | 82 | if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET)) { |
83 | printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET\n"); | 83 | pr_info("%s: can't add xfrm handler for AF_INET\n", __func__); |
84 | xfrm_unregister_type(&ipip_type, AF_INET); | 84 | xfrm_unregister_type(&ipip_type, AF_INET); |
85 | return -EAGAIN; | 85 | return -EAGAIN; |
86 | } | 86 | } |
87 | #if IS_ENABLED(CONFIG_IPV6) | 87 | #if IS_ENABLED(CONFIG_IPV6) |
88 | if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) { | 88 | if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) { |
89 | printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n"); | 89 | pr_info("%s: can't add xfrm handler for AF_INET6\n", __func__); |
90 | xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET); | 90 | xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET); |
91 | xfrm_unregister_type(&ipip_type, AF_INET); | 91 | xfrm_unregister_type(&ipip_type, AF_INET); |
92 | return -EAGAIN; | 92 | return -EAGAIN; |
@@ -99,12 +99,14 @@ static void __exit ipip_fini(void) | |||
99 | { | 99 | { |
100 | #if IS_ENABLED(CONFIG_IPV6) | 100 | #if IS_ENABLED(CONFIG_IPV6) |
101 | if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6)) | 101 | if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6)) |
102 | printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n"); | 102 | pr_info("%s: can't remove xfrm handler for AF_INET6\n", |
103 | __func__); | ||
103 | #endif | 104 | #endif |
104 | if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET)) | 105 | if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET)) |
105 | printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET\n"); | 106 | pr_info("%s: can't remove xfrm handler for AF_INET\n", |
107 | __func__); | ||
106 | if (xfrm_unregister_type(&ipip_type, AF_INET) < 0) | 108 | if (xfrm_unregister_type(&ipip_type, AF_INET) < 0) |
107 | printk(KERN_INFO "ipip close: can't remove xfrm type\n"); | 109 | pr_info("%s: can't remove xfrm type\n", __func__); |
108 | } | 110 | } |
109 | 111 | ||
110 | module_init(ipip_init); | 112 | module_init(ipip_init); |