HomeFreeBSD

tcp: improve error handling in syncache_socket()

Description

tcp: improve error handling in syncache_socket()

If syncache_socket() fails after calling tcp_newtcpcb(), the resources
allocated in tcp_newtcpcb() needs to be freed. Just call
tcp_discardcb() to do this.
Thanks to jtl for making me aware of the issue and proposing a fix.

Reviewed by: glebius, jtl, rscheff
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45749

(cherry picked from commit 3703e1a73e0e0367c04f47f793e46495e46e647b)

Details

Provenance
tuexenAuthored on Jun 27 2024, 5:25 AM
Reviewer
glebius
Differential Revision
D45749: tcp: fix cleanup when in_pcbconnect() fails in syncache_socket()
Parents
rG90ddea70e0b4: lo: update man page since SCTP checksum offloading is supported
Branches
Unknown
Tags
Unknown