From e43b2ba087a749f8638ea4cc6c2d60d426b08479 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 11 Aug 1998 19:08:42 +0000 Subject: [PATCH] Fixed printf format errors (ntohl() returns in_addr_t = u_int32_t != long on some 64-bit systems). print_ip() should use inet_ntoa() instead of bloated inline code with 4 ntohl()s. --- sys/netinet/ip_fw.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c index 589208bb0a93..5ef7ec657bb4 100644 --- a/sys/netinet/ip_fw.c +++ b/sys/netinet/ip_fw.c @@ -12,7 +12,7 @@ * * This software is provided ``AS IS'' without any warranties of any kind. * - * $Id: ip_fw.c,v 1.93 1998/07/18 23:27:15 alex Exp $ + * $Id: ip_fw.c,v 1.94 1998/08/03 17:23:37 dfr Exp $ */ /* @@ -73,10 +73,11 @@ SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, verbose_limit, CTLFLAG_RW, &fw_verbose_lim #define dprintf(a) if (!fw_debug); else printf a -#define print_ip(a) printf("%ld.%ld.%ld.%ld",(ntohl(a.s_addr)>>24)&0xFF,\ - (ntohl(a.s_addr)>>16)&0xFF,\ - (ntohl(a.s_addr)>>8)&0xFF,\ - (ntohl(a.s_addr))&0xFF); +#define print_ip(a) printf("%d.%d.%d.%d", \ + (int)(ntohl(a.s_addr) >> 24) & 0xFF, \ + (int)(ntohl(a.s_addr) >> 16) & 0xFF, \ + (int)(ntohl(a.s_addr) >> 8) & 0xFF, \ + (int)(ntohl(a.s_addr)) & 0xFF); #define dprint_ip(a) if (!fw_debug); else print_ip(a)