/[base]
ViewVC logotype

Revision 330665


Jump to revision: Previous Next
Author: cem
Date: Thu Mar 8 17:23:18 2018 UTC (6 years, 3 months ago)
Changed paths: 1
Log Message:
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


Changed paths

Path Details
Directoryhead/sbin/ipfw/tables.c modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27