Fixes source routing for IPv6 prefix address on the interface
to which a prefix is assigned. If a packet is received on this
interface with as destination address the IPv6 prefix address
coming from a different prefix then this networking rule will
take care of the selection of the correct IPv6 routing table.
This rule lines up with proto address networking rules behavior.

Signed-off-by: Hans Dedecker <dedec...@gmail.com>
---
 interface-ip.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/interface-ip.c b/interface-ip.c
index 3771b5d..27ec009 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -639,6 +639,9 @@ interface_set_prefix_address(struct 
device_prefix_assignment *assignment,
                        addr.valid_until = now + 7200;
                system_add_address(l3_downlink, &addr);
                if (prefix->iface) {
+                       set_ip_source_policy(false, true, IPRULE_PRIORITY_ADDR, 
&addr.addr,
+                                       128, prefix->iface->ip6table, NULL, 
NULL);
+
                        set_ip_source_policy(false, true, IPRULE_PRIORITY_NW, 
&addr.addr,
                                        addr.mask, prefix->iface->ip6table, 
iface, NULL);
 
@@ -650,6 +653,9 @@ interface_set_prefix_address(struct 
device_prefix_assignment *assignment,
        } else if (add && (iface->state == IFS_UP || iface->state == 
IFS_SETUP)) {
                system_add_address(l3_downlink, &addr);
                if (prefix->iface && !assignment->enabled) {
+                       set_ip_source_policy(true, true, IPRULE_PRIORITY_ADDR, 
&addr.addr,
+                                       128, prefix->iface->ip6table, NULL, 
NULL);
+
                        set_ip_source_policy(true, true, 
IPRULE_PRIORITY_REJECT, &addr.addr,
                                        addr.mask, 0, iface, "unreachable");
 
-- 
1.7.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to