aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-05-11 08:40:55 -0400
committerPatrick McHardy <kaber@trash.net>2010-05-11 08:40:55 -0400
commitd1db275dd3f6e4182c4c4b4a1ac6287925d60569 (patch)
treeb8edf6661661ff84785495e2e053ce908417a9ff /include/net
parent6bd521433942d85e80f7a731a88cc91a327f38e0 (diff)
ipv6: ip6mr: support multiple tables
This patch adds support for multiple independant multicast routing instances, named "tables". Userspace multicast routing daemons can bind to a specific table instance by issuing a setsockopt call using a new option MRT6_TABLE. The table number is stored in the raw socket data and affects all following ip6mr setsockopt(), getsockopt() and ioctl() calls. By default, a single table (RT6_TABLE_DFLT) is created with a default routing rule pointing to it. Newly created pim6reg devices have the table number appended ("pim6regX"), with the exception of devices created in the default table, which are named just "pim6reg" for compatibility reasons. Packets are directed to a specific table instance using routing rules, similar to how regular routing rules work. Currently iif, oif and mark are supported as keys, source and destination addresses could be supported additionally. Example usage: - bind pimd/xorp/... to a specific table: uint32_t table = 123; setsockopt(fd, SOL_IPV6, MRT6_TABLE, &table, sizeof(table)); - create routing rules directing packets to the new table: # ip -6 mrule add iif eth0 lookup 123 # ip -6 mrule add oif eth0 lookup 123 Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netns/ipv6.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 4e2780e6d8bc..81abfcb2eb4e 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -59,7 +59,12 @@ struct netns_ipv6 {
59 struct sock *tcp_sk; 59 struct sock *tcp_sk;
60 struct sock *igmp_sk; 60 struct sock *igmp_sk;
61#ifdef CONFIG_IPV6_MROUTE 61#ifdef CONFIG_IPV6_MROUTE
62#ifndef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
62 struct mr6_table *mrt6; 63 struct mr6_table *mrt6;
64#else
65 struct list_head mr6_tables;
66 struct fib_rules_ops *mr6_rules_ops;
67#endif
63#endif 68#endif
64}; 69};
65#endif 70#endif