net: tcp: Removed copy of conn->unacked_len
In the function tcp_send_data, the variable conn->unacked_len in copied into a local variable pos. This value is only used in one location and used mixed with the original conn->unacked_len. This fix removes pos and switches to use conn->unacked_len everywhere to reduce the chance of confusion. This does not functionally change the code. Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
This commit is contained in:
parent
4b9a8a8471
commit
2d824f4811
1 changed files with 2 additions and 3 deletions
|
@ -1006,10 +1006,9 @@ static int tcp_unsent_len(struct tcp *conn)
|
||||||
static int tcp_send_data(struct tcp *conn)
|
static int tcp_send_data(struct tcp *conn)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int pos, len;
|
int len;
|
||||||
struct net_pkt *pkt;
|
struct net_pkt *pkt;
|
||||||
|
|
||||||
pos = conn->unacked_len;
|
|
||||||
len = MIN3(conn->send_data_total - conn->unacked_len,
|
len = MIN3(conn->send_data_total - conn->unacked_len,
|
||||||
conn->send_win - conn->unacked_len,
|
conn->send_win - conn->unacked_len,
|
||||||
conn_mss(conn));
|
conn_mss(conn));
|
||||||
|
@ -1026,7 +1025,7 @@ static int tcp_send_data(struct tcp *conn)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = tcp_pkt_peek(pkt, conn->send_data, pos, len);
|
ret = tcp_pkt_peek(pkt, conn->send_data, conn->unacked_len, len);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
tcp_pkt_unref(pkt);
|
tcp_pkt_unref(pkt);
|
||||||
ret = -ENOBUFS;
|
ret = -ENOBUFS;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue