From nobody@FreeBSD.org  Thu Jul 29 23:56:44 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5D930106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 Jul 2010 23:56:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 4C42F8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 Jul 2010 23:56:44 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o6TNui02081627
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 29 Jul 2010 23:56:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o6TNuhKe081626;
	Thu, 29 Jul 2010 23:56:43 GMT
	(envelope-from nobody)
Message-Id: <201007292356.o6TNuhKe081626@www.freebsd.org>
Date: Thu, 29 Jul 2010 23:56:43 GMT
From: Hans-Werner Braun <hwb@ucsd.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Generic multicast join failure in 8.1
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         149086
>Category:       kern
>Synopsis:       [multicast] Generic multicast join failure in 8.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 30 00:00:09 UTC 2010
>Closed-Date:    
>Last-Modified:  Thu Aug  5 20:30:10 UTC 2010
>Originator:     Hans-Werner Braun
>Release:        8.1-RELEASE
>Organization:
UC San Diego
>Environment:
FreeBSD mcr.hpwren.ucsd.edu 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Thu Jul 29 09:50:21 PDT 2010     hwb@mcr.hpwren.ucsd.edu:/usr/src/sys/amd64/compile/MCR  amd64

>Description:
A perl program that I used in previous FreeBSD releases does not work any
more. Specifically from tcpdump outputs it does not send the join request
to the router. The program:

#!/usr/local/bin/perl

use Socket;

$PORT=$ARGV[0];
$PATTERN=$ARGV[1];
$SERVER=$ARGV[2];

if($PORT eq ""){
 printf"Syntax: mcaststream.pl port {pattern} {multicastaddress}\n";
 exit;
}
if($SERVER eq ""){$SERVER="233.7.117.79";}

$|=1;

$IP_ADD_MEMBERSHIP=12;

($name, $aliases, $type, $len, $SERVERIP) = gethostbyname($SERVER);

$sockaddr = 'S n a4 x8';

socket(S, PF_INET,SOCK_DGRAM,UDP_PROTO)||die("$!");
setsockopt(S, SOL_SOCKET, SO_REUSEPORT, 1)||die("$!");
$us = pack($sockaddr, 2, $PORT, pack("C4", 0,0,0,0));
bind(S, $us)||die("$!");

setsockopt(S, 0, $IP_ADD_MEMBERSHIP, $SERVERIP."\0\0\0\0")||die("$!");

while($theiraddr=recv(S,$BUF,1024,0)){
 ($junk, $junk, $sourceaddr, $junk) = unpack($sockaddr, $theiraddr);
 $theirip=join('.',unpack('C4', $sourceaddr));
 if($BUF =~ $PATTERN){
  printf"$theirip\t$BUF";
 }
}
>How-To-Repeat:
The above program sends no traffic out of the Ethernet interface (specifically the join request).
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Jul 30 01:35:20 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149086 

From: Hans-Werner Braun <hwb@ucsd.edu>
To: bug-followup@FreeBSD.org, hwb@ucsd.edu
Cc:  
Subject: Re: kern/149086: [multicast] Generic multicast join failure in 8.1
Date: Thu, 5 Aug 2010 13:20:56 -0700

 A program that is a straight adaptation from the IO::Socket::Multicast
 man page does not work either:
 
 ----
   #!/usr/local/bin/perl
   
   use strict;
   use IO::Socket::Multicast;
   
   use constant GROUP => '233.7.117.79';
   use constant PORT  => '4011';
   
   my $sock = IO::Socket::Multicast->new(Proto=>'udp',LocalPort=>PORT);
   $sock->mcast_add(GROUP) || die "Couldn't set group: $!\n";
   
   while (1) {
    my $data;
    next unless $sock->recv($data,1024);
    print $data;
   }
 ----
 
 It only displays data if the multicast stream already exists on the
 local Ethernet, but it does not send the group join request out to
 initiate the receiving stream on the local Ethernet.
>Unformatted:
