diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-01-06 17:10:45 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-01-11 01:29:45 +0100 |
| commit | facc73634a04e1ddbd7057d534df62e0c40eb274 (patch) | |
| tree | 39c419d28ebb14e6963a47b470bd0ee525bf0adb | |
| parent | edac476e268e4a0c5759a32fea9c720056de6315 (diff) | |
| download | passt-facc73634a04e1ddbd7057d534df62e0c40eb274.tar passt-facc73634a04e1ddbd7057d534df62e0c40eb274.tar.gz passt-facc73634a04e1ddbd7057d534df62e0c40eb274.tar.bz2 passt-facc73634a04e1ddbd7057d534df62e0c40eb274.tar.lz passt-facc73634a04e1ddbd7057d534df62e0c40eb274.tar.xz passt-facc73634a04e1ddbd7057d534df62e0c40eb274.tar.zst passt-facc73634a04e1ddbd7057d534df62e0c40eb274.zip | |
fwd: Remove now-unnecessary handling of unspecified oaddr from splice
fwd_nat_from_splice() has several cases that deal with the possibility of
ini->oaddr being unspecified. That used to be a possible case, but since
e3c4c4175ce6 ("tcp: Always populate oaddr field for socket initiated
flows") and 59cc89f4cc01 ("udp, udp_flow: Track our specific address on
socket interfaces") we now always populate ini->oaddr with a specified
address for all flows.
Remove the now-unnecessary fallback logic.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | fwd.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -650,7 +650,7 @@ uint8_t fwd_nat_from_splice(const struct ctx *c, uint8_t proto, const struct flowside *ini, struct flowside *tgt) { if (!inany_is_loopback(&ini->eaddr) || - (!inany_is_loopback(&ini->oaddr) && !inany_is_unspecified(&ini->oaddr))) { + !inany_is_loopback(&ini->oaddr)) { char estr[INANY_ADDRSTRLEN], fstr[INANY_ADDRSTRLEN]; debug("Non loopback address on %s: [%s]:%hu -> [%s]:%hu", @@ -660,12 +660,7 @@ uint8_t fwd_nat_from_splice(const struct ctx *c, uint8_t proto, return PIF_NONE; } - if (!inany_is_unspecified(&ini->oaddr)) - tgt->eaddr = ini->oaddr; - else if (inany_v4(&ini->oaddr)) - tgt->eaddr = inany_loopback4; - else - tgt->eaddr = inany_loopback6; + tgt->eaddr = ini->oaddr; /* Preserve the specific loopback address used, but let the kernel pick * a source port on the target side |
