Commit 65ec6097 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: tcp_sendmsg() only deals with CHECKSUM_PARTIAL

We no longer have skbs with skb->ip_summed == CHECKSUM_NONE
in TCP write queues.

We can remove dead code in tcp_sendmsg().
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dead7cdb
...@@ -1254,14 +1254,10 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1254,14 +1254,10 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
while (msg_data_left(msg)) { while (msg_data_left(msg)) {
int copy = 0; int copy = 0;
int max = size_goal;
skb = tcp_write_queue_tail(sk); skb = tcp_write_queue_tail(sk);
if (skb) { if (skb)
if (skb->ip_summed == CHECKSUM_NONE) copy = size_goal - skb->len;
max = mss_now;
copy = max - skb->len;
}
if (copy <= 0 || !tcp_skb_can_collapse_to(skb)) { if (copy <= 0 || !tcp_skb_can_collapse_to(skb)) {
bool first_skb; bool first_skb;
...@@ -1290,7 +1286,6 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1290,7 +1286,6 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
skb_entail(sk, skb); skb_entail(sk, skb);
copy = size_goal; copy = size_goal;
max = size_goal;
/* All packets are restored as if they have /* All packets are restored as if they have
* already been sent. skb_mstamp isn't set to * already been sent. skb_mstamp isn't set to
...@@ -1374,7 +1369,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1374,7 +1369,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
goto out; goto out;
} }
if (skb->len < max || (flags & MSG_OOB) || unlikely(tp->repair)) if (skb->len < size_goal || (flags & MSG_OOB) || unlikely(tp->repair))
continue; continue;
if (forced_push(tp)) { if (forced_push(tp)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment