diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 7c41ab84e72e..d6f5feeb3eaf 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -77,6 +77,8 @@ | |||
77 | * 2 of the License, or (at your option) any later version. | 77 | * 2 of the License, or (at your option) any later version. |
78 | */ | 78 | */ |
79 | 79 | ||
80 | #define pr_fmt(fmt) "UDP: " fmt | ||
81 | |||
80 | #include <asm/system.h> | 82 | #include <asm/system.h> |
81 | #include <asm/uaccess.h> | 83 | #include <asm/uaccess.h> |
82 | #include <asm/ioctls.h> | 84 | #include <asm/ioctls.h> |
@@ -975,7 +977,7 @@ back_from_confirm: | |||
975 | /* ... which is an evident application bug. --ANK */ | 977 | /* ... which is an evident application bug. --ANK */ |
976 | release_sock(sk); | 978 | release_sock(sk); |
977 | 979 | ||
978 | LIMIT_NETDEBUG(KERN_DEBUG "udp cork app bug 2\n"); | 980 | LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("cork app bug 2\n")); |
979 | err = -EINVAL; | 981 | err = -EINVAL; |
980 | goto out; | 982 | goto out; |
981 | } | 983 | } |
@@ -1054,7 +1056,7 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
1054 | if (unlikely(!up->pending)) { | 1056 | if (unlikely(!up->pending)) { |
1055 | release_sock(sk); | 1057 | release_sock(sk); |
1056 | 1058 | ||
1057 | LIMIT_NETDEBUG(KERN_DEBUG "udp cork app bug 3\n"); | 1059 | LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("udp cork app bug 3\n")); |
1058 | return -EINVAL; | 1060 | return -EINVAL; |
1059 | } | 1061 | } |
1060 | 1062 | ||
@@ -1447,9 +1449,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1447 | * provided by the application." | 1449 | * provided by the application." |
1448 | */ | 1450 | */ |
1449 | if (up->pcrlen == 0) { /* full coverage was set */ | 1451 | if (up->pcrlen == 0) { /* full coverage was set */ |
1450 | LIMIT_NETDEBUG(KERN_WARNING "UDPLITE: partial coverage " | 1452 | LIMIT_NETDEBUG(KERN_WARNING "UDPLite: partial coverage %d while full coverage %d requested\n", |
1451 | "%d while full coverage %d requested\n", | 1453 | UDP_SKB_CB(skb)->cscov, skb->len); |
1452 | UDP_SKB_CB(skb)->cscov, skb->len); | ||
1453 | goto drop; | 1454 | goto drop; |
1454 | } | 1455 | } |
1455 | /* The next case involves violating the min. coverage requested | 1456 | /* The next case involves violating the min. coverage requested |
@@ -1459,9 +1460,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1459 | * Therefore the above ...()->partial_cov statement is essential. | 1460 | * Therefore the above ...()->partial_cov statement is essential. |
1460 | */ | 1461 | */ |
1461 | if (UDP_SKB_CB(skb)->cscov < up->pcrlen) { | 1462 | if (UDP_SKB_CB(skb)->cscov < up->pcrlen) { |
1462 | LIMIT_NETDEBUG(KERN_WARNING | 1463 | LIMIT_NETDEBUG(KERN_WARNING "UDPLite: coverage %d too small, need min %d\n", |
1463 | "UDPLITE: coverage %d too small, need min %d\n", | 1464 | UDP_SKB_CB(skb)->cscov, up->pcrlen); |
1464 | UDP_SKB_CB(skb)->cscov, up->pcrlen); | ||
1465 | goto drop; | 1465 | goto drop; |
1466 | } | 1466 | } |
1467 | } | 1467 | } |
@@ -1689,13 +1689,10 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
1689 | 1689 | ||
1690 | short_packet: | 1690 | short_packet: |
1691 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n", | 1691 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n", |
1692 | proto == IPPROTO_UDPLITE ? "-Lite" : "", | 1692 | proto == IPPROTO_UDPLITE ? "Lite" : "", |
1693 | &saddr, | 1693 | &saddr, ntohs(uh->source), |
1694 | ntohs(uh->source), | 1694 | ulen, skb->len, |
1695 | ulen, | 1695 | &daddr, ntohs(uh->dest)); |
1696 | skb->len, | ||
1697 | &daddr, | ||
1698 | ntohs(uh->dest)); | ||
1699 | goto drop; | 1696 | goto drop; |
1700 | 1697 | ||
1701 | csum_error: | 1698 | csum_error: |
@@ -1704,11 +1701,8 @@ csum_error: | |||
1704 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). | 1701 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). |
1705 | */ | 1702 | */ |
1706 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n", | 1703 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n", |
1707 | proto == IPPROTO_UDPLITE ? "-Lite" : "", | 1704 | proto == IPPROTO_UDPLITE ? "Lite" : "", |
1708 | &saddr, | 1705 | &saddr, ntohs(uh->source), &daddr, ntohs(uh->dest), |
1709 | ntohs(uh->source), | ||
1710 | &daddr, | ||
1711 | ntohs(uh->dest), | ||
1712 | ulen); | 1706 | ulen); |
1713 | drop: | 1707 | drop: |
1714 | UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); | 1708 | UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); |