Date: Thu, 12 Jul 2001 00:06:26 -0300 From: "Daniel C. Sobral" <dcs@newsguy.com> To: net@freebsd.org Subject: Multicasting and routes Message-ID: <3B4D1432.78232E88@newsguy.com>
next in thread | raw e-mail | index | archive | help
It seems there is a problem in our IP stack with regards to
multicasting. The symptoms is the inability to send multicast packets on
correctly configured sockets in the absence of a default (or,
erroneously, multicast address being used) route.
From my reading of sys/netinet/ip_output.c, and the message error I get,
it seems this problem is caused by the following piece of code
if (flags & IP_ROUTETOIF) {
...
} else {
/*
* If this is the case, we probably don't want to
allocate
* a protocol-cloned route since we didn't get one from
the
* ULP. This lets TCP do its thing, while not burdening
* forwarding or ICMP with the overhead of cloning a
route.
* Of course, we still want to do any cloning requested
by
* the link layer, as this is probably required in all
cases
* for correct operation (as it is for ARP).
*/
if (ro->ro_rt == 0)
rtalloc_ign(ro, RTF_PRCLONING);
if (ro->ro_rt == 0) {
*** HERE ***
ipstat.ips_noroute++;
error = EHOSTUNREACH;
goto bad;
}
ia = ifatoia(ro->ro_rt->rt_ifa);
ifp = ro->ro_rt->rt_ifp;
ro->ro_rt->rt_use++;
if (ro->ro_rt->rt_flags & RTF_GATEWAY)
dst = (struct sockaddr_in
*)ro->ro_rt->rt_gateway;
if (ro->ro_rt->rt_flags & RTF_HOST)
isbroadcast = (ro->ro_rt->rt_flags &
RTF_BROADCAST);
else
isbroadcast = in_broadcast(dst->sin_addr, ifp);
}
This is immediately followed by
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
struct in_multi *inm;
m->m_flags |= M_MCAST;
/*
* IP destination address is multicast. Make sure "dst"
* still points to the address in "ro". (It may have
been
* changed to point to a gateway address, above.)
*/
dst = (struct sockaddr_in *)&ro->ro_dst;
(etc)
I wonder if IN_MULTICAST test shouldn't be applied while checking for a
route. Alas, I wonder if multicast packets shouldn't be marked with
IP_ROUTETOIF. Unfortunately, my personal knowledge of this piece of code
leaves me just wondering.
Comments or suggestions?
--
Daniel C. Sobral (8-DCS)
dcs@newsguy.com
dcs@freebsd.org
capo@the.secret.bsdconspiracy.net
wow regex humor... I'm a geek
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B4D1432.78232E88>
