Summary: | ftp-proxy doesn't work properly | ||
---|---|---|---|
Product: | Base System | Reporter: | Kan Sasaki <sasaki12> |
Component: | bin | Assignee: | Kristof Provost <kp> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | kp |
Priority: | --- | ||
Version: | 12.2-STABLE | ||
Hardware: | amd64 | ||
OS: | Any |
Description
Kan Sasaki
2021-07-01 08:27:23 UTC
Can you test this: diff --git a/contrib/pf/ftp-proxy/filter.c b/contrib/pf/ftp-proxy/filter.c index dad6324808bc..e4787985e99f 100644 --- a/contrib/pf/ftp-proxy/filter.c +++ b/contrib/pf/ftp-proxy/filter.c @@ -103,8 +103,7 @@ add_nat(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, &satosin6(nat)->sin6_addr.s6_addr, 16); memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16); } - if (pfctl_add_rule(dev, &pfrule, pfanchor, pfanchor_call, - pfticket, pfpool_ticket)) + if (ioctl(dev, DIOCADDADDR, &pfp) == -1) return (-1); pfrule.rpool.proxy_port[0] = nat_range_low; @@ -138,8 +137,7 @@ add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, &satosin6(rdr)->sin6_addr.s6_addr, 16); memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16); } - if (pfctl_add_rule(dev, &pfrule, pfanchor, pfanchor_call, - pfticket, pfpool_ticket)) + if (ioctl(dev, DIOCADDADDR, &pfp) == -1) return (-1); pfrule.rpool.proxy_port[0] = rdr_port; (In reply to Kristof Provost from comment #1) Yes. But the result is no good. 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 229 Entering Extended Passive Mode (|||55485|) (stopping here) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=dd82fd3543022017b84007ac1a0d45fc683f9850 commit dd82fd3543022017b84007ac1a0d45fc683f9850 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-01 15:15:36 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-07-01 19:34:40 +0000 pf tests: ftp-proxy test Basic test case for ftp-proxy PR: 256917 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/proxy.sh (new) | 95 +++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8923ea6c867fd75b08b76883ec122c429a4018f9 commit 8923ea6c867fd75b08b76883ec122c429a4018f9 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-01 15:16:10 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-07-01 19:34:40 +0000 ftp-proxy: Revert incorrect migration to libpfctl libpfctl supports creating rules, but not (yet) adding addresses to a pool. Adding addresses certainly does not work through adding a rule. PR: 256917 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") contrib/pf/ftp-proxy/filter.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (In reply to Kan Sasaki from comment #2) I'm going to need more details on your setup and what goes wrong, because I've tested the fix and added a test case for ftp-proxy. With the below fix it just works. I've just committed both fix and test to main, and I'd expect it to be final. (In reply to Kristof Provost from comment #5) I've done something wrong during tests. I did patch, buildworld and installworld again and it worked fine. Sorry for noise. A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f6d448caf69889eca9e41a0815db65a22fe7652d commit f6d448caf69889eca9e41a0815db65a22fe7652d Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-01 15:15:36 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-07-08 06:47:09 +0000 pf tests: ftp-proxy test Basic test case for ftp-proxy PR: 256917 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit dd82fd3543022017b84007ac1a0d45fc683f9850) tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/proxy.sh (new) | 95 +++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=4f5a2009ad8ad98a457ddecb63fe1ed8a968226d commit 4f5a2009ad8ad98a457ddecb63fe1ed8a968226d Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-01 15:16:10 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-07-08 06:46:54 +0000 ftp-proxy: Revert incorrect migration to libpfctl libpfctl supports creating rules, but not (yet) adding addresses to a pool. Adding addresses certainly does not work through adding a rule. PR: 256917 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 8923ea6c867fd75b08b76883ec122c429a4018f9) contrib/pf/ftp-proxy/filter.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e26de428fa542c0fd62a696e2d721ff6f8dbc5db commit e26de428fa542c0fd62a696e2d721ff6f8dbc5db Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-01 15:15:36 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-07-08 06:49:56 +0000 pf tests: ftp-proxy test Basic test case for ftp-proxy PR: 256917 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit dd82fd3543022017b84007ac1a0d45fc683f9850) tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/proxy.sh (new) | 95 +++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d442d97b7632628ac3cf3e591ddbd8b872c14818 commit d442d97b7632628ac3cf3e591ddbd8b872c14818 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-01 15:16:10 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-07-08 06:49:56 +0000 ftp-proxy: Revert incorrect migration to libpfctl libpfctl supports creating rules, but not (yet) adding addresses to a pool. Adding addresses certainly does not work through adding a rule. PR: 256917 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 8923ea6c867fd75b08b76883ec122c429a4018f9) contrib/pf/ftp-proxy/filter.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) |