opnsense-src/sys/netinet/libalias
Mark Johnston fb2ea26f3c libalias: Handle GetNewPort() errors properly
AddLink() fails when memory allocation fails or no free port is
available; both are error conditions.  However, functions such as
FindUdpTcpIn() were converting such failures to PKT_ALIAS_IGNORED, which
effectively means, "pass the packet without translation," which isn't
what we want.

Fix the problem by making sure that AddLink() errors are converted to
PKT_ALIAS_ERROR where appropriate.  The diff is a bit large but is
mostly mechanical: functions like TcpAliasOut() are converted to return
a result code, and an additional out-parameter is added to return the
alias_link pointer.

Reported by:	Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Tested by:	Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D47778
2025-04-18 15:11:51 +00:00
..
alias.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias.h libalias: Add support for EIM NAT 2024-12-05 16:19:13 +00:00
alias_db.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_db.h libalias: Add support for EIM NAT 2024-12-05 16:19:13 +00:00
alias_dummy.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_ftp.c tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
alias_irc.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_local.h libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_mod.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_mod.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
alias_nbt.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_pptp.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
alias_proxy.c tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
alias_sctp.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
alias_sctp.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
alias_skinny.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_smedia.c libalias: Handle GetNewPort() errors properly 2025-04-18 15:11:51 +00:00
alias_util.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
HISTORY sys: Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:17 -06:00
libalias.3 man: Remove references to classful networks 2025-02-04 22:27:21 +01:00