[Bug 226429] ipfw table add & hostname parsing
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Mar 8 04:20:23 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226429
--- Comment #1 from Conrad Meyer <cem at freebsd.org> ---
Clearly the endianness of the address is being reversed somewhere.
In ipfw/tables.c, the v->nh4 value is assumed to be host endian. It is then
converted to net endian and formatted.
However, tentry_fill_value()'s DNS resolution code is just broken for ipv4
values. It bogusly casts the (uint32 *) &v->nh4 to (struct in_addr *) and
passes it off to lookup_host(). lookup_host() uses
gethostbyname()->h_addr_list[0] to assign to the passed in struct in_addr*.
h_addr_list is a network byte order value -- so at this point, it should have
been converted to host order instead.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list