Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2018 15:42:13 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341798 - head/sbin/ipfw
Message-ID:  <201812101542.wBAFgDWZ093541@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812101542.wBAFgDWZ093541>