Bug 261697 - ipfw fwd don't change output interface/gateway in Freebsd 13.0
Summary: ipfw fwd don't change output interface/gateway in Freebsd 13.0
Status: Closed DUPLICATE of bug 256828
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Alexander V. Chernikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-03 19:18 UTC by Andrey Blochintsev
Modified: 2022-07-02 11:50 UTC (History)
6 users (show)

See Also:


Attachments
"ipfw fwd REMOTE" fix for FreeBSD 13.0 (452 bytes, patch)
2022-02-03 19:18 UTC, Andrey Blochintsev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Blochintsev 2022-02-03 19:18:17 UTC
Created attachment 231541 [details]
"ipfw fwd REMOTE" fix for FreeBSD 13.0

"ipfw fwd RemoteIP ...." is broken in FreeBSD 13.0 (it works as "pass" but no change in packet path).
Comment 1 dewayne 2022-03-28 00:40:58 UTC
I suspect that this PR describes the same problem as:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256828 (June 2021)
Comment 2 Xin LI freebsd_committer freebsd_triage 2022-03-28 01:15:11 UTC
-> melifaro@ for triage.
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-04-11 11:25:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7d98cc096b995ca3bfd85277ed009b0f872c3e1b

commit 7d98cc096b995ca3bfd85277ed009b0f872c3e1b
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2022-04-01 13:49:25 +0000
Commit:     Andrey V. Elsukov <ae@FreeBSD.org>
CommitDate: 2022-04-11 11:16:43 +0000

    Fix ipfw fwd that doesn't work in some cases

    For IPv4 use dst pointer as destination address in fib4_lookup().
    It keeps destination address from IPv4 header and can be changed
    when PACKET_TAG_IPFORWARD tag was set by packet filter.

    For IPv6 override destination address with address from dst_sa.sin6_addr,
    that was set from PACKET_TAG_IPFORWARD tag.

    Reviewed by:    eugen
    MFC after:      1 week
    PR:             256828, 261697, 255705
    Differential Revision: https://reviews.freebsd.org/D34732

 sys/netinet/ip_output.c   | 2 +-
 sys/netinet6/ip6_output.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-04-18 09:11:48 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=17c9c2049004038ed6f2dc23a64cb9f74411ec52

commit 17c9c2049004038ed6f2dc23a64cb9f74411ec52
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2022-04-01 13:49:25 +0000
Commit:     Andrey V. Elsukov <ae@FreeBSD.org>
CommitDate: 2022-04-18 08:58:45 +0000

    Fix ipfw fwd that doesn't work in some cases

    For IPv4 use dst pointer as destination address in fib4_lookup().
    It keeps destination address from IPv4 header and can be changed
    when PACKET_TAG_IPFORWARD tag was set by packet filter.

    For IPv6 override destination address with address from dst_sa.sin6_addr,
    that was set from PACKET_TAG_IPFORWARD tag.

    Reviewed by:    eugen
    PR:             256828, 261697, 255705
    Differential Revision: https://reviews.freebsd.org/D34732

    (cherry picked from commit 7d98cc096b995ca3bfd85277ed009b0f872c3e1b)

 sys/netinet/ip_output.c   | 2 +-
 sys/netinet6/ip6_output.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
Comment 5 Eugene Grosbein freebsd_committer freebsd_triage 2022-07-02 11:50:32 UTC
Duplicate of already fixed PR 256828.

*** This bug has been marked as a duplicate of bug 256828 ***