From 359ecc7a8c3099e994d69e071e58608a92ce1ea6 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 4 Nov 2009 23:37:34 +0100 Subject: [PATCH] ACCOUNT: transfer table data in host order Make compatibility happy. --- extensions/ACCOUNT/iptaccount.c | 4 ++-- extensions/ACCOUNT/xt_ACCOUNT.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/ACCOUNT/iptaccount.c b/extensions/ACCOUNT/iptaccount.c index 43045f3..e81488c 100644 --- a/extensions/ACCOUNT/iptaccount.c +++ b/extensions/ACCOUNT/iptaccount.c @@ -39,9 +39,9 @@ static char *addr_to_dotted(unsigned int addr) static char buf[16]; const unsigned char *bytep; - addr = ntohl(addr); + addr = htonl(addr); bytep = (const unsigned char *)&addr; - snprintf(buf, sizeof(buf), "%u.%u.%u.%u", bytep[3], bytep[2], bytep[1], bytep[0]); + snprintf(buf, sizeof(buf), "%u.%u.%u.%u", bytep[0], bytep[1], bytep[2], bytep[3]); return buf; } diff --git a/extensions/ACCOUNT/xt_ACCOUNT.c b/extensions/ACCOUNT/xt_ACCOUNT.c index 4616573..e241261 100644 --- a/extensions/ACCOUNT/xt_ACCOUNT.c +++ b/extensions/ACCOUNT/xt_ACCOUNT.c @@ -746,7 +746,7 @@ static int ipt_acc_handle_copy_data(void *to_user, unsigned long *to_user_pos, for (i = 0; i <= 255; i++) { if (data->ip[i].src_packets || data->ip[i].dst_packets) { - handle_ip.ip = htonl(net_ip | net_OR_mask | i); + handle_ip.ip = net_ip | net_OR_mask | i; handle_ip.src_packets = data->ip[i].src_packets; handle_ip.src_bytes = data->ip[i].src_bytes;