diff options
Diffstat (limited to 'pimd/pim_zebra.c')
| -rw-r--r-- | pimd/pim_zebra.c | 63 |
1 files changed, 21 insertions, 42 deletions
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index baf296623f..4506e8cdb5 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -1,22 +1,21 @@ /* - PIM for Quagga - Copyright (C) 2008 Everton da Silva Marques - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING; if not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301 USA -*/ + * PIM for Quagga + * Copyright (C) 2008 Everton da Silva Marques + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #include <zebra.h> @@ -257,31 +256,11 @@ static int pim_zebra_if_address_add(int command, struct zclient *zclient, #endif } - if (p->family != AF_INET) - { - struct listnode *cnode; - struct connected *conn; - int v4addrs = 0; - - for (ALL_LIST_ELEMENTS_RO (c->ifp->connected, cnode, conn)) - { - if (conn->address->family == AF_INET) - v4addrs++; - } - if (!v4addrs && pim_ifp) - { - pim_ifp->primary_address = pim_find_primary_addr (c->ifp); - pim_if_addr_add_all (c->ifp); - pim_if_add_vif (c->ifp); - } - return 0; - } - if (!CHECK_FLAG(c->flags, ZEBRA_IFA_SECONDARY)) { /* trying to add primary address */ struct in_addr primary_addr = pim_find_primary_addr(c->ifp); - if (primary_addr.s_addr != p->u.prefix4.s_addr) { + if (p->family != AF_INET || primary_addr.s_addr != p->u.prefix4.s_addr) { if (PIM_DEBUG_ZEBRA) { /* but we had a primary address already */ @@ -637,9 +616,9 @@ void sched_rpf_cache_refresh(void) qpim_rpf_cache_refresh_delay_msec); } - THREAD_TIMER_MSEC_ON(master, qpim_rpf_cache_refresher, - on_rpf_cache_refresh, - 0, qpim_rpf_cache_refresh_delay_msec); + thread_add_timer_msec(master, on_rpf_cache_refresh, 0, + qpim_rpf_cache_refresh_delay_msec, + &qpim_rpf_cache_refresher); } static void |
