diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 22:48:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 22:48:18 -0500 |
commit | ed408f7c0fab7ecc72f94f204f0d2607b2749f69 (patch) | |
tree | 8c85eb47814fff6c9ea0aa6177e47555c0f9c5b1 /net/ipv4 | |
parent | 52f7a82b59ff385da86a3ed17c8d9f6a83531004 (diff) | |
parent | 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619 (diff) |
Merge 3.9-rc4 into driver-core-next
This is to fix up a build problem with a wireless driver due to the
dynamic-debug patches in this branch.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 15 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 4 |
3 files changed, 14 insertions, 7 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 3c9d20880283..d9c4f113d709 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -590,7 +590,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
590 | case IP_TTL: | 590 | case IP_TTL: |
591 | if (optlen < 1) | 591 | if (optlen < 1) |
592 | goto e_inval; | 592 | goto e_inval; |
593 | if (val != -1 && (val < 0 || val > 255)) | 593 | if (val != -1 && (val < 1 || val > 255)) |
594 | goto e_inval; | 594 | goto e_inval; |
595 | inet->uc_ttl = val; | 595 | inet->uc_ttl = val; |
596 | break; | 596 | break; |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 1ca253635f7a..2aa69c8ae60c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1428,12 +1428,12 @@ static void tcp_service_net_dma(struct sock *sk, bool wait) | |||
1428 | } | 1428 | } |
1429 | #endif | 1429 | #endif |
1430 | 1430 | ||
1431 | static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) | 1431 | static struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) |
1432 | { | 1432 | { |
1433 | struct sk_buff *skb; | 1433 | struct sk_buff *skb; |
1434 | u32 offset; | 1434 | u32 offset; |
1435 | 1435 | ||
1436 | skb_queue_walk(&sk->sk_receive_queue, skb) { | 1436 | while ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) { |
1437 | offset = seq - TCP_SKB_CB(skb)->seq; | 1437 | offset = seq - TCP_SKB_CB(skb)->seq; |
1438 | if (tcp_hdr(skb)->syn) | 1438 | if (tcp_hdr(skb)->syn) |
1439 | offset--; | 1439 | offset--; |
@@ -1441,6 +1441,11 @@ static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) | |||
1441 | *off = offset; | 1441 | *off = offset; |
1442 | return skb; | 1442 | return skb; |
1443 | } | 1443 | } |
1444 | /* This looks weird, but this can happen if TCP collapsing | ||
1445 | * splitted a fat GRO packet, while we released socket lock | ||
1446 | * in skb_splice_bits() | ||
1447 | */ | ||
1448 | sk_eat_skb(sk, skb, false); | ||
1444 | } | 1449 | } |
1445 | return NULL; | 1450 | return NULL; |
1446 | } | 1451 | } |
@@ -1482,7 +1487,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
1482 | break; | 1487 | break; |
1483 | } | 1488 | } |
1484 | used = recv_actor(desc, skb, offset, len); | 1489 | used = recv_actor(desc, skb, offset, len); |
1485 | if (used < 0) { | 1490 | if (used <= 0) { |
1486 | if (!copied) | 1491 | if (!copied) |
1487 | copied = used; | 1492 | copied = used; |
1488 | break; | 1493 | break; |
@@ -1520,8 +1525,10 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
1520 | tcp_rcv_space_adjust(sk); | 1525 | tcp_rcv_space_adjust(sk); |
1521 | 1526 | ||
1522 | /* Clean up data we have read: This will do ACK frames. */ | 1527 | /* Clean up data we have read: This will do ACK frames. */ |
1523 | if (copied > 0) | 1528 | if (copied > 0) { |
1529 | tcp_recv_skb(sk, seq, &offset); | ||
1524 | tcp_cleanup_rbuf(sk, copied); | 1530 | tcp_cleanup_rbuf(sk, copied); |
1531 | } | ||
1525 | return copied; | 1532 | return copied; |
1526 | } | 1533 | } |
1527 | EXPORT_SYMBOL(tcp_read_sock); | 1534 | EXPORT_SYMBOL(tcp_read_sock); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a28e4db8a952..18f97ca76b00 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5543,7 +5543,7 @@ slow_path: | |||
5543 | if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) | 5543 | if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) |
5544 | goto csum_error; | 5544 | goto csum_error; |
5545 | 5545 | ||
5546 | if (!th->ack) | 5546 | if (!th->ack && !th->rst) |
5547 | goto discard; | 5547 | goto discard; |
5548 | 5548 | ||
5549 | /* | 5549 | /* |
@@ -5988,7 +5988,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
5988 | goto discard; | 5988 | goto discard; |
5989 | } | 5989 | } |
5990 | 5990 | ||
5991 | if (!th->ack) | 5991 | if (!th->ack && !th->rst) |
5992 | goto discard; | 5992 | goto discard; |
5993 | 5993 | ||
5994 | if (!tcp_validate_incoming(sk, skb, th, 0)) | 5994 | if (!tcp_validate_incoming(sk, skb, th, 0)) |