R
RayB
I've a device that's sending out a packet to 225.1.1.1 connected to a
Fedora Core 3 box, running with a local subnet address 192.168.1.0
connected to eth1. I installed ethereal on the linux server and can
verify that the packet coming in through eth1 are indeed source
192.168.1.100 (the address the device uses (in this case .100) is
based upon dhcp server running on the linux box, so I know the
interface is working.) and destination 225.1.1.1
Other info about the packet incoming: udp srcport:1024 dstport: 1118
Pertty simple. Linux Server eth1: <---> hub <---> device (or two)
I thought I could use the IO::Socket::Multicast module to receive the
initial packet, but it just sits and hangs at the recv call. I've
tried writing a simple UDP server receiver as well, but it behaves the
same way. I admit I'm pretty new at the jargon here and have tried to
change the ports etc, but it always behaves the same. I apologize if
this is an OS configuration issue, but does anyone have any ideas why
I might not be able to see these packets?
(Here's the multicast script I'm using... I got it from a book that
I'm reading, which is decent, but not specific enough for me to know
if there's something else I should be doing, regarding the setup of my
system.)
#!/usr/bin/perl
$|=1;
use IO::Socket;
use IO::Socket::Multicast;
my $port = 1118;
my $addr = '225.1.1.1';
my $sock = IO::Socket::Multicast->new('LocalPort' => $port) or die
"Can't create socket:$!";
print $sock->mcast_if; //value is set to "any" by default
$sock->mcast_if("eth1");
$sock->mcast_add($addr) or die "mcast_add: $!";
while (1) {
my ($msg, $peer);
die "recv error: $!" unless $peer = recv($sock, $msg, 1024, 0); //it
hangs here...
my ($port, $peeraddr) = sockaddr_in($peer);
print inet_ntoa($peeraddr) . ":" . inet_ntoa($portaddr) . ": $msg
\n";
}
I have a feeling the solution is a simple issue, so I figure I'll post
this here. If there's a better newsgroup for this post, I'd be pleased
to go there.
--Ray
beanleafpress.com
Fedora Core 3 box, running with a local subnet address 192.168.1.0
connected to eth1. I installed ethereal on the linux server and can
verify that the packet coming in through eth1 are indeed source
192.168.1.100 (the address the device uses (in this case .100) is
based upon dhcp server running on the linux box, so I know the
interface is working.) and destination 225.1.1.1
Other info about the packet incoming: udp srcport:1024 dstport: 1118
Pertty simple. Linux Server eth1: <---> hub <---> device (or two)
I thought I could use the IO::Socket::Multicast module to receive the
initial packet, but it just sits and hangs at the recv call. I've
tried writing a simple UDP server receiver as well, but it behaves the
same way. I admit I'm pretty new at the jargon here and have tried to
change the ports etc, but it always behaves the same. I apologize if
this is an OS configuration issue, but does anyone have any ideas why
I might not be able to see these packets?
(Here's the multicast script I'm using... I got it from a book that
I'm reading, which is decent, but not specific enough for me to know
if there's something else I should be doing, regarding the setup of my
system.)
#!/usr/bin/perl
$|=1;
use IO::Socket;
use IO::Socket::Multicast;
my $port = 1118;
my $addr = '225.1.1.1';
my $sock = IO::Socket::Multicast->new('LocalPort' => $port) or die
"Can't create socket:$!";
print $sock->mcast_if; //value is set to "any" by default
$sock->mcast_if("eth1");
$sock->mcast_add($addr) or die "mcast_add: $!";
while (1) {
my ($msg, $peer);
die "recv error: $!" unless $peer = recv($sock, $msg, 1024, 0); //it
hangs here...
my ($port, $peeraddr) = sockaddr_in($peer);
print inet_ntoa($peeraddr) . ":" . inet_ntoa($portaddr) . ": $msg
\n";
}
I have a feeling the solution is a simple issue, so I figure I'll post
this here. If there's a better newsgroup for this post, I'd be pleased
to go there.
--Ray
beanleafpress.com