svn commit: r341798 - head/sbin/ipfw

Andrey V. Elsukov ae at FreeBSD.org
Mon Dec 10 15:42:14 UTC 2018


Author: ae
Date: Mon Dec 10 15:42:13 2018
New Revision: 341798
URL: https://svnweb.freebsd.org/changeset/base/341798

Log:
  Use correct size for IPv4 address in gethostbyaddr().
  
  When u_long is 8 bytes, it returns EINVAL and 'ipfw -N show' doesn't work.
  
  Reported by:	Claudio Eichenberger <cei at yourshop.com>
  MFC after:	1 week

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c	Mon Dec 10 14:54:28 2018	(r341797)
+++ head/sbin/ipfw/ipfw2.c	Mon Dec 10 15:42:13 2018	(r341798)
@@ -1256,7 +1256,8 @@ print_ip(struct buf_pr *bp, const struct format_opts *
 	    (cmd->o.opcode == O_IP_SRC || cmd->o.opcode == O_IP_DST) ?
 		32 : contigmask((uint8_t *)&(a[1]), 32);
 	if (mb == 32 && co.do_resolv)
-		he = gethostbyaddr((char *)&(a[0]), sizeof(u_long), AF_INET);
+		he = gethostbyaddr((char *)&(a[0]), sizeof(in_addr_t),
+		    AF_INET);
 	if (he != NULL)		/* resolved to name */
 		bprintf(bp, "%s", he->h_name);
 	else if (mb == 0)	/* any */


More information about the svn-src-head mailing list