summaryrefslogtreecommitdiff
path: root/ext/Socket
Commit message (Collapse)AuthorAgeFilesLines
* In Socket::inet_ntoa(), use Perl_newSVpvf(), instead of sprintf and newSVpvn*.Nicholas Clark2010-10-251-9/+5
|
* Convert Fcntl, File::Glob, I18N::Langinfo and Socket to an XS AUTOLOAD.Nicholas Clark2010-10-212-8/+1
| | | | | All 4 use ExtUtils::Constant::ProxySubs, and only have an AUTOLOAD to deal with failed constant lookups.
* Convert Fcntl, File::Glob, I18N::Langinfo, POSIX and Socket to croak_on_error.Nicholas Clark2010-10-212-9/+4
| | | | | This is possible because all 5 use ExtUtils::Constant::ProxySubs, so the constant() routine is only used for error conditions.
* Fcntl, POSIX and Socket can all use Proxy Constant Subs unconditionally.Nicholas Clark2010-10-191-1/+1
| | | | | | | Previously each Makefile.PL had conditional code to only use them post 5.9.2, so that the code would not diverge between blead and maint-5.8. That isn't an important consideration any longer, whereas removing the conditional code here will allow their AUTOLOAD routines to be simplified.
* Convert modules in ext/ to pass minimal arguments to XSLoader::load().Nicholas Clark2010-10-141-3/+3
|
* Fix perl build problems on Stratus VOSPaul Green2010-10-031-12/+37
| | | | | | | | | | | | | | | | | | The attached text files contain patches to correct build problems on the Stratus VOS (recently renamed "OpenVOS") operating system. I have tested these changes on OpenVOS Release 17.0, which is the most-current customer release. None of these changes should affect any other OS. Makefile.SH: This patch removes the "miniperl" dependency of the "all" target. On an operating system that does not require an executable suffix, the miniperl$(EXE_EXT) dependency evaluates to "miniperl", too. But on an operating system like VOS that does have an executable suffix, miniperl$(EXE_EXT) evaluates to (in our case) "miniperl.pm" and the "miniperl" target is unresolved. ext/Socket/Socket.xs: Sadly, OpenVOS does not yet support IPv6. I edited the code to allow for this case, while retaining IPv6 support for operating systems that do support it.
* Add support for more TCP_ constants to SocketSalvador Fandino2010-06-152-2/+17
| | | | (plus bump version to 1.89)
* bump version on modules changed since 5.13.0Ricardo Signes2010-05-201-1/+1
|
* In Socket.xs, convert 3 croak()s to use %s and a constant string for the name.Nicholas Clark2010-04-241-3/+4
| | | | | This actually saves space, because xsubpp has to use each XS function's full name as a constant string to pass to newXS(), so any re-use of it is free.
* Downgrade Socket.pm's new inet_ntop and inet_pton to EXPORT_OK ratherJesse Vincent2010-03-251-2/+8
| | | | | than EXPORT as they're new functions which clobber symbols in downstream CPAN modules.
* Make the new Socket implementation of inet_pton consistent with the existing ↵Jesse Vincent2010-02-172-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Socket6 implementation of inet_pton. Fix for release-blocking ticket [perl #72884] > |https://rt.cpan.org/Ticket/Display.html?id=52497|4411113f|NJH/IO-Socket-Multicast6-0.03.tar.gz | I'll describe what's happening here, and leave it to everyone else to decide which of the interacting events is the bug, or where the fix might be. So the *entire* change is this: commit 4411113f31b3f00171bb335092b02104d29d7cd7 Author: Rafael Garcia-Suarez <rgarciasuarez@gmail.com> Date: Fri Mar 27 13:19:16 2009 +0100 Add inet_pton and inet_ntop to the list of functions exported by Socket diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index 6b268ef..7d130ba 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -198,6 +198,7 @@ use XSLoader (); @ISA = qw(Exporter); @EXPORT = qw( inet_aton inet_ntoa + inet_pton inet_ntop sockaddr_family pack_sockaddr_in unpack_sockaddr_in pack_sockaddr_un unpack_sockaddr_un and test fails like this: $ /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/bin/perl5.11.4 -Mblib t/35mcastsend.t 1..11 Constant subroutine IO::Socket::Multicast6::AF_INET6 redefined at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64. at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10 Prototype mismatch: sub IO::Socket::Multicast6::AF_INET6 () vs none at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64. at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10 Constant subroutine IO::Socket::Multicast6::PF_INET6 redefined at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64. at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10 Prototype mismatch: sub IO::Socket::Multicast6::PF_INET6 () vs none at /home/nick/Sandpit/snap5.9.x-v5.11.4-85-g95c9bfa/lib/perl5/5.11.4/Exporter.pm line 64. at /home/nick/.cpan/build/IO-Socket-Multicast6-0.03-CqGAYT/blib/lib/IO/Socket/Multicast6.pm line 10 ok 1 - use IO::Socket::Multicast6; ok 2 - Create IPv4 multicast socket ok 3 - Combined IPv4 destination address and port ok 4 - Separate IPv4 destination address and port Bad arg length for Socket::pack_sockaddr_in, length is 16, should be 4 at t/35mcastsend.t line 26. The warnings aren't actually really relevant. The "problem"s are: IO::Socket::Multicast6 isa IO::Socket::INET6 IO::Socket::INET6 isa IO::Socket so they chose to inherit all behaviour from IO::Socket. In turn IO::Socket isa IO::Handle isa Exporter. IO::Socket chooses to export everything that Socket does: sub import { my $pkg = shift; if (@_ && $_[0] eq 'sockatmark') { # not very extensible but for now, fast Exporter::export_to_level('IO::Socket', 1, $pkg, 'sockatmark'); } else { my $callpkg = caller; Exporter::export 'Socket', $callpkg, @_; } } So, this means that all those choices and delegation of behaviour (and responsibility) means that all those modules export whatever Socket exports. OO modules. So, now they also export inet_pton and inet_ntop. The test is careful to only import what it needs: use strict; use Socket6 qw/ inet_pton pack_sockaddr_in6/; use Socket qw/ pack_sockaddr_in /; use Test::More tests => 11; in particular, it wants inet_pton from Socket6, and only pack_sockaddr_in from Socket. So at that point, main::inet_pton is Socket6::inet_pton Then it does this, correctly in a BEGIN block: BEGIN { use_ok( 'IO::Socket::Multicast6' ); } The side effect of this is to import all exports from IO::Socket::Multicast6. Which, from the above chain of inheritance, is @Socket::EXPORT. So at this point, main::inet_pton is rebound to Socket::inet_pton And the test fails, because they differ, and it expected (and wanted) Socket6::inet_pton(). Socket6::inet_pton() returns 4 bytes for AF_INET, 16 bytes for AF_INET6. Socket::inet_pton() returns 16 for both. Socket::pack_sockaddr_in() wants 4 bytes. Now, to add to the fun: use IO::Socket::Multicast6 (); and use IO::Socket::Multicast6; of course mean different things. The former suppresses all exports. It turns out that with Test::More::isa_ok() has no way of doing the former: $ cat use_ok.pl use warnings; use strict; use Test::More tests => 3; package clash; BEGIN { main::use_ok 'Socket' }; package crunch; BEGIN { main::use_ok 'Socket', () }; package biff; BEGIN { main::use_ok 'Socket', 'sockaddr_family' }; package main; sub dump_lowercase_keys { my $package = shift; print "For package $package:\n"; no strict 'refs'; print " $_\n" foreach sort grep {!tr/A-Z//} keys %{"${package}::"}; print "\n"; } dump_lowercase_keys $_ foreach qw (clash crunch biff); __END__ $ perl use_ok.pl 1..3 ok 1 - use Socket; ok 2 - use Socket; ok 3 - use Socket; For package clash: inet_aton inet_ntoa pack_sockaddr_in pack_sockaddr_un sockaddr_family sockaddr_in sockaddr_un unpack_sockaddr_in unpack_sockaddr_un For package crunch: inet_aton inet_ntoa pack_sockaddr_in pack_sockaddr_un sockaddr_family sockaddr_in sockaddr_un unpack_sockaddr_in unpack_sockaddr_un For package biff: sockaddr_family So, there's no clean way to rewrite that test with use_ok to suppress imports. So, to summarise, it's due to A cascade of modules blindly exporting everything that Socket exports Socket::inet_pton() and Socket6::inet_pton() differing in behaviour A test that fails to realise that it's importing everything via use_ok This one ranks as blocker because: Socket::inet_pton() and Socket::inet_ntop() are not in any stable release Hence we have the option to change them if we do it *NOW*. I think that the right fix is the appended patch. This makes the new Socket implementation of inet_pton consistent with the existing Socket6 implementation of inet_pton.
* Replace sv_2mortal(newSVpvn(...)) with newSVpvn_flags(..., SVs_TEMP)Nicholas Clark2009-10-153-8/+8
|
* error 1539: Cannot do arithmetic with pointers to objects of unknown size.H.Merijn Brand2009-09-091-2/+2
|
* Revert Socket.t permissions to 644 after ↵Vincent Pit2009-08-311-0/+0
| | | | 89904c08923161afd23c629d5c2c7472a09c16bb
* Fix unpack of abstract socket addrs with nul byteLubomir Rintel2009-08-312-9/+13
| | | | | | | | | | | | | | Addresses of Linux abstract namespace sockets are not nul-terminated C strings, but rather an arbitrary character arrays. According to unix(7) documentation from Linux, "Null bytes in the name have no special significance." unpack_sockaddr_un() was just throwing the initial nul byte away and then treating the rest like ordinary C string when computing the length of the address, which was wrong. This fix utilizes the length of the PV for addresses starting with nul instead. The regression test was extended with check for the problem.
* Make extensions in ext run their tests from the extension's own directory.Nicholas Clark2009-08-282-4/+0
| | | | | | | | | | | Inspired by, and in parts borrows from, Schwern's branch on github, but takes a slightly different approach in places. Not quite perfect yet - ext/File-Glob still runs from t, at least one FIXME needs fixing, and the changes to dual-life modules' tests need to be filtered back upstream, and possibly modified to suit their respective authors. But it works.
* Bump version of Socket.pmRafael Garcia-Suarez2009-08-261-1/+1
|
* Add support for Abstract namespace socketsLubomir Rintel2009-08-262-6/+27
| | | | | | | | | | | | Abstract namespace sockets are Linux-specific socket type that live in AF_UNIX family, slightly abusing it to be able to use arbitrary character arrays as addresses: They start with nul byte and are not terminated by nul byte, but with the length passed to the socket() system call. Added regression test for the correct address length computation. Signed-off-by: Lubomir Rintel <lkundrak@fedoraproject.org>
* bump versions of non-dual-life modules thatDavid Mitchell2009-07-031-1/+1
| | | | | * differ between 5.10.0 and maint-5.10, or * differ between 5.8.9 and maint-5.10
* Mark all .t and .pm files as non executableRafael Garcia-Suarez2009-06-061-0/+0
|
* Fix declaration-after-statement in ext/Socket/Socket.xsAndy Dougherty2009-04-091-1/+2
| | | | | | This trivial patch lets C89-ish compilers compile Socket.c again. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
* Also skip test 20 in t/Socket.t when no IPv6 is availableVincent Pit2009-03-271-2/+1
|
* Add inet_pton and inet_ntop to the list of functions exported by SocketRafael Garcia-Suarez2009-03-271-0/+1
|
* What am I thinking? Just bump the version.Steve Peters2009-03-261-1/+1
|
* Add inet_pton() and inet_ntop() to Socket.Steve Peters2009-03-263-3/+78
|
* Remove now-redundant references to MAN3PODS in core modules' Makefile.PLs.Nicholas Clark2009-03-261-1/+0
|
* [admin] set up .gitignore filesSam Vilain2008-12-191-0/+1
| | | | | A list submitted by Paul Fenwick was briefly factored into directory-specific rules.
* $VERSION++ for all the non-dual life modules in ext/ thatNicholas Clark2008-03-311-1/+1
| | | | | Porting/cmpVERSION.pl reports differ from the 5.10.0 release. p4raw-id: //depot/perl@33621
* ext/ constingRobin Barker2007-12-221-1/+1
| | | | | | | From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <46A0F33545E63740BC7563DE59CA9C6D09399D@exchsvr2.npl.ad.local> Date: Sat, 22 Dec 2007 00:39:47 -0000 p4raw-id: //depot/perl@32703
* Add additional SUSV3 constants to Socket for use with setsockopt() Steve Peters2007-07-102-2/+16
| | | | | and getsockopt(). p4raw-id: //depot/perl@31581
* [perl #42844] careless use of gethostbyname() in Socket.xs kan@dcit.cz2007-05-042-2/+3
| | | | | | From: kan@dcit.cz (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.6.HEAD-6655-1178036242-364.42844-75-0@perl.org> p4raw-id: //depot/perl@31138
* Only use proxy constant subroutines for 5.9.x.Nicholas Clark2007-03-211-1/+1
| | | p4raw-id: //depot/perl@30671
* socketpair.t was written in 2001. At that time, Test::More got confusedNicholas Clark2007-01-091-3/+5
| | | | | | | if you forked under it. Test::More 0.47 added support to detect forking which resolves this. Hence there is now no need to fork() in a BEGIN block, which causes issues on Win32 due to how pseudofork works. p4raw-id: //depot/perl@29729
* Make use of $Config{d_pseudofork} in a couple of core testsSteve Hay2006-12-071-5/+2
| | | | | | | Can't really use it in ext/IO/t/*.t and lib/Test/Simple/t/fork.t because they are dual-lived modules and must work with older perls that don't have d_pseudofork p4raw-id: //depot/perl@29485
* Coverity is flagging a potential problem because it sees a check forNicholas Clark2006-04-161-4/+1
| | | | | | | | | NULL and assumes that this means that the variable host could be NULL. It can't, and the check added in change 13291 was a little bit more than the minimal solution needed for the bug report [ID 20011126.148] Hence remove the NULL check. p4raw-id: //depot/perl@27851
* Allow IPPROTO_ICMP and IPPROTO_UDP to be exported.Gisle Aas2006-01-181-0/+3
| | | | | These were introduced in change 26897. p4raw-id: //depot/perl@26903
* Use the IPPROTO_TCP constant instead of 6.Gisle Aas2006-01-181-3/+3
| | | p4raw-id: //depot/perl@26902
* Make sure the most common IPPROTO_* constants are always available.Gisle Aas2006-01-181-1/+4
| | | | | | | | | | These are well known numbers so it should not be a problem to hardcode values when no constant is provided by the C library. Ref <http://www.iana.org/assignments/protocol-numbers>. On some old glibc systems (eg Redhat 6) IPPROTO_TCP is an enum only and this change workaround that problem as well. p4raw-id: //depot/perl@26897
* $Socket::VERSION++; # You always miss one.Nicholas Clark2006-01-121-1/+1
| | | p4raw-id: //depot/perl@26805
* Use inlineable proxy constant subs for SocketNicholas Clark2005-12-231-0/+1
| | | p4raw-id: //depot/perl@26463
* Re: janitorial work ? [patch]Jim Cromie2005-07-081-1/+1
| | | | | | | | Message-ID: <42CC3CE9.5050606@divsol.com> (reverted all dual-lived modules since they must work with older perls too so must wait for a new Devel::PPPort) p4raw-id: //depot/perl@25101
* format/casting/warning RE: perl 5.9.1Robin Barker2004-03-171-1/+1
| | | | | Message-ID: <533D273D4014D411AB1D00062938C4D90404682E@hotel.npl.co.uk> p4raw-id: //depot/perl@22521
* Bump Socket's version to a real floating point valueNicholas Clark2004-02-291-1/+1
| | | p4raw-id: //depot/perl@22411
* Bump version numbers of moules affected by change #22258Dave Mitchell2004-02-281-1/+1
| | | | | | (removing /tmp and other insecurities) p4raw-link: @22258 on //depot/perl: 2359510ddb135dcc6e80153f51cff0a97b20b597 p4raw-id: //depot/perl@22409
* Re: [perl #15063] /tmp issuesSolar Designer2004-02-011-2/+2
| | | | | | | Message-ID: <20040125222218.GA13499@openwall.com> Remove insecure usage of /tmp from code and documentation p4raw-id: //depot/perl@22258
* Add support for Linux abstract unix domain sockets to Socket.pm.Rafael Garcia-Suarez2003-10-152-10/+33
| | | | | | Based on a idea by Alex Hudson. (Basically those are unix domain sockets whose name has a '\0' as first character.) p4raw-id: //depot/perl@21450
* Ultrix tweaks: <string.h> must not be included twiceJarkko Hietaniemi2003-08-271-1/+1
| | | | | | | (otherwise one gets prototype conflicts between the <string.h> and proto.h because Ultrix thinks e.g. Perl_ninstr has been define in <string.h>...); and Configure misprobes some features. p4raw-id: //depot/perl@20916
* XS contents changes versus VERSION non-changes.Jarkko Hietaniemi2003-08-141-1/+1
| | | p4raw-id: //depot/perl@20704
* Re: maint @ 20537Philip Newton2003-08-071-3/+3
| | | | | Message-ID: <s0l3jvo4mju2uu4f6pkq18istk02hme6j9@4ax.com> p4raw-id: //depot/perl@20541
* No more ext/*/*.t, move them all to ext/*/t.Jarkko Hietaniemi2003-07-282-0/+0
| | | p4raw-id: //depot/perl@20269