Date: Tue, 17 Jul 2001 15:05:12 -0500 (CDT) From: Tim Zingelman <zingelman@fnal.gov> To: <freebsd-stable@freebsd.org> Subject: IPFilter with Multicast - BugReport Message-ID: <Pine.GSO.4.30.0107171458010.14544-200000@nova.fnal.gov>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Can someone confirm this bug... or am I missing something obvious?
The attached program works under FreeBSD without IPFilter loaded, and
works on Solaris8/sparc64 with or without IPFilter loaded.
IP Filter bug report form.
--------------------------
IP Filter Version: v3.4.16
Operating System Version: FreeBSD4.3-RELEASE & FreeBSD4.3-STABLE (7/16/01)
Configuration: LKM
Description of problem:
With ipfilter loaded, multicast packets sent out are not visible to the
sender of the multicast (with IP_MULTICAST_LOOP set on socket).
Multicast packets sent by this node are seen on other nodes.
Multicast packets sent by other nodes are seen on this node.
If ipfilter LKM is not loaded this works fine.
How to repeat:
Attached java program, (tested under linux jdk 1.3 from ports).
$java -classpath . MulticastSniffer 239.128.1.1 50092 true
^mcast addr ^port ^send mcasts
(false=listen only)
With ipfilter loaded you only see 'Multicast send' messages, but with
ipfilter not loaded, you also see 'Multicast receive' messages.
Thanks,
- Tim <Zingelman@fnal.gov>
[-- Attachment #2 --]
import java.net.*;
import java.io.*;
class MulticastSender extends Thread
{
MulticastSocket ms;
DatagramPacket dp;
InetAddress group;
int port, count = 0;
public MulticastSender(MulticastSocket ms, InetAddress group, int port)
{
this.ms = ms;
this.group = group;
this.port = port;
byte[] data = "** My multicast data **".getBytes();
this.dp = new DatagramPacket(data, data.length, group, port);
this.start();
}
/**
* If this thread was constructed using a separate
* <code>Runnable</code> run object, then that
* <code>Runnable</code> object's <code>run</code> method is called;
* otherwise, this method does nothing and returns.
* <p>
* Subclasses of <code>Thread</code> should override this method.
*
* @see java.lang.Thread#start()
* @see java.lang.Thread#stop()
* @see java.lang.Thread#Thread(java.lang.ThreadGroup,
* java.lang.Runnable, java.lang.String)
* @see java.lang.Runnable#run()
*/
public void run()
{
System.out.println("Starting multicast sender...");
while (true) {
try {
ms.send(dp, (byte) 4);
count++;
System.out.println("(" + count + ")Multicast send ... ");
System.out.flush();
sleep(1000);
} catch (Exception e) {
System.out.println("Multicast Sender: exception = " + e);
e.printStackTrace();
}
}
}
}
public class MulticastSniffer
{
public static void main(String[] args)
{
InetAddress group = null;
int port = 0;
int count = 0;
boolean isSender = false;
MulticastSender sender = null;
try {
group = InetAddress.getByName(args[0]);
port = Integer.parseInt(args[1]);
isSender = Boolean.valueOf(args[2]).booleanValue();
} catch (Exception e) {
System.err.println("Usage: MulticastSniffer address port isSender(true|false)");
System.exit(1);
}
MulticastSocket ms = null;
try {
ms = new MulticastSocket(port);
ms.joinGroup(group);
if (isSender)
sender = new MulticastSender(ms, group, port);
byte[] buf = new byte[16 * 1024];
while (true) {
DatagramPacket dp = new DatagramPacket(buf, buf.length);
ms.receive(dp);
String s = new String(dp.getData(), 0, dp.getLength());
count++;
System.out.println("(" + count + ")Multicast receive ... (" + dp.getLength() + ")" + s);
System.out.flush();
}
} catch (IOException e) {
System.err.println(e);
} finally {
if (ms != null) {
try {
ms.leaveGroup(group);
ms.close();
} catch (IOException e) {
System.err.println(e);
}
}
}
}
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.30.0107171458010.14544-200000>
