[Xorp-users] cost of passive ospf interfaces is zero?

Eric S. Johnson esj at cs.fiu.edu
Tue Dec 8 09:21:56 PST 2009


A quick follow up to my own note from yesterday.

As best I can tell from a quick read of rfc2328 the concept of 
what IOS/JunOS/quagga call "passive interfaces" is not really defined.
12.4.1 talks about loopback interfaces, but that seems to be 
the host: true case, right? There it says mask=0xffffffff and 
cost=0. But for the host: false case I can't seem to find anything
that says what to do. Other than treat it as a normal stub network.
Which would mean advertise the set cost, right? That is what the 3 other
implementations I have access to do.


The following patch seems to lets xorp behave like IOS/JunOS/quagga 
with regards to costs advertised on "passive" interfaces.

I suppose it really should be done under the control of some
sort of "act-like-everyone-else: true" setting, but that is
a bit beyond my C-- grade C++ skills right now.

E

----

[root at test-router xorp-1.6]# !diff
diff -u ospf/peer.cc.orig ospf/peer.cc
--- ospf/peer.cc.orig   2009-01-05 13:31:01.000000000 -0500
+++ ospf/peer.cc        2009-12-08 10:10:27.000000000 -0500
@@ -2612,16 +2612,17 @@
     case Loopback: {
        // XXX - We should be checking to see if this is p2p unnumbered.
        uint16_t prefix_length;
-       if (_passive_host)
+       if (_passive_host) {
            prefix_length = IPv4::ADDR_BITLEN;
-       else {
+            router_link.set_metric(0);
+       } else {
            prefix_length = get_interface_prefix_length();
+           router_link.set_metric(_peerout.get_interface_cost());
        }
        IPNet<IPv4> net(get_interface_address(), prefix_length);
        router_link.set_type(RouterLink::stub);
        router_link.set_link_id(ntohl(net.masked_addr().addr()));
        router_link.set_link_data(ntohl(net.netmask().addr()));
-       router_link.set_metric(0);
        router_links.push_back(router_link);
     }
        return;




More information about the Xorp-users mailing list