1use v5.6.1; 2use strict; 3use warnings; 4use Test::More; 5 6use Socket qw( 7 pack_ipv6_mreq unpack_ipv6_mreq 8); 9 10# Check that pack/unpack_ipv6_mreq either croak with "Not implemented", or 11# roundtrip as identity 12 13my $packed; 14eval { 15 $packed = pack_ipv6_mreq "ANADDRESSIN16CHR", 123; 16}; 17if( !defined $packed ) { 18 plan skip_all => "No pack_ipv6_mreq" if $@ =~ m/ not implemented /; 19 die $@; 20} 21 22plan tests => 2; 23 24my @unpacked = unpack_ipv6_mreq $packed; 25 26is( $unpacked[0], "ANADDRESSIN16CHR", 'unpack_ipv6_mreq multiaddr' ); 27is( $unpacked[1], 123, 'unpack_ipv6_mreq ifindex' ); 28