HomeFreeBSD

tcp: improve mbuf handling when processing SYN segments

Description

tcp: improve mbuf handling when processing SYN segments

When the sysctl-variable net.inet.ip.accept_sourceroute is non-zero,
an mbuf would be leaked when processing a SYN-segment containing an
IPv4 strict or loose source routing option, when the on-stack
syncache entry is used or there is an error related to processing
TCP MD5 options.
Fix this by freeing the mbuf whenever an error occurred or the
on-stack syncache entry is used.

Reviewed by: markj, rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46839

(cherry picked from commit 01eb635d12953e24ee5fae69692c28e4aab4f0f6)

Details

Provenance
tuexenAuthored on Sep 30 2024, 6:00 PM
Reviewer
markj
Differential Revision
D46839: tcp: improve mbuf handling when processing SYN
Parents
rG5414cef63485: tcp: whitespace cleanup
Branches
Unknown
Tags
Unknown