Dear all:
Sorry for the previous mail. I've found the problem.
In new version of ipfilter 3.4.25, the nat_outlookup() function
in ip_nat.c does a transformation from network byte-order to
host byte-order on port numbers.
Before we looking up RDR entry through ioctl(SIOCGNATL),
the port number filled in natlookup_t structure originally
are network byte-order, and the second transformation in
nat_outlookup() will caused the error.
So, the solution is to fill port number in natlookup_t
structure as "host byte-order", not "network byte-order".
Now, it works.
BTW, is this a modification for all future releases?
Chun-Ying Huang wrote:
> Dear all:
>
> Both my transparent proxy and sample/proxy.c can not work with
> current ipfilter (I've tested it on 3.4.25 & 3.4.27) on my
> NetBSD 1.5.2 box.
>
> But they both works on 3.4.21 (sorry for that I didn't test is
> on 3.4.22 - 3.4.24).
>
> When making system call to ioctl(SIOCGNATL) always gets -1.
>
> Does new version of ipfilter change it behavior on ioctl(SIOCGNATL)?
>
--
Regards,
huangant <Chun-Ying Huang>