freebsd-dev/sbin/ipfw
Conrad Meyer 4e0a8b6105 ipfw(8): Fix endianness for Legacy and Ipv4 table hostname values
The lookup_host() helper subroutine emits a struct in_addr value in network
byte order via caller passed pointer.  However, the table value is expected
to be stored in host byte order.  On little-endian machines, this produced a
reversed endian table value for Legacy or IPv4 table types when the value
was a hostname (instead of a plain IP address).

Fix by using ntohl() on the output 32-bit address.

While here, avoid some aliasing violations by storing the lookup_host()
output in an intermediate object of the correct type.

PR:		226429
Reported by:	bugs.freebsd.org AT mx.zzux.com (also: Tested by)
Security:	ipfw hostname table rules could potentially not act as admin intended
Sponsored by:	Dell EMC Isilon
2018-03-08 17:23:18 +00:00
..
altq.c Revert r327005 - SPDX tags for license similar to BSD-2-Clause. 2017-12-20 20:25:28 +00:00
dummynet.c Revert r327005 - SPDX tags for license similar to BSD-2-Clause. 2017-12-20 20:25:28 +00:00
ipfw2.c Fix rule number truncation, use uint16_t type to specify rulenum. 2017-12-24 01:55:12 +00:00
ipfw2.h Revert r327005 - SPDX tags for license similar to BSD-2-Clause. 2017-12-20 20:25:28 +00:00
ipfw.8 DSCP values passed to setdscp need to be lowercase. 2018-02-13 10:11:39 +00:00
ipv6.c Revert r327005 - SPDX tags for license similar to BSD-2-Clause. 2017-12-20 20:25:28 +00:00
main.c Revert r327005 - SPDX tags for license similar to BSD-2-Clause. 2017-12-20 20:25:28 +00:00
Makefile Add ipfw_nat64 module that implements stateless and stateful NAT64. 2016-08-13 16:09:49 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
nat64lsn.c Make statistics nat64lsn, nat64stl an nptv6 output netstat-like: 2016-08-14 13:17:55 +00:00
nat64stl.c Make statistics nat64lsn, nat64stl an nptv6 output netstat-like: 2016-08-14 13:17:55 +00:00
nat.c Revert r327005 - SPDX tags for license similar to BSD-2-Clause. 2017-12-20 20:25:28 +00:00
nptv6.c Make statistics nat64lsn, nat64stl an nptv6 output netstat-like: 2016-08-14 13:17:55 +00:00
tables.c ipfw(8): Fix endianness for Legacy and Ipv4 table hostname values 2018-03-08 17:23:18 +00:00