I introduced a compile warning.  Respinning a new version.

On Fri, Oct 2, 2015 at 11:00 AM, Donald Sharp <[email protected]>
wrote:

> This patch cleans up some interface startup, removes duplicate
> debug messages and protects against some always being displayed.
>
> Signed-off-by: Donald Sharp <[email protected]>
> ---
>  pimd/pim_iface.c |   46 ++++++++--------------------------------------
>  pimd/pim_zebra.c |   26 ++++++++++----------------
>  2 files changed, 18 insertions(+), 54 deletions(-)
>
> diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
> index de56d04..f706ab7 100644
> --- a/pimd/pim_iface.c
> +++ b/pimd/pim_iface.c
> @@ -249,35 +249,6 @@ static void pim_addr_change(struct interface *ifp)
>    pim_hello_restart_now(ifp);         /* send hello and restart timer */
>  }
>
> -static void on_primary_address_change(struct interface *ifp,
> -                                     const char *caller,
> -                                     struct in_addr old_addr,
> -                                     struct in_addr new_addr)
> -{
> -  struct pim_interface *pim_ifp;
> -
> -  if (PIM_DEBUG_ZEBRA) {
> -    char old_str[100];
> -    char new_str[100];
> -    pim_inet4_dump("<old?>", old_addr, old_str, sizeof(old_str));
> -    pim_inet4_dump("<new?>", new_addr, new_str, sizeof(new_str));
> -    zlog_debug("%s: %s: primary address changed from %s to %s on
> interface %s",
> -              __PRETTY_FUNCTION__, caller,
> -              old_str, new_str, ifp->name);
> -  }
> -
> -  pim_ifp = ifp->info;
> -  if (!pim_ifp) {
> -    return;
> -  }
> -
> -  if (!PIM_IF_TEST_PIM(pim_ifp->options)) {
> -    return;
> -  }
> -
> -  pim_addr_change(ifp);
> -}
> -
>  static int detect_primary_address_change(struct interface *ifp,
>                                          int force_prim_as_any,
>                                          const char *caller)
> @@ -312,7 +283,11 @@ static int detect_primary_address_change(struct
> interface *ifp,
>      struct in_addr old_addr = pim_ifp->primary_address;
>      pim_ifp->primary_address = new_prim_addr;
>
> -    on_primary_address_change(ifp, caller, old_addr, new_prim_addr);
> +    if (!PIM_IF_TEST_PIM(pim_ifp->options)) {
> +      return changed;
> +    }
> +
> +    pim_addr_change(ifp);
>    }
>
>    return changed;
> @@ -329,14 +304,9 @@ static void detect_secondary_address_change(struct
> interface *ifp,
>      return;
>
>    changed = 1; /* true */
> -  zlog_info("FIXME T31 C15 %s: on interface %s: acting on any addr
> change",
> -           __PRETTY_FUNCTION__, ifp->name);
> -
> -  if (PIM_DEBUG_ZEBRA) {
> -    zlog_debug("%s: on interface %s: %s",
> -              __PRETTY_FUNCTION__,
> -              ifp->name, changed ? "changed" : "unchanged");
> -  }
> +  if (PIM_DEBUG_ZEBRA)
> +    zlog_debug("FIXME T31 C15 %s: on interface %s: acting on any addr
> change",
> +             __PRETTY_FUNCTION__, ifp->name);
>
>    if (!changed) {
>      return;
> diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
> index 488723f..373be25 100644
> --- a/pimd/pim_zebra.c
> +++ b/pimd/pim_zebra.c
> @@ -150,8 +150,6 @@ static int pim_zebra_if_state_up(int command, struct
> zclient *zclient,
>    if (!ifp)
>      return 0;
>
> -  zlog_info("INTERFACE UP: %s ifindex=%d", ifp->name, ifp->ifindex);
> -
>    if (PIM_DEBUG_ZEBRA) {
>      zlog_debug("%s: %s index %d flags %ld metric %d mtu %d operative %d",
>                __PRETTY_FUNCTION__,
> @@ -182,8 +180,6 @@ static int pim_zebra_if_state_down(int command, struct
> zclient *zclient,
>    if (!ifp)
>      return 0;
>
> -  zlog_info("INTERFACE DOWN: %s ifindex=%d", ifp->name, ifp->ifindex);
> -
>    if (PIM_DEBUG_ZEBRA) {
>      zlog_debug("%s: %s index %d flags %ld metric %d mtu %d operative %d",
>                __PRETTY_FUNCTION__,
> @@ -242,8 +238,6 @@ static int pim_zebra_if_address_add(int command,
> struct zclient *zclient,
>    struct connected *c;
>    struct prefix *p;
>
> -  zassert(command == ZEBRA_INTERFACE_ADDRESS_ADD);
> -
>    /*
>      zebra api notifies address adds/dels events by using the same call
>      interface_add_read below, see comments in lib/zclient.c
> @@ -278,17 +272,19 @@ static int pim_zebra_if_address_add(int command,
> struct zclient *zclient,
>
>      struct in_addr primary_addr = pim_find_primary_addr(c->ifp);
>      if (primary_addr.s_addr != p->u.prefix4.s_addr) {
> -      /* but we had a primary address already */
> +      if (PIM_DEBUG_ZEBRA) {
> +       /* but we had a primary address already */
>
> -      char buf[BUFSIZ];
> -      char old[100];
> +       char buf[BUFSIZ];
> +       char old[100];
>
> -      prefix2str(p, buf, BUFSIZ);
> -      pim_inet4_dump("<old?>", primary_addr, old, sizeof(old));
> +       prefix2str(p, buf, BUFSIZ);
> +       pim_inet4_dump("<old?>", primary_addr, old, sizeof(old));
>
> -      zlog_warn("%s: %s primary addr old=%s: forcing secondary flag on
> new=%s",
> -               __PRETTY_FUNCTION__,
> -               c->ifp->name, old, buf);
> +       zlog_warn("%s: %s primary addr old=%s: forcing secondary flag on
> new=%s",
> +                 __PRETTY_FUNCTION__,
> +                 c->ifp->name, old, buf);
> +      }
>        SET_FLAG(c->flags, ZEBRA_IFA_SECONDARY);
>      }
>    }
> @@ -304,8 +300,6 @@ static int pim_zebra_if_address_del(int command,
> struct zclient *client,
>    struct connected *c;
>    struct prefix *p;
>
> -  zassert(command == ZEBRA_INTERFACE_ADDRESS_DELETE);
> -
>    /*
>      zebra api notifies address adds/dels events by using the same call
>      interface_add_read below, see comments in lib/zclient.c
> --
> 1.7.10.4
>
>
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to