Subject: Question on IP multicast forwarding
To: None <tech-kern@netbsd.org>
From: Satish Dattatri <dattatri@pipalsys.com>
List: tech-kern
Date: 10/24/2002 16:38:04
Hi,

After installing a netbsd 1.5.2 kernel wrote a simple program to add 2 
vifs and
a (s,g) with iif as vif1 and oif as vif2. On a packet incoming on vif1 
phyint_send
is called to send out on vif2, but gets dropped with error 65.

The reason is
MC_SEND i.e.  tbf_send_packet for non tunnels calls ip_output with NULL 
for ro.

                error = ip_output(m, (struct mbuf *)0, (struct route *)0,
                                  IP_FORWARDING|IP_MULTICASTOPTS, &imo);


In ip_output():
   The packet gets dropped becoz lookup fails in line 269.?? Why is 
ip_output
   looking into the normal routing table for mcast. Should it not just 
ship the
   packet out according to the the imo that is being sent as a parameter 
? I see
   that code down below but does not get executed.


Maybe, I am missing something here ...

Thanks,
Satish

 ip_output( ...)
....
....
   254         /*
    255          * If routing to interface only,
    256          * short circuit routing lookup.
    257          */
    258         if (flags & IP_ROUTETOIF) {
    259                 if ((ia = 
ifatoia(ifa_ifwithladdr(sintosa(dst)))) == 0) {         
    260                         ipstat.ips_noroute++;
    261                         error = ENETUNREACH;
    262                         goto bad;
    263                 }
    264                 ifp = ia->ia_ifp;
    265                 mtu = ifp->if_mtu;
    266                 ip->ip_ttl = 1;
    267         } else {
    268                 if (ro->ro_rt == 0)
    269                         rtalloc(ro);
    270                 if (ro->ro_rt == 0) {
    271                         ipstat.ips_noroute++;
    272                         error = EHOSTUNREACH;
    273                         goto bad;