View Issue Details

IDProjectCategoryView StatusLast Update
00009791003.1(2013)/Issue7+TC1System Interfacespublic2019-06-10 08:54
ReporterEdSchouten Assigned Toajosey  
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameEd Schouten
OrganizationNuxi
User Reference
Sectiongetaddrinfo()
Page Number925
Line Number31185
Interp Status---
Final Accepted TextSee 0000979:0002845.
Summary0000979: AI_V4MAPPED: "ai_addrlen shall be 16", should it really?
DescriptionIf I understand the description of getaddrinfo() correctly, ai_addrlen corresponds with the size of the socket address structure returned. This allows you to call connect(), bind(), etc., using [ai_addr, ai_addrlen]. There is a sentence in the article that does contradict this:

"If the AI_V4MAPPED flag is specified along with an ai_family of AF_INET6, then getaddrinfo() shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses (ai_addrlen shall be 16)"

My objection is with the "ai_addrlen shall be 16". The intent would be that ai_addrlen is set to sizeof(struct sockaddr_in6) -- not 16 specifically. Having a struct sockaddr_in6 that is only 16 bytes in size would be impossible.
Desired ActionThis part of the sentence should either be removed or replaced to state that ai_addrlen shall be sizeof(struct sockaddr_in6).
Tagstc2-2008

Activities

shware_systems

2015-08-25 07:31

reporter   bugnote:0002796

I concur; it appears that the intent of the 16 was to indicate all 16 bytes of the mapped sin6_addr are significant, and that only storing the 4 bytes of the V4 address in that location, as a way to save 12 bytes of allocation, was not to be done by conforming implementations. If the intent was the 16 be an arbitrary value indicating the address was a mapped form and not a regular IP6 address that was reported I'd think that would have been mentioned in the Application Usage section.

Don Cragun

2015-09-24 16:06

manager   bugnote:0002845

Last edited: 2015-09-24 16:07

Change:
If the AI_V4MAPPED flag is specified along with an ai_family of AF_INET6
then getaddrinfo() shall return IPv4-mapped IPv6 addresses on finding no
matching IPv6 addresses (ai_addrlen shall be 16). The AI_V4MAPPED flag
shall be ignored unless ai_family equals AF_INET6. If the AI_ALL flag is
used with the AI_V4MAPPED flag, then getaddrinfo() shall return all
matching IPv6 and IPv4 addresses. The AI_ALL flag without the
AI_V4MAPPED flag is ignored.

on P925, L31183-31187 to (keeping the IP6 shading):
By default, with an ai_family of AF_INET6, getaddrinfo() shall
return only IPv6 addresses. If the AI_V4MAPPED flag is specified along with
an ai_family of AF_INET6, then getaddrinfo() shall return
IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses. The
AI_V4MAPPED flag shall be ignored unless ai_family equals
AF_INET6. If the AI_ALL flag is used with the AI_V4MAPPED flag, then
getaddrinfo() shall return all matching IPv6 and IPv4 addresses. The
AI_ALL flag without the AI_V4MAPPED flag shall be ignored.


Issue History

Date Modified Username Field Change
2015-08-24 07:14 EdSchouten New Issue
2015-08-24 07:14 EdSchouten Status New => Under Review
2015-08-24 07:14 EdSchouten Assigned To => ajosey
2015-08-24 07:14 EdSchouten Name => Ed Schouten
2015-08-24 07:14 EdSchouten Organization => Nuxi
2015-08-24 07:14 EdSchouten Section => getaddrinfo()
2015-08-24 07:14 EdSchouten Page Number => (page or range of pages)
2015-08-24 07:14 EdSchouten Line Number => (Line or range of lines)
2015-08-25 07:31 shware_systems Note Added: 0002796
2015-09-24 15:18 nick Page Number (page or range of pages) => 925
2015-09-24 15:18 nick Line Number (Line or range of lines) => 31185
2015-09-24 15:18 nick Interp Status => ---
2015-09-24 16:06 Don Cragun Note Added: 0002845
2015-09-24 16:07 Don Cragun Note Edited: 0002845
2015-09-24 16:08 Don Cragun Final Accepted Text => See 0000979:0002845.
2015-09-24 16:08 Don Cragun Status Under Review => Resolved
2015-09-24 16:08 Don Cragun Resolution Open => Accepted As Marked
2015-09-24 16:09 Don Cragun Tag Attached: tc2-2008
2015-10-05 14:28 geoffclare Category Base Definitions and Headers => System Interfaces
2015-10-05 14:28 geoffclare Project 1003.1(2008)/Issue 7 => 1003.1(2013)/Issue7+TC1
2019-06-10 08:54 agadmin Status Resolved => Closed