diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-08-21 13:46:02 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-08-21 13:48:23 +0200 |
commit | 137b0a2ac9568638be078126ca92ac62ca51e1f4 (patch) | |
tree | 3994a06746f1f9e3e1a216a07ec8119c0345a9b0 | |
parent | 3733cabc2640d00a0fc3aee2d37d1bb9d097fc0f (diff) | |
download | conntrack-tools-137b0a2ac9568638be078126ca92ac62ca51e1f4.tar.gz conntrack-tools-137b0a2ac9568638be078126ca92ac62ca51e1f4.zip |
cthelper: ftp: fix EPRT case for IPv4
%pI4 also exists in the Linux kernel.
It would be good to have some generic functions to convert binary data
to address string. Later.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/helpers/ftp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/helpers/ftp.c b/src/helpers/ftp.c index 962020b..2c8dcd6 100644 --- a/src/helpers/ftp.c +++ b/src/helpers/ftp.c @@ -346,7 +346,12 @@ static int nf_nat_ftp_fmt_cmd(enum nf_ct_ftp_type type, port >> 8, port & 0xFF); case NF_CT_FTP_EPRT: - return snprintf(buffer, buflen, "|1|%pI4|%u|", &addr, port); + return snprintf(buffer, buflen, "|1|%u.%u.%u.%u|%u|", + ((unsigned char *)&addr)[0], + ((unsigned char *)&addr)[1], + ((unsigned char *)&addr)[2], + ((unsigned char *)&addr)[3], + port); case NF_CT_FTP_EPSV: return snprintf(buffer, buflen, "|||%u|", port); } |