diff options
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 7649d775007..439d2a34ee4 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -487,7 +487,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
487 | * LATER: this step can be merged to real generation of fragments, | 487 | * LATER: this step can be merged to real generation of fragments, |
488 | * we can switch to copy when see the first bad fragment. | 488 | * we can switch to copy when see the first bad fragment. |
489 | */ | 489 | */ |
490 | if (skb_has_frags(skb)) { | 490 | if (skb_has_frag_list(skb)) { |
491 | struct sk_buff *frag, *frag2; | 491 | struct sk_buff *frag, *frag2; |
492 | int first_len = skb_pagelen(skb); | 492 | int first_len = skb_pagelen(skb); |
493 | 493 | ||
@@ -844,10 +844,9 @@ int ip_append_data(struct sock *sk, | |||
844 | inet->cork.length = 0; | 844 | inet->cork.length = 0; |
845 | sk->sk_sndmsg_page = NULL; | 845 | sk->sk_sndmsg_page = NULL; |
846 | sk->sk_sndmsg_off = 0; | 846 | sk->sk_sndmsg_off = 0; |
847 | if ((exthdrlen = rt->dst.header_len) != 0) { | 847 | exthdrlen = rt->dst.header_len; |
848 | length += exthdrlen; | 848 | length += exthdrlen; |
849 | transhdrlen += exthdrlen; | 849 | transhdrlen += exthdrlen; |
850 | } | ||
851 | } else { | 850 | } else { |
852 | rt = (struct rtable *)inet->cork.dst; | 851 | rt = (struct rtable *)inet->cork.dst; |
853 | if (inet->cork.flags & IPCORK_OPT) | 852 | if (inet->cork.flags & IPCORK_OPT) |
@@ -934,16 +933,19 @@ alloc_new_skb: | |||
934 | !(rt->dst.dev->features&NETIF_F_SG)) | 933 | !(rt->dst.dev->features&NETIF_F_SG)) |
935 | alloclen = mtu; | 934 | alloclen = mtu; |
936 | else | 935 | else |
937 | alloclen = datalen + fragheaderlen; | 936 | alloclen = fraglen; |
938 | 937 | ||
939 | /* The last fragment gets additional space at tail. | 938 | /* The last fragment gets additional space at tail. |
940 | * Note, with MSG_MORE we overallocate on fragments, | 939 | * Note, with MSG_MORE we overallocate on fragments, |
941 | * because we have no idea what fragment will be | 940 | * because we have no idea what fragment will be |
942 | * the last. | 941 | * the last. |
943 | */ | 942 | */ |
944 | if (datalen == length + fraggap) | 943 | if (datalen == length + fraggap) { |
945 | alloclen += rt->dst.trailer_len; | 944 | alloclen += rt->dst.trailer_len; |
946 | 945 | /* make sure mtu is not reached */ | |
946 | if (datalen > mtu - fragheaderlen - rt->dst.trailer_len) | ||
947 | datalen -= ALIGN(rt->dst.trailer_len, 8); | ||
948 | } | ||
947 | if (transhdrlen) { | 949 | if (transhdrlen) { |
948 | skb = sock_alloc_send_skb(sk, | 950 | skb = sock_alloc_send_skb(sk, |
949 | alloclen + hh_len + 15, | 951 | alloclen + hh_len + 15, |
@@ -960,7 +962,7 @@ alloc_new_skb: | |||
960 | else | 962 | else |
961 | /* only the initial fragment is | 963 | /* only the initial fragment is |
962 | time stamped */ | 964 | time stamped */ |
963 | ipc->shtx.flags = 0; | 965 | ipc->tx_flags = 0; |
964 | } | 966 | } |
965 | if (skb == NULL) | 967 | if (skb == NULL) |
966 | goto error; | 968 | goto error; |
@@ -971,7 +973,7 @@ alloc_new_skb: | |||
971 | skb->ip_summed = csummode; | 973 | skb->ip_summed = csummode; |
972 | skb->csum = 0; | 974 | skb->csum = 0; |
973 | skb_reserve(skb, hh_len); | 975 | skb_reserve(skb, hh_len); |
974 | *skb_tx(skb) = ipc->shtx; | 976 | skb_shinfo(skb)->tx_flags = ipc->tx_flags; |
975 | 977 | ||
976 | /* | 978 | /* |
977 | * Find where to start putting bytes. | 979 | * Find where to start putting bytes. |
@@ -1391,7 +1393,7 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1391 | 1393 | ||
1392 | daddr = ipc.addr = rt->rt_src; | 1394 | daddr = ipc.addr = rt->rt_src; |
1393 | ipc.opt = NULL; | 1395 | ipc.opt = NULL; |
1394 | ipc.shtx.flags = 0; | 1396 | ipc.tx_flags = 0; |
1395 | 1397 | ||
1396 | if (replyopts.opt.optlen) { | 1398 | if (replyopts.opt.optlen) { |
1397 | ipc.opt = &replyopts.opt; | 1399 | ipc.opt = &replyopts.opt; |