summaryrefslogtreecommitdiff
path: root/U/d_inetaton.U
diff options
context:
space:
mode:
authorSpider Boardman <spider@orb.nashua.nh.us>1996-12-18 23:18:14 -0500
committerChip Salzenberg <chip@atlantic.net>1996-12-20 11:14:00 +1200
commit3e6a22d2723daf415793f9a4fc1b57f4d8a576fd (patch)
treecc4df498f2fd6fdcbc20ff97c72a98c130030f3c /U/d_inetaton.U
parent982b4e8fc47473059e209787b589853f4c8f8f9e (diff)
downloadperl-3e6a22d2723daf415793f9a4fc1b57f4d8a576fd.tar.gz
Long-standing problem in Socket module
The Socket module provides an inet_aton() which isn't. It's only inet_addr(). The latter can't convert '255.255.255.255' (or various equivalents). This despite the fact that Socket.pm claims that a conversion of that address is meaningful, which it would be if we were using the real inet_aton(). Also, that address is properly the 'this-LAN' broadcast address, also known as INADDR_BROADCAST. That constant is missing from Socket.xs, even though it provides the bogus INADDR_NONE, which is merely an artifact of using inet_addr(). The all-ones broadcast address is one of the few IP addresses which the spec guarantees will be valid. It's invalid for TCP, since it's a broadcast address, but it's valid for ICMP and UDP. The patch below changes Socket.xs to use a proper inet_aton() conversion and adds the missing major INADDR constant of INADDR_BROADCAST. It includes (as the last item patched) the new metaconfig unit used to make the changes to Configure, config_h.SH, and Porting/Glossary. p5p-msgid: <199612190418.XAA07291@Orb.Nashua.NH.US>
Diffstat (limited to 'U/d_inetaton.U')
-rw-r--r--U/d_inetaton.U24
1 files changed, 24 insertions, 0 deletions
diff --git a/U/d_inetaton.U b/U/d_inetaton.U
new file mode 100644
index 0000000000..f2b592772a
--- /dev/null
+++ b/U/d_inetaton.U
@@ -0,0 +1,24 @@
+?RCS: Copyright (c) 1996, Spider Boardman
+?RCS:
+?RCS: You may distribute under the terms of either the GNU General Public
+?RCS: License or the Artistic License, as specified in the README file.
+?RCS:
+?MAKE:d_inetaton: Inlibc
+?MAKE: -pick add $@ %<
+?S:d_inetaton:
+?S: This variable conditionally defines the HAS_INET_ATON symbol, which
+?S: indicates to the C program that the inet_aton() function is available
+?S: to parse IP address "dotted-quad" strings.
+?S:.
+?C:HAS_INET_ATON:
+?C: This symbol, if defined, indicates to the C program that the
+?C: inet_aton() function is available to parse IP address "dotted-quad"
+?C: strings.
+?C:.
+?H:#$d_inetaton HAS_INET_ATON /**/
+?H:.
+?LINT:set d_inetaton
+: check whether inet_aton exists
+set inet_aton d_inetaton
+eval $inlibc
+