|
|
@ -76,7 +76,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
static inline const char *rtn_type(char *buf, size_t len, unsigned int t)
|
|
|
|
static inline const char *rtn_type(char *buf, size_t len, unsigned int t)
|
|
|
|
--- a/net/ipv4/ipmr.c
|
|
|
|
--- a/net/ipv4/ipmr.c
|
|
|
|
+++ b/net/ipv4/ipmr.c
|
|
|
|
+++ b/net/ipv4/ipmr.c
|
|
|
|
@@ -181,6 +181,7 @@ static int ipmr_rule_action(struct fib_r
|
|
|
|
@@ -191,6 +191,7 @@ static int ipmr_rule_action(struct fib_r
|
|
|
|
case FR_ACT_UNREACHABLE:
|
|
|
|
case FR_ACT_UNREACHABLE:
|
|
|
|
return -ENETUNREACH;
|
|
|
|
return -ENETUNREACH;
|
|
|
|
case FR_ACT_PROHIBIT:
|
|
|
|
case FR_ACT_PROHIBIT:
|
|
|
@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
tb_id = fib_rule_get_table(rule, arg);
|
|
|
|
tb_id = fib_rule_get_table(rule, arg);
|
|
|
|
--- a/net/ipv6/ip6mr.c
|
|
|
|
--- a/net/ipv6/ip6mr.c
|
|
|
|
+++ b/net/ipv6/ip6mr.c
|
|
|
|
+++ b/net/ipv6/ip6mr.c
|
|
|
|
@@ -170,6 +170,8 @@ static int ip6mr_rule_action(struct fib_
|
|
|
|
@@ -180,6 +180,8 @@ static int ip6mr_rule_action(struct fib_
|
|
|
|
return -ENETUNREACH;
|
|
|
|
return -ENETUNREACH;
|
|
|
|
case FR_ACT_PROHIBIT:
|
|
|
|
case FR_ACT_PROHIBIT:
|
|
|
|
return -EACCES;
|
|
|
|
return -EACCES;
|
|
|
@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
static const struct rt6_info ip6_blk_hole_entry_template = {
|
|
|
|
static const struct rt6_info ip6_blk_hole_entry_template = {
|
|
|
|
.dst = {
|
|
|
|
.dst = {
|
|
|
|
.__rcuref = RCUREF_INIT(1),
|
|
|
|
.__rcuref = RCUREF_INIT(1),
|
|
|
|
@@ -1048,6 +1062,7 @@ static const int fib6_prop[RTN_MAX + 1]
|
|
|
|
@@ -1051,6 +1065,7 @@ static const int fib6_prop[RTN_MAX + 1]
|
|
|
|
[RTN_BLACKHOLE] = -EINVAL,
|
|
|
|
[RTN_BLACKHOLE] = -EINVAL,
|
|
|
|
[RTN_UNREACHABLE] = -EHOSTUNREACH,
|
|
|
|
[RTN_UNREACHABLE] = -EHOSTUNREACH,
|
|
|
|
[RTN_PROHIBIT] = -EACCES,
|
|
|
|
[RTN_PROHIBIT] = -EACCES,
|
|
|
@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
[RTN_THROW] = -EAGAIN,
|
|
|
|
[RTN_THROW] = -EAGAIN,
|
|
|
|
[RTN_NAT] = -EINVAL,
|
|
|
|
[RTN_NAT] = -EINVAL,
|
|
|
|
[RTN_XRESOLVE] = -EINVAL,
|
|
|
|
[RTN_XRESOLVE] = -EINVAL,
|
|
|
|
@@ -1083,6 +1098,10 @@ static void ip6_rt_init_dst_reject(struc
|
|
|
|
@@ -1086,6 +1101,10 @@ static void ip6_rt_init_dst_reject(struc
|
|
|
|
rt->dst.output = ip6_pkt_prohibit_out;
|
|
|
|
rt->dst.output = ip6_pkt_prohibit_out;
|
|
|
|
rt->dst.input = ip6_pkt_prohibit;
|
|
|
|
rt->dst.input = ip6_pkt_prohibit;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
cfg->fc_flags |= RTF_REJECT;
|
|
|
|
cfg->fc_flags |= RTF_REJECT;
|
|
|
|
|
|
|
|
|
|
|
|
if (rtm->rtm_type == RTN_LOCAL)
|
|
|
|
if (rtm->rtm_type == RTN_LOCAL)
|
|
|
|
@@ -6291,6 +6322,8 @@ static int ip6_route_dev_notify(struct n
|
|
|
|
@@ -6306,6 +6337,8 @@ static int ip6_route_dev_notify(struct n
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
|
|
|
|
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
|
|
|
|
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
|
|
|
|
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
|
|
|
@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
|
|
|
|
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
|
|
|
|
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
|
|
|
|
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
@@ -6302,6 +6335,7 @@ static int ip6_route_dev_notify(struct n
|
|
|
|
@@ -6317,6 +6350,7 @@ static int ip6_route_dev_notify(struct n
|
|
|
|
in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
|
|
|
|
in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
|
|
|
|
in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
|
|
|
@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
|
|
|
|
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -6497,6 +6531,8 @@ static int __net_init ip6_route_net_init
|
|
|
|
@@ -6512,6 +6546,8 @@ static int __net_init ip6_route_net_init
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
net->ipv6.fib6_has_custom_rules = false;
|
|
|
|
net->ipv6.fib6_has_custom_rules = false;
|
|
|
@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
|
|
|
|
net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
|
|
|
|
sizeof(*net->ipv6.ip6_prohibit_entry),
|
|
|
|
sizeof(*net->ipv6.ip6_prohibit_entry),
|
|
|
|
GFP_KERNEL);
|
|
|
|
GFP_KERNEL);
|
|
|
|
@@ -6507,11 +6543,21 @@ static int __net_init ip6_route_net_init
|
|
|
|
@@ -6522,11 +6558,21 @@ static int __net_init ip6_route_net_init
|
|
|
|
ip6_template_metrics, true);
|
|
|
|
ip6_template_metrics, true);
|
|
|
|
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->dst.rt_uncached);
|
|
|
|
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->dst.rt_uncached);
|
|
|
|
|
|
|
|
|
|
|
@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
|
|
|
|
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
|
|
|
|
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
|
|
|
|
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
|
|
|
|
ip6_template_metrics, true);
|
|
|
|
ip6_template_metrics, true);
|
|
|
|
@@ -6538,6 +6584,8 @@ out:
|
|
|
|
@@ -6553,6 +6599,8 @@ out:
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
out_ip6_prohibit_entry:
|
|
|
|
out_ip6_prohibit_entry:
|
|
|
|
kfree(net->ipv6.ip6_prohibit_entry);
|
|
|
|
kfree(net->ipv6.ip6_prohibit_entry);
|
|
|
|
out_ip6_null_entry:
|
|
|
|
out_ip6_null_entry:
|
|
|
|
@@ -6557,6 +6605,7 @@ static void __net_exit ip6_route_net_exi
|
|
|
|
@@ -6572,6 +6620,7 @@ static void __net_exit ip6_route_net_exi
|
|
|
|
kfree(net->ipv6.ip6_null_entry);
|
|
|
|
kfree(net->ipv6.ip6_null_entry);
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
|
|
|
kfree(net->ipv6.ip6_prohibit_entry);
|
|
|
|
kfree(net->ipv6.ip6_prohibit_entry);
|
|
|
@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
|
|
|
kfree(net->ipv6.ip6_blk_hole_entry);
|
|
|
|
kfree(net->ipv6.ip6_blk_hole_entry);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
|
|
|
|
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
|
|
|
|
@@ -6640,6 +6689,9 @@ void __init ip6_route_init_special_entri
|
|
|
|
@@ -6655,6 +6704,9 @@ void __init ip6_route_init_special_entri
|
|
|
|
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
|
|
|
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
|
|
|
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
|
|
|
|
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
|
|
|
|
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
|
|
|
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
|
|
|