Bug 117 - Xorp flushes routes with RTF_PROTO1 flag on start inspite of retain-on-startup setting
: Xorp flushes routes with RTF_PROTO1 flag on start inspite of retain-on-startu...
Status: NEW
Product: XORP
FEA
: 1.8
: PC Other
: --- normal
Assigned To: Ben Greear
:
:
:
  Show dependency treegraph
 
Reported: 2012-07-13 10:47 PDT by Sergey Korsak
Modified: 2012-07-13 10:47 PDT (History)
0 users (show)

See Also:


Attachments
xorp -v output (3.63 KB, text/plain)
2012-07-13 10:47 PDT, Sergey Korsak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Korsak 2012-07-13 10:47:12 PDT
Created attachment 8 [details]
xorp -v output

I wish to use xorp only for multicast routing while quagga does unicast one.
But being started, xorp deletes all RTF_PROTO1 routes even if no interfaces and
protocols are configured at all and retain-on-startup explicity enabled.

To reproduce, take xorp version 1.8.5 on FreeBSD/i386 8.2-RELEASE.
I believe this is not OS-specific behavior.

Add a route with RTF_PROTO1, for example:
route add 172.22.22.0/24 10.7.38.1 -nostatic -proto1

Check if it's in table:
netstat -rn | grep ^172.22.22.0
Destination        Gateway            Flags    Refs      Use  Netif Expire
172.22.22.0/24     10.7.38.1          UG1         0        0    lan

Start xorp with the following config:
fea {
    unicast-forwarding4 {
        forwarding-entries {
            retain-on-startup: true
            retain-on-shutdown: true
        }
    }
}

Мake sure the route disappeared:
netstat -rn | grep ^172.22.22.0

The reason is that xorp flushes RTF_PROTO1 routes before (!) applying the
config.
This is done in fea/data_plane/fibconfig/fibconfig_table_set_routing_socket.cc:
    // Cleanup any leftover entries from previously run XORP instance
    if (! fibconfig().unicast_forwarding_entries_retain_on_startup4())
        delete_all_entries4();
I inserted additional log message there:
    if (! fibconfig().unicast_forwarding_entries_retain_on_startup4()) {
        delete_all_entries4();
        XLOG_INFO("Routes flushed by FibConfigTableSetRoutingSocket::start()");
    }
and started xorp.

As you can see in the attach, "Routes flushed" appears before
"set_unicast_forwarding_enabled4?enabled:bool=true". 

Changing default value of "retain-on-startup" in fea.tp doesn't help.
I changed default value of _unicast_forwarding_entries_retain_on_startup4 in
FibConfig::FibConfig definition in fea/fibconfig.cc and reached my goal - xorp
doesn't touch foreign unicast routes any more. But this is not a fix, just an
ugly prop and much more elegant way should be definitely implemented.