tcp: Remove redundant and incorrect initialization from *_iov_init()
tcp_sock[46]_iov_init() initialize the length of each iovec buffer to MSS_DEFAULT. That will always be overwritten before use in tcp_data_to_tap, so it's redundant. It also wasn't correct, because it didn't correctly account for the header lengths in all cases. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
716a926ef4
commit
dcea26076d
1 changed files with 2 additions and 6 deletions
8
tcp.c
8
tcp.c
|
@ -1072,10 +1072,8 @@ static void tcp_sock4_iov_init(void)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, iov = tcp4_l2_iov; i < TCP_FRAMES_MEM; i++, iov++) {
|
for (i = 0, iov = tcp4_l2_iov; i < TCP_FRAMES_MEM; i++, iov++)
|
||||||
iov->iov_base = &tcp4_l2_buf[i].vnet_len;
|
iov->iov_base = &tcp4_l2_buf[i].vnet_len;
|
||||||
iov->iov_len = MSS_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0, iov = tcp4_l2_flags_iov; i < TCP_FRAMES_MEM; i++, iov++)
|
for (i = 0, iov = tcp4_l2_flags_iov; i < TCP_FRAMES_MEM; i++, iov++)
|
||||||
iov->iov_base = &tcp4_l2_flags_buf[i].vnet_len;
|
iov->iov_base = &tcp4_l2_flags_buf[i].vnet_len;
|
||||||
|
@ -1104,10 +1102,8 @@ static void tcp_sock6_iov_init(void)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, iov = tcp6_l2_iov; i < TCP_FRAMES_MEM; i++, iov++) {
|
for (i = 0, iov = tcp6_l2_iov; i < TCP_FRAMES_MEM; i++, iov++)
|
||||||
iov->iov_base = &tcp6_l2_buf[i].vnet_len;
|
iov->iov_base = &tcp6_l2_buf[i].vnet_len;
|
||||||
iov->iov_len = MSS_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0, iov = tcp6_l2_flags_iov; i < TCP_FRAMES_MEM; i++, iov++)
|
for (i = 0, iov = tcp6_l2_flags_iov; i < TCP_FRAMES_MEM; i++, iov++)
|
||||||
iov->iov_base = &tcp6_l2_flags_buf[i].vnet_len;
|
iov->iov_base = &tcp6_l2_flags_buf[i].vnet_len;
|
||||||
|
|
Loading…
Reference in a new issue