Q: nw device selection for multicast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone!


If I look into net/ipv4/igmp.c, I find the following snippet:

static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr)
{
        struct rtable *rt;
        struct net_device *dev = NULL;
        struct in_device *idev = NULL;

        if (imr->imr_address.s_addr) {
                dev = ip_dev_find(imr->imr_address.s_addr);
                if (!dev)
                        return NULL;
                __dev_put(dev);
        }

        if (!dev && !ip_route_output(&rt, imr->imr_multiaddr.s_addr, 0, 0, 0)) {
                dev = rt->u.dst.dev;
                ip_rt_put(rt);
        }
        if (dev) {
                imr->imr_ifindex = dev->ifindex;
                idev = __in_dev_get(dev);
        }
        return idev;
}


It gets called if you use IP_ADD_MEMBERSHIP without specifying an interface to use.

In my case I have 2 network cards in the system - one has the default route set.
Now I'd like to use the other one for multicast transfer, so I did "ifconfig -multicast"
on the first interface.

But it still gets selected - because the default route is set to it.


Now my question:

Should a device, which specifically was DISABLED for multicast, ever get selected? Only because the default route is set to it?

I'd propose that if the device with the default route has multicast disabled, another card
in the system with multicast enabled is searched.


Is this complete bogus?


Regards,

Phil



-
This message is RSA-encrypted: n=33389, e=257

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux