Subject: Re: emcast and PR 7003
To: Jonathan A. Kollasch <jakllsch@kollasch.net>
From: Jonathan Stone <jonathan@Pescadero.dsg.stanford.edu>
List: tech-net
Date: 11/14/2005 20:35:43
I wrote:
> Can you build a custom kernel which [...]
Here's a diff. Remove or modify the printf()s if you wish.
It'd be nice to know exaclty which (if any) are triggered.
--- Ip_output.c.20 2005-11-14 20:28:03.000000000 -0800
+++ ip_output.c.20.test 2005-11-14 20:31:49.000000000 -0800
@@ -408,8 +408,12 @@
goto done;
}
+ if (IN_MULTICAST(ip->ip_src.s_addr)) {
+ printf("PR 7003 rides again\n");
+ }
goto sendit;
}
+
#ifndef notdef
/*
* If source address not specified yet, use address
@@ -418,7 +422,6 @@
if (in_nullhost(ip->ip_src))
ip->ip_src = ia->ia_addr.sin_addr;
#endif
-
/*
* packets with Class-D address as source are not valid per
* RFC 1112
@@ -453,6 +456,26 @@
m->m_flags &= ~M_BCAST;
sendit:
+#ifndef notdef
+ /*
+ * If source address not specified yet, use address
+ * of outgoing interface.
+ */
+ if (in_nullhost(ip->ip_src))
+ ip->ip_src = ia->ia_addr.sin_addr;
+#endif
+
+ /*
+ * packets with Class-D address as source are not valid per
+ * RFC 1112
+ */
+ if (IN_MULTICAST(ip->ip_src.s_addr)) {
+ ipstat.ips_odropped++;
+ error = EADDRNOTAVAIL;
+ printf("XXX: Class_D source address\n");
+ goto bad;
+ }
+
/*
* If we're doing Path MTU Discovery, we need to set DF unless
* the route's MTU is locked.