diff options
author | Patrick McHardy <kaber@trash.net> | 2006-08-11 02:09:48 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:54:25 -0400 |
commit | 9e762a4a89b302cb3b26a1f9bb33eff459eaeca9 (patch) | |
tree | 4be606cc6bfe097beac3aeeea32b4adc107409b7 /net/ipv6/route.c | |
parent | 2dfe55b47e3d66ded5a84caf71e0da5710edf48b (diff) |
[NET]: Introduce RTA_TABLE/FRA_TABLE attributes
Introduce RTA_TABLE route attribute and FRA_TABLE routing rule attribute
to hold 32 bit routing table IDs. Usespace compatibility is provided by
continuing to accept and send the rtm_table field, but because of its
limited size it can only carry the low 8 bits of the table ID. This
implies that if larger IDs are used, _all_ userspace programs using them
need to use RTA_TABLE.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e08d84063c1f..843c5509fced 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1859,7 +1859,8 @@ int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
1859 | 1859 | ||
1860 | if (inet6_rtm_to_rtmsg(r, arg, &rtmsg)) | 1860 | if (inet6_rtm_to_rtmsg(r, arg, &rtmsg)) |
1861 | return -EINVAL; | 1861 | return -EINVAL; |
1862 | return ip6_route_del(&rtmsg, nlh, arg, &NETLINK_CB(skb), r->rtm_table); | 1862 | return ip6_route_del(&rtmsg, nlh, arg, &NETLINK_CB(skb), |
1863 | rtm_get_table(arg, r->rtm_table)); | ||
1863 | } | 1864 | } |
1864 | 1865 | ||
1865 | int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 1866 | int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
@@ -1869,7 +1870,8 @@ int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
1869 | 1870 | ||
1870 | if (inet6_rtm_to_rtmsg(r, arg, &rtmsg)) | 1871 | if (inet6_rtm_to_rtmsg(r, arg, &rtmsg)) |
1871 | return -EINVAL; | 1872 | return -EINVAL; |
1872 | return ip6_route_add(&rtmsg, nlh, arg, &NETLINK_CB(skb), r->rtm_table); | 1873 | return ip6_route_add(&rtmsg, nlh, arg, &NETLINK_CB(skb), |
1874 | rtm_get_table(arg, r->rtm_table)); | ||
1873 | } | 1875 | } |
1874 | 1876 | ||
1875 | struct rt6_rtnl_dump_arg | 1877 | struct rt6_rtnl_dump_arg |
@@ -1887,6 +1889,7 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt, | |||
1887 | struct nlmsghdr *nlh; | 1889 | struct nlmsghdr *nlh; |
1888 | unsigned char *b = skb->tail; | 1890 | unsigned char *b = skb->tail; |
1889 | struct rta_cacheinfo ci; | 1891 | struct rta_cacheinfo ci; |
1892 | u32 table; | ||
1890 | 1893 | ||
1891 | if (prefix) { /* user wants prefix routes only */ | 1894 | if (prefix) { /* user wants prefix routes only */ |
1892 | if (!(rt->rt6i_flags & RTF_PREFIX_RT)) { | 1895 | if (!(rt->rt6i_flags & RTF_PREFIX_RT)) { |
@@ -1902,9 +1905,11 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt, | |||
1902 | rtm->rtm_src_len = rt->rt6i_src.plen; | 1905 | rtm->rtm_src_len = rt->rt6i_src.plen; |
1903 | rtm->rtm_tos = 0; | 1906 | rtm->rtm_tos = 0; |
1904 | if (rt->rt6i_table) | 1907 | if (rt->rt6i_table) |
1905 | rtm->rtm_table = rt->rt6i_table->tb6_id; | 1908 | table = rt->rt6i_table->tb6_id; |
1906 | else | 1909 | else |
1907 | rtm->rtm_table = RT6_TABLE_UNSPEC; | 1910 | table = RT6_TABLE_UNSPEC; |
1911 | rtm->rtm_table = table; | ||
1912 | RTA_PUT_U32(skb, RTA_TABLE, table); | ||
1908 | if (rt->rt6i_flags&RTF_REJECT) | 1913 | if (rt->rt6i_flags&RTF_REJECT) |
1909 | rtm->rtm_type = RTN_UNREACHABLE; | 1914 | rtm->rtm_type = RTN_UNREACHABLE; |
1910 | else if (rt->rt6i_dev && (rt->rt6i_dev->flags&IFF_LOOPBACK)) | 1915 | else if (rt->rt6i_dev && (rt->rt6i_dev->flags&IFF_LOOPBACK)) |