From 1db5b918df77eaa6af1003aa8974b4dd3ce21c0c Mon Sep 17 00:00:00 2001 From: marc Date: Fri, 7 Apr 2000 17:30:28 +0000 Subject: Fixed save() to properly interpret ports in host byte order and use ':' as range separator. --- extensions/libipt_tcp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'extensions/libipt_tcp.c') diff --git a/extensions/libipt_tcp.c b/extensions/libipt_tcp.c index 94285a0..2febc28 100644 --- a/extensions/libipt_tcp.c +++ b/extensions/libipt_tcp.c @@ -377,12 +377,12 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match) printf("! "); if (tcpinfo->spts[0] != tcpinfo->spts[1]) - printf("--sport %u-%u ", - ntohs(tcpinfo->spts[0]), - ntohs(tcpinfo->spts[1])); + printf("--sport %u:%u ", + tcpinfo->spts[0], + tcpinfo->spts[1]); else printf("--sport %u ", - ntohs(tcpinfo->spts[0])); + tcpinfo->spts[0]); } if (tcpinfo->dpts[0] != 0 @@ -391,12 +391,12 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match) printf("! "); if (tcpinfo->dpts[0] != tcpinfo->dpts[1]) - printf("--dport %u-%u ", - ntohs(tcpinfo->dpts[0]), - ntohs(tcpinfo->dpts[1])); + printf("--dport %u:%u ", + tcpinfo->dpts[0], + tcpinfo->dpts[1]); else printf("--dport %u ", - ntohs(tcpinfo->dpts[0])); + tcpinfo->dpts[0]); } if (tcpinfo->option -- cgit v1.2.3