Hi Paul,

I have a concern about your fix. 

In the case of ECMP,   your fix will completely remove the FIB entry which will
cause the complete removal of the FIB entry in hardware and cause the traffic 
dropped
if there is no default network till the new update of the same FIB entry arries.

The ideal fix of this problem should be just deleting the path of a FIB entry 
which
should be modified,  not the FIB entry if there are valid alternative paths.

Actually, even more so, the right fix may be more like inline modification 
(which means
that this is only control plane attribute update, for forwarding layer,  the 
FIB and paths
are not changed at all, hence there should be no withdraw update to forwarding 
layer which
gets fed from Zebra like Kernel)

I may be wrong, but it seems to me that at least Jacueline's fix is more toward 
the optimal
fix if it is not THE right fix.

Thanks,

Andrew

-----Original Message-----
From: Paul Jakma [mailto:[email protected]] 
Sent: Thursday, October 29, 2015 9:36 AM
To: J Yu
Cc: Jacqueline Yu; Martin Winter; [email protected]
Subject: [quagga-dev 13461] Re: Kernel routes does not get updated when 
neighbor remove the "next-hop-self" configuration

On Wed, 28 Oct 2015, J Yu wrote:

> issues. The other cause is the issue we are facing today where the 
> route can NOT be deleted in rib now that it has a new next_hop, but 
> the new next_hop is unreachable such that it needed to be deleted from 
> the forwarding database. One can also argue this is a modify case of 
> the route, which is from rib perspective only.

So, should we even bother trying to match the old nexthop? Just tell zebra to 
delete the prefix. Below seems to pass Martin's test.

Havn't tested IPv6 (Martin, fancy extending your tool?).

I don't know how this affects the BGP ECMP/Mpath stuff. Is there someone using 
that that can test?

regards,

Paul

diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index e534bee..186657b 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -863,18 +863,14 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info 
*info, safi_t safi)
    if (p->family == AF_INET)
      {
        struct zapi_ipv4 api;
-      struct in_addr *nexthop;

        api.vrf_id = VRF_DEFAULT;
        api.flags = flags;
-      nexthop = &info->attr->nexthop;

        api.type = ZEBRA_ROUTE_BGP;
        api.message = 0;
        api.safi = safi;
-      SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
-      api.nexthop_num = 1;
-      api.nexthop = &nexthop;
+      api.nexthop_num = 0;
        api.ifindex_num = 0;
        SET_FLAG (api.message, ZAPI_MESSAGE_METRIC);
        api.metric = info->attr->med;
@@ -882,10 +878,9 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info 
*info, safi_t safi)
        if (BGP_DEBUG(zebra, ZEBRA))
        {
          char buf[2][INET_ADDRSTRLEN];
-         zlog_debug("Zebra send: IPv4 route delete %s/%d nexthop %s metric %u",
+         zlog_debug("Zebra send: IPv4 route delete %s/%d metric %u",
                     inet_ntop(AF_INET, &p->u.prefix4, buf[0], sizeof(buf[0])),
                     p->prefixlen,
-                    inet_ntop(AF_INET, nexthop, buf[1], sizeof(buf[1])),
                     api.metric);
        }

@@ -897,54 +892,23 @@ bgp_zebra_withdraw (struct prefix *p, struct bgp_info 
*info, safi_t safi)
    if (p->family == AF_INET6)
      {
        struct zapi_ipv6 api;
-      unsigned int ifindex;
-      struct in6_addr *nexthop;
- 
-      assert (info->attr->extra);

-      ifindex = 0;
-      nexthop = NULL;
-
-      /* Only global address nexthop exists. */
-      if (info->attr->extra->mp_nexthop_len == 16)
-       nexthop = &info->attr->extra->mp_nexthop_global;
-
-      /* If both global and link-local address present. */
-      if (info->attr->extra->mp_nexthop_len == 32)
-       {
-         nexthop = &info->attr->extra->mp_nexthop_local;
-         if (info->peer->nexthop.ifp)
-           ifindex = info->peer->nexthop.ifp->ifindex;
-       }
-
-      if (nexthop == NULL)
-       return;
-
-      if (IN6_IS_ADDR_LINKLOCAL (nexthop) && ! ifindex)
-       if (info->peer->ifname)
-         ifindex = ifname2ifindex (info->peer->ifname);
-
        api.vrf_id = VRF_DEFAULT;
        api.flags = flags;
        api.type = ZEBRA_ROUTE_BGP;
        api.message = 0;
        api.safi = safi;
-      SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
-      api.nexthop_num = 1;
-      api.nexthop = &nexthop;
-      SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
-      api.ifindex_num = 1;
-      api.ifindex = &ifindex;
+      api.nexthop_num = 0;
+      api.ifindex_num = 0;
        SET_FLAG (api.message, ZAPI_MESSAGE_METRIC);
        api.metric = info->attr->med;

        if (BGP_DEBUG(zebra, ZEBRA))
        {
          char buf[2][INET6_ADDRSTRLEN];
-         zlog_debug("Zebra send: IPv6 route delete %s/%d nexthop %s metric %u",
+         zlog_debug("Zebra send: IPv6 route delete %s/%d metric %u",
                     inet_ntop(AF_INET6, &p->u.prefix6, buf[0], sizeof(buf[0])),
                     p->prefixlen,
-                    inet_ntop(AF_INET6, nexthop, buf[1], sizeof(buf[1])),
                     api.metric);
        }


regards,
-- 
Paul Jakma      [email protected]  @pjakma Key ID: 64A2FF6A
Fortune:
In the future, you're going to get computers as prizes in breakfast cereals.
You'll throw them out because your house will be littered with them.

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev
************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to