[quagga-users 14675] Potential problem in rib_process function

Atul Chowdhry <[email protected]> Wed, 10 May 2017 09:57:25 -0700
Newsgroups gmane.network.quagga.user
Message-ID <CAEgoHoiS6DgY7YCt9XG1OiX0bjFF70GGYpBCr8J9jrnDmiH2WA@mail.gmail.com>
Hi Guys,
 I am using quagga release 1.2.1. I see one potential problem in
rib_process function related to withdrawal of redistributed route from
zebra.
Problematic line is marked in bold letters.
Suppose a prefix was already learned via OSPF. Now if I try to add a static
route for same prefix, I hit this code.
In this case. old_selected will point to OSPF and new_selected will point
to Static. Now since ospf route is not the selected one, don;t we
always have to withdraw this ospf route from clients redistributing OSPF.
Why there is extra check there ?
I also tested this locally. If I comment this if statement then I see zebra
sending delete for OSPF route else not.

Pls give advice.

Rgds
Atul


  /* Redistribute SELECTED entry */
1308   if (old_selected != new_selected
1309       || (new_selected && CHECK_FLAG (new_selected->status,
RIB_ENTRY_CHANGED)))
1310     {
1311       if (old_selected)
1312         {
1313          * if (! new_selected)       >>>> Why this if statement is
there ?? I fell this shouldn't be there.*
1314             redistribute_delete (&rn->p, old_selected);
1315           if (old_selected != new_selected)
1316             UNSET_FLAG (old_selected->flags, ZEBRA_FLAG_SELECTED);
1317         }
1318
1319       if (new_selected)
1320         {
1321           /* Install new or replace existing redistributed entry */
1322           SET_FLAG (new_selected->flags, ZEBRA_FLAG_SELECTED);
1323           redistribute_add (&rn->p, new_selected);
1324         }
1325      }

_______________________________________________
Quagga-users mailing list
Quagga-users-UOy77sIEA+cAd7ICUelF/[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-users