Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200540
b: refs/heads/master
c: 26cde9f
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jun 21, 2010
1 parent 5169e4b commit 174920a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13fea6d4f73942e6961aec97ba4c593619d18f6f
refs/heads/master: 26cde9f7e2747b6d254b704594eed87ab959afa5
9 changes: 6 additions & 3 deletions trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,10 @@ int ip_append_data(struct sock *sk,
!exthdrlen)
csummode = CHECKSUM_PARTIAL;

skb = skb_peek_tail(&sk->sk_write_queue);

inet->cork.length += length;
if (((length> mtu) || !skb_queue_empty(&sk->sk_write_queue)) &&
if (((length > mtu) || (skb && skb_is_gso(skb))) &&
(sk->sk_protocol == IPPROTO_UDP) &&
(rt->u.dst.dev->features & NETIF_F_UFO)) {
err = ip_ufo_append_data(sk, getfrag, from, length, hh_len,
Expand All @@ -892,7 +894,7 @@ int ip_append_data(struct sock *sk,
* adding appropriate IP header.
*/

if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL)
if (!skb)
goto alloc_new_skb;

while (length > 0) {
Expand Down Expand Up @@ -1121,7 +1123,8 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
return -EINVAL;

inet->cork.length += size;
if ((sk->sk_protocol == IPPROTO_UDP) &&
if ((size + skb->len > mtu) &&
(sk->sk_protocol == IPPROTO_UDP) &&
(rt->u.dst.dev->features & NETIF_F_UFO)) {
skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
Expand Down

0 comments on commit 174920a

Please sign in to comment.