[FS#3312] static route being added to wrong table if ip4table is used

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Mon Aug 31 12:09:28 EDT 2020


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#3312 - static route being added to wrong table if ip4table is used
User who did this - Peter (petzah)

----------
I think that this commit is relevant:

commit 4452867c4b34cb0d9dc7fe9dc42ecc86af887176
Author: Steven Barth 
Date:   Fri Jun 20 19:50:13 2014 +0200

    interface: don't store table id in route if the default table is used
    
    Use system_is_default_rt_table() to test whether the resolved routing table
    is the default one, in this case do not apply the table attribute to the
    route object.
    
    This is needed for backwards compatibility - only routes using a non-default
    table shall report it in the ifstatus output.
    
    Signed-off-by: Jo-Philipp Wich 

diff --git a/interface-ip.c b/interface-ip.c
index 715e498..587826a 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -365,6 +365,10 @@ interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6)
                        goto error;
                }
 
+               /* only set the table flag if not using the main (default) table */
+               if (system_is_default_rt_table(route->table))
+                       route->table = 0;
+
                if (route->table)
                        route->flags |= DEVROUTE_TABLE;
        }

----------

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3312#comment8728

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list