projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branches 'fixes' and 'misc' into for-next
[deliverable/linux.git]
/
net
/
ipv4
/
udp.c
diff --git
a/net/ipv4/udp.c
b/net/ipv4/udp.c
index e61f7cd65d08a478f4b4f4d60841688b89bb1f2d..5fdcb8d108d468ab33e8f29a21efdd643d27a49f 100644
(file)
--- a/
net/ipv4/udp.c
+++ b/
net/ipv4/udp.c
@@
-1182,13
+1182,13
@@
out:
* @sk: socket
*
* Drops all bad checksum frames, until a valid one is found.
* @sk: socket
*
* Drops all bad checksum frames, until a valid one is found.
- * Returns the length of found skb, or
0
if none is found.
+ * Returns the length of found skb, or
-1
if none is found.
*/
*/
-static
unsigned
int first_packet_length(struct sock *sk)
+static int first_packet_length(struct sock *sk)
{
struct sk_buff_head list_kill, *rcvq = &sk->sk_receive_queue;
struct sk_buff *skb;
{
struct sk_buff_head list_kill, *rcvq = &sk->sk_receive_queue;
struct sk_buff *skb;
-
unsigned
int res;
+ int res;
__skb_queue_head_init(&list_kill);
__skb_queue_head_init(&list_kill);
@@
-1203,7
+1203,7
@@
static unsigned int first_packet_length(struct sock *sk)
__skb_unlink(skb, rcvq);
__skb_queue_tail(&list_kill, skb);
}
__skb_unlink(skb, rcvq);
__skb_queue_tail(&list_kill, skb);
}
- res = skb ? skb->len :
0
;
+ res = skb ? skb->len :
-1
;
spin_unlock_bh(&rcvq->lock);
if (!skb_queue_empty(&list_kill)) {
spin_unlock_bh(&rcvq->lock);
if (!skb_queue_empty(&list_kill)) {
@@
-1232,7
+1232,7
@@
int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
case SIOCINQ:
{
case SIOCINQ:
{
-
unsigned int amount = first_packet_length(sk
);
+
int amount = max_t(int, 0, first_packet_length(sk)
);
return put_user(amount, (int __user *)arg);
}
return put_user(amount, (int __user *)arg);
}
@@
-2184,7
+2184,7
@@
unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
/* Check for false positives due to checksum errors */
if ((mask & POLLRDNORM) && !(file->f_flags & O_NONBLOCK) &&
/* Check for false positives due to checksum errors */
if ((mask & POLLRDNORM) && !(file->f_flags & O_NONBLOCK) &&
- !(sk->sk_shutdown & RCV_SHUTDOWN) &&
!first_packet_length(sk)
)
+ !(sk->sk_shutdown & RCV_SHUTDOWN) &&
first_packet_length(sk) == -1
)
mask &= ~(POLLIN | POLLRDNORM);
return mask;
mask &= ~(POLLIN | POLLRDNORM);
return mask;
@@
-2216,7
+2216,6
@@
struct proto udp_prot = {
.sysctl_wmem = &sysctl_udp_wmem_min,
.sysctl_rmem = &sysctl_udp_rmem_min,
.obj_size = sizeof(struct udp_sock),
.sysctl_wmem = &sysctl_udp_wmem_min,
.sysctl_rmem = &sysctl_udp_rmem_min,
.obj_size = sizeof(struct udp_sock),
- .slab_flags = SLAB_DESTROY_BY_RCU,
.h.udp_table = &udp_table,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_udp_setsockopt,
.h.udp_table = &udp_table,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_udp_setsockopt,
This page took
0.026441 seconds
and
5
git commands to generate.