[Xorp-users] [Xorp-hackers] Here's some bgp config files that work.

Ben Greear greearb at candelatech.com
Thu Apr 22 09:58:49 PDT 2010


On 04/22/2010 09:02 AM, Atanu Ghosh wrote:
> Hi,
>
> The test for the nexthop being zero is in
> FastPathAttributeList<A>::load_raw_data:
>
>                  // if there's an NLRI, there must be a non-zero nexthop
>                  if (do_checks&&  mp4_reach_att->nexthop() == IPv4::ZERO()) {
>                      uint8_t data = NEXT_HOP;
>                      xorp_throw(CorruptMessage,"Illegal nexthop", UPDATEMSGERR,
>                                 MISSWATTR,&data, 1);
>                  }
>
> I don't know why it isn't being caught here.

I need to back out a few of my hacks I think.  Can you confirm that this
patch is a bad idea?  Ie, is it always invalid to have a 0.0.0.0 nexthop
in BGP?

@@ -318,7 +318,7 @@ NextHopAttribute<A>::NextHopAttribute(const uint8_t* d)

      _next_hop = A(payload(d));

-    if (!_next_hop.is_unicast())
+    if (!(_next_hop.is_unicast() || _next_hop.is_zero()))
  	xorp_throw(CorruptMessage,
  		   c_format("NextHop %s is not a unicast address",
  			    _next_hop.str().c_str()),



Also, does this patch look correct and useful?  It catches
some of the exceptions that were crashing bgp.  Or maybe this
logic should go higher..ie try/catch around the xrl input handling code?

@@ -1069,7 +1069,14 @@ BGPPlumbingAF<A>::add_route(const IPNet<A>& net,
  		   pretty_string_safi(_master.safi()));

      rib_in = iter->second;
-    result = rib_in->add_route(net, pa_list, policy_tags);
+    try {
+	result = rib_in->add_route(net, pa_list, policy_tags);
+    }
+    catch(XorpException &e) {
+	XLOG_WARNING("Exception in add_route: %s, assuming failure\n",
+		     e.str().c_str());
+	result = ADD_FAILURE;
+    }

      if (result == ADD_USED || result == ADD_UNUSED) {
  	_awaits_push = true;


Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-users mailing list