OpenSolaris

Printable Version Enter a New Search
Bug ID 6724031
Synopsis au_to_in_addr_ex() mixes and matches between in_addr_t and 'struct in_addr'
State 10-Fix Delivered (Fix available in build)
Category:Subcategory audit:kernel
Keywords
Responsible Engineer Ric Aleshire
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_98
Fixed In snv_98
Release Fixed solaris_nevada(snv_98)
Related Bugs 6701744
Submit Date 9-July-2008
Last Update Date 13-May-2009
Description
 xxxxx@xxxxx.com 2008-July-09

The changes for:

6701744 kernel au_to_in_addr_ex() bug in handling v4-mapped addresses  

putback to snv_91 incorrectly treat in_addr_t and 'struct in_addr' as the
same.  Luckily, the changes only reference the size of these two which
turns out to be the same.  Still, the netinet/in.h header file states:

/*
 * Note: IPv4 address data structures usage conventions.
 * The "in_addr_t" type below (required by Unix standards)
 * is NOT a typedef of "struct in_addr" and violates the usual
 * conventions where "struct <name>" and <name>_t are corresponding
 * typedefs.
 * To minimize confusion, kernel data structures/usage prefers use
 * of "ipaddr_t" as atomic uint32_t type and avoid using "in_addr_t"
 * The user level APIs continue to follow the historic popular
 * practice of using "struct in_addr".
 */

Ideally the routine would reference ip_addr_t in place of both in_addr_t
and 'struct in_addr'.  While macros aren't strictly typed, the prototype
documented for IN6_V4MAPPED_TO_IPADDR in netinet/in.h takes an ip_addr_t as
the second argument as well:

 * void IN6_V4MAPPED_TO_IPADDR(const in6_addr_t *v6, ipaddr_t v4);

Thanks to William Roche for pointing this out.


.
Work Around
N/A
Comments
N/A