multiple independant multicast routing instances
I worte a multicast proxy (mcproxy - mcproxy.realmv6.org), some time ago. The Proxy is using the Linux Kernel routing tables and supports multiple multicast routing tables. The proxy split the the routing tables virtual on the userspace and usees only the default multicast routing table of the Linux Kernel. This behavior is causing problems with a szenario from RFC 6224 (Multicast Listener Support in Proxy Mobile IPv6).
Therefore, I tested the multiple independant multicast routing instances of the Linux Kernel. But i encounterd a problem:
//1. I create a socket.
m_sock = socket(AF_INET, SOCK_RAW, IPPROTO_IGMP);
//2. choose an arbitrary routing table.
int table = 5;
setsockopt (m_sock, IPPROTO_IP, MRT_TABLE, &table, sizeof (table));
//3. set the multicast routing flag
int val = 1;
setsockopt(m_sock, IPPROTO_IP, MRT_INIT, &val, sizeof(val));
//4. add two virtual interface indexes (eth0, eth1)
setsockopt(m_sock, IPPROTO_IP, MRT_ADD_VIF, ... );
//5. add a route (eth0 to eth1 with group G1 and source S1)
setsockopt(m_sock, IPPROTO_IP, MRT_ADD_MFC, ... );
If I use the zero table (table= 0) then everything is fine: The routing entry in "/proc/net/ip_mr_cache" is visible and multicast packetes are forwarded.
If I use another talbe (for example table five) all setsockopt functions work without errors but no multicast packets are forwarded. „/proc/sys/net/ipv4/config/eth[0|1]/mc_forwarding“ are set but
unfortunately, the files /proc/net/ip_mr_cache and „ip_mr_vif“ are empty, so it is difficult to analyze errors.
Am I doing something wrong, or is the experimental Linux code the problem?