Bug 29496 - getaddrinfo follows RFC 3484 which is obsoleted by RFC 6724
Summary: getaddrinfo follows RFC 3484 which is obsoleted by RFC 6724
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-15 20:48 UTC by Paweł Krawczyk
Modified: 2022-09-01 11:44 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paweł Krawczyk 2022-08-15 20:48:47 UTC
IPv6 prefix priorities defined in gai.conf(5) and hardcoded defaults in getaddrinfo(3) follow the priorities defined in RFC 3484 (2003) while there's much newer RFC 6724 (2012) that obsoleted the former.

getaddrinfo.c
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/getaddrinfo.c;hb=8bc3f94a062776abfaf14201fba37bea5328bf92#l1305

gai.conf:
https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/gai.conf;h=4616ed005b2e064175c88609b6d6022a6da4d5d8;hb=115411772b189e9e41a97618816edd66f0a9a620

Contents of the latter should be updated to the following (comments removed for clarity), same for getaddrinfo.c except these need encoding into C structures:

# RFC 6724, section 2.1 Policy Table - Label

label ::1/128       0
label ::/0          1
label ::ffff:0:0/96 4
label 2002::/16     2
label 2001::/32     5
label fc00::/7     13
label ::/96         3
label fec0::/10    11
label 3ffe::/16    12

# RFC 6724, section 2.1 Policy Table - Precedence

precedence  ::1/128       50
precedence  ::/0          40
precedence  ::ffff:0:0/96 35
precedence  2002::/16     30
precedence  2001::/32      5
precedence  fc00::/7       3
precedence  ::/96          1
precedence  fec0::/10      1
precedence  3ffe::/16      1
Comment 1 Andreas Schwab 2022-09-01 11:44:52 UTC
The address selection rules have been updated as well.