diff options
author | bde <bde@FreeBSD.org> | 1998-08-11 19:08:42 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-08-11 19:08:42 +0000 |
commit | e86a04ed70dd92d905f073aa48b9456ce7bc8dd4 (patch) | |
tree | ac83536a98cb7ba525147c70b98a466f6e2d7e84 /sys/netinet | |
parent | eb803a26b07f16689a6cd0751506d2d6c53d5c71 (diff) | |
download | FreeBSD-src-e86a04ed70dd92d905f073aa48b9456ce7bc8dd4.zip FreeBSD-src-e86a04ed70dd92d905f073aa48b9456ce7bc8dd4.tar.gz |
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.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_fw.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c index 589208b..5ef7ec6 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) |