]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[tcp] Calculate correct MSS from peer address
authorMichael Brown <mcb30@ipxe.org>
Tue, 4 Mar 2014 13:14:13 +0000 (13:14 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 4 Mar 2014 13:23:29 +0000 (13:23 +0000)
commite191298a1d62446646922b1f3d899dfb16da73ff
tree45aed089b8aafd2efd15d2171e314cee37eb1302
parent6414b5ca036ade7545eb0c309c66731fced6e055
[tcp] Calculate correct MSS from peer address

iPXE currently advertises a fixed MSS of 1460, which is correct only
for IPv4 over Ethernet.  For IPv6 over Ethernet, the value should be
1440 (allowing for the larger IPv6 header).  For non-Ethernet link
layers, the value should reflect the MTU of the underlying network
device.

Use tcpip_mtu() to calculate the transport-layer MTU associated with
the peer address, and calculate the MSS to allow for an optionless TCP
header as per RFC 6691.

As a side benefit, we can now fail a connection immediately with a
meaningful error message if we have no route to the destination
address.

Reported-by: Anton D. Kachalov <mouse@yandex-team.ru>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/tcp.h
src/net/tcp.c