forked from schacon/perl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Spider Boardman
authored and
Chip Salzenberg
committed
Dec 19, 1996
1 parent
982b4e8
commit 3e6a22d
Showing
6 changed files
with
176 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters