diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-06-18 17:01:34 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-08-21 17:25:18 +0100 |
commit | 76240f11e640824438605012a8e44c968bc9e5b0 (patch) | |
tree | 9e03c16d454d0b44d1c361d97aafed950f45ea4f | |
parent | 6ae80e0d80531f602c3cb0e535c4e12bd2181b40 (diff) | |
download | quagga-76240f11e640824438605012a8e44c968bc9e5b0.tar.bz2 quagga-76240f11e640824438605012a8e44c968bc9e5b0.tar.xz |
pimd: Fix first DR Election
The function pim_neighbor_new caused the dr election before
the addition of the neighbor to the pim_ifp->pim_neighbor_list,
in pim_neighbor_add, which is needed to properly elect the
correct DR.
Move the dr_election and hello trigger till after the addition
to the list.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | pimd/pim_neighbor.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index eaf36df3..72a35382 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -347,26 +347,6 @@ static struct pim_neighbor *pim_neighbor_new(struct interface *ifp, ++pim_ifp->pim_dr_num_nondrpri_neighbors; } - /* - RFC 4601: 4.3.2. DR Election - - A router's idea of the current DR on an interface can change when a - PIM Hello message is received, when a neighbor times out, or when a - router's own DR Priority changes. - */ - pim_if_dr_election(neigh->interface); // new neighbor -- should not trigger dr election... - - /* - RFC 4601: 4.3.1. Sending Hello Messages - - To allow new or rebooting routers to learn of PIM neighbors quickly, - when a Hello message is received from a new neighbor, or a Hello - message with a new GenID is received from an existing neighbor, a - new Hello message should be sent on this interface after a - randomized delay between 0 and Triggered_Hello_Delay. - */ - pim_hello_restart_triggered(neigh->interface); - return neigh; } @@ -453,6 +433,26 @@ struct pim_neighbor *pim_neighbor_add(struct interface *ifp, listnode_add(pim_ifp->pim_neighbor_list, neigh); + /* + RFC 4601: 4.3.2. DR Election + + A router's idea of the current DR on an interface can change when a + PIM Hello message is received, when a neighbor times out, or when a + router's own DR Priority changes. + */ + pim_if_dr_election(neigh->interface); // new neighbor -- should not trigger dr election... + + /* + RFC 4601: 4.3.1. Sending Hello Messages + + To allow new or rebooting routers to learn of PIM neighbors quickly, + when a Hello message is received from a new neighbor, or a Hello + message with a new GenID is received from an existing neighbor, a + new Hello message should be sent on this interface after a + randomized delay between 0 and Triggered_Hello_Delay. + */ + pim_hello_restart_triggered(neigh->interface); + return neigh; } |