View Issue Details

IDProjectCategoryView StatusLast Update
00015731003.1(2016/18)/Issue7+TC2System Interfacespublic2024-06-11 09:07
Reportersteffen Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
Namesteffen
Organization
User Reference
Sectioninet_pton
Page Number1139
Line Number38475 ff.
Interp Status---
Final Accepted Text0001573:0005814
Summary0001573: inet_pton: clarify IPv4 "standard IPv4 dotted-decimal form"
DescriptionPOSIX says

  If the af argument of inet_pton( ) is AF_INET,
  the src string shall be in the standard IPv4
  dotted-decimal form:

    ddd.ddd.ddd.ddd

  where "ddd" is a one to three digit decimal number
  between 0 and 255 (see inet_addr( )). The inet_pton( )
  function does not accept other formats (such as the octal
  numbers, hexadecimal numbers, and fewer than four numbers
  that inet_addr( ) accepts).

Whereas it explicitly states "octal" here, text forms exist
which always use "ddd.ddd.ddd.ddd", zero padded: the source
of the strings may be end-users used to such forms.

The standard does allow "Leading zeros in individual fields
can be omitted" for IPv6, resulting in two different grades
of fault tolerance for the different IP address types.
(Not to mention that RFCs exist which update IPv6 notation
to be absolutely non-forgiving regarding compression, leading
zeroes, and even character case! (But it seems not all parts
of IETF actually do follow it, as the older, much more
forgiving initial IPv6 RFC allows all sorts of textual
representation, and i for one had a converter which flag-driven
almost supports them all (personally in favour of uppercase).))

As it stands a tolerant software is better off polishing
user data before calling inet_pton. It would be nice if the
standard would not only require decimal, but allow leading
zeroes in IPv4 address fields.
Desired ActionOn line 38479, remove "the octal numbers, ".
On line 38480, insert before the closing parenthesis
"Leading zeroes shall be allowed".
Tagstc3-2008

Activities

geoffclare

2022-04-21 16:20

manager   bugnote:0005814

On line 38478-38480, change:
The inet_pton() function does not accept other formats (such as the octal numbers, hexadecimal numbers, ...
to:
Leading zeroes shall be allowed. The inet_pton() function does not accept other formats (such as octal numbers, hexadecimal numbers, ...

Issue History

Date Modified Username Field Change
2022-03-19 00:18 steffen New Issue
2022-03-19 00:18 steffen Name => steffen
2022-03-19 00:18 steffen Section => inet_pton
2022-03-19 00:18 steffen Page Number => 1139
2022-03-19 00:18 steffen Line Number => 38475 ff.
2022-04-21 16:20 geoffclare Note Added: 0005814
2022-04-21 16:21 geoffclare Interp Status => ---
2022-04-21 16:21 geoffclare Final Accepted Text => 0001573:0005814
2022-04-21 16:21 geoffclare Status New => Resolved
2022-04-21 16:21 geoffclare Resolution Open => Accepted As Marked
2022-04-21 16:22 geoffclare Tag Attached: tc3-2008
2022-05-23 11:37 geoffclare Status Resolved => Applied
2024-06-11 09:07 agadmin Status Applied => Closed