pimd: Add ability to set DR Priority for an interface
From RFC 4601, Section 4.3.1:
The DR_Priority Option allows a network administrator to give
preference to a particular router in the DR election process by
giving it a numerically larger DR Priority. The DR_Priority Option
SHOULD be included in every Hello message, even if no DR Priority is
explicitly configured on that interface. This is necessary because
priority-based DR election is only enabled when all neighbors on an
interface advertise that they are capable of using the DR_Priority
Option. The default priority is 1.
This modification allows the setting of the DR Priority on a per
interface basis.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c
index 9404cec..eaf36df 100644
--- a/pimd/pim_neighbor.c
+++ b/pimd/pim_neighbor.c
@@ -106,7 +106,7 @@
PIM Hello message is received, when a neighbor times out, or when a
router's own DR Priority changes.
*/
-void pim_if_dr_election(struct interface *ifp)
+int pim_if_dr_election(struct interface *ifp)
{
struct pim_interface *pim_ifp = ifp->info;
struct in_addr old_dr_addr;
@@ -140,7 +140,10 @@
pim_if_update_join_desired(pim_ifp);
pim_if_update_could_assert(ifp);
pim_if_update_assert_tracking_desired(ifp);
+ return 1;
}
+
+ return 0;
}
static void update_dr_priority(struct pim_neighbor *neigh,