[ovs-dev] ovs route synchronize bug in master branch

Mike glovejmm at 163.com
Sun Jul 19 08:56:55 UTC 2020


Here is the testcase,eth0 is a netcard not added in ovs
OVS2.7.3:
1. ifconfig eth0 11.1
ovs-appctl ovs/route/show


A new route synchronized from kernel route table
Cached: 11.0.0.1/32 dev eth0 SRC 11.0.0.1 local


2. ifconfig eth0 0
ovs-appctl ovs/route/show
the new route entry is deleted


But In OVS 2.13.X and master branch
1. ifconfig eth0 11.1
ovs-appctl ovs/route/show


A new route synchronized from kernel route table
Cached: 11.0.0.1/32 dev eth0 SRC 11.0.0.1 local


2. ifconfig eth0 0
ovs-appctl ovs/route/show
the new route entry is still in ovs route table
Cached: 11.0.0.1/32 dev eth0 SRC 11.0.0.1 local


The code has changed in function
void
ovs_router_insert(uint32_t mark, const struct in6_addr *ip_dst, uint8_t plen,
                  bool local, const char output_bridge[],
                  const struct in6_addr *gw)
{
    if (use_system_routing_table) {
        uint8_t priority = local ? plen + 64 : plen; //// added in new branch, which is none in 2.7.3
        ovs_router_insert__(mark, priority, local, ip_dst, plen, output_bridge, gw);
    }
}



So it won't be flushed for 
void
ovs_router_flush(void)
{
    struct ovs_router_entry *rt;
    ovs_mutex_lock(&mutex);
    classifier_defer(&cls);
    CLS_FOR_EACH(rt, cr, &cls) {
        if (rt->priority == rt->plen) { //// new entry with different plen and priority, won't be flushed
            rt_entry_delete__(&rt->cr);
        }
    }
    classifier_publish(&cls);
    ovs_mutex_unlock(&mutex);
    seq_change(tnl_conf_seq);
}



It seeds like caused by some issure fix, is it a new bug? 



More information about the dev mailing list