[quagga-dev,15440] ospf6d: remove unused broken function

Message ID 1465242599-32418-1-git-send-email-chris@opensourcerouting.org
State Under Review
Headers show

Commit Message

Christian Franke June 6, 2016, 7:49 p.m.
From: Christian Franke <nobody@nowhere.ws>

ospf6_interface_if_del has not been in use since for quite some
years and is broken. (Will crash ospf6d if oi->area == NULL)

Since it is not used, just remove it.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
---
 ospf6d/ospf6_interface.c | 23 -----------------------
 ospf6d/ospf6_interface.h |  1 -
 ospf6d/ospf6_zebra.c     |  7 -------
 3 files changed, 31 deletions(-)

Comments

cisystem@netdef.org June 6, 2016, 9 p.m. | #1
Continous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF CI System <cisystem@netdef.org>

This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 1957: http://patchwork.quagga.net/patch/1957
       [quagga-dev,15440] ospf6d: remove unused broken function
Tested on top of Git : 86c5d2e (as of 20160315.231717 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-298/


Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org
Donald Sharp June 6, 2016, 11:56 p.m. | #2
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>

On Mon, Jun 6, 2016 at 3:49 PM, Christian Franke <
chris@opensourcerouting.org> wrote:

> From: Christian Franke <nobody@nowhere.ws>
>
> ospf6_interface_if_del has not been in use since for quite some
> years and is broken. (Will crash ospf6d if oi->area == NULL)
>
> Since it is not used, just remove it.
>
> Signed-off-by: Christian Franke <chris@opensourcerouting.org>
> ---
>  ospf6d/ospf6_interface.c | 23 -----------------------
>  ospf6d/ospf6_interface.h |  1 -
>  ospf6d/ospf6_zebra.c     |  7 -------
>  3 files changed, 31 deletions(-)
>
> diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
> index 26f68ac..c31f896 100644
> --- a/ospf6d/ospf6_interface.c
> +++ b/ospf6d/ospf6_interface.c
> @@ -340,29 +340,6 @@ ospf6_interface_if_add (struct interface *ifp)
>  }
>
>  void
> -ospf6_interface_if_del (struct interface *ifp)
> -{
> -  struct ospf6_interface *oi;
> -
> -  oi = (struct ospf6_interface *) ifp->info;
> -  if (oi == NULL)
> -    return;
> -
> -  /* interface stop */
> -  if (oi->area)
> -    thread_execute (master, interface_down, oi, 0);
> -
> -  listnode_delete (oi->area->if_list, oi);
> -  oi->area = (struct ospf6_area *) NULL;
> -
> -  /* cut link */
> -  oi->interface = NULL;
> -  ifp->info = NULL;
> -
> -  ospf6_interface_delete (oi);
> -}
> -
> -void
>  ospf6_interface_state_update (struct interface *ifp)
>  {
>    struct ospf6_interface *oi;
> diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h
> index 95a377f..8dffa7c 100644
> --- a/ospf6d/ospf6_interface.h
> +++ b/ospf6d/ospf6_interface.h
> @@ -153,7 +153,6 @@ extern void ospf6_interface_enable (struct
> ospf6_interface *);
>  extern void ospf6_interface_disable (struct ospf6_interface *);
>
>  extern void ospf6_interface_if_add (struct interface *);
> -extern void ospf6_interface_if_del (struct interface *);
>  extern void ospf6_interface_state_update (struct interface *);
>  extern void ospf6_interface_connected_route_update (struct interface *);
>
> diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
> index c8f20d8..b8366af 100644
> --- a/ospf6d/ospf6_zebra.c
> +++ b/ospf6d/ospf6_zebra.c
> @@ -120,13 +120,6 @@ ospf6_zebra_if_del (int command, struct zclient
> *zclient, zebra_size_t length,
>      zlog_debug ("Zebra Interface delete: %s index %d mtu %d",
>                 ifp->name, ifp->ifindex, ifp->mtu6);
>
> -#if 0
> -  /* XXX: ospf6_interface_if_del is not the right way to handle this,
> -   * because among other thinkable issues, it will also clear all
> -   * settings as they are contained in the struct ospf6_interface. */
> -  ospf6_interface_if_del (ifp);
> -#endif /*0*/
> -
>    ifp->ifindex = IFINDEX_INTERNAL;
>    return 0;
>  }
> --
> 2.8.0
>
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev@lists.quagga.net
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>

Patch hide | download patch | download mbox

diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 26f68ac..c31f896 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -340,29 +340,6 @@  ospf6_interface_if_add (struct interface *ifp)
 }
 
 void
-ospf6_interface_if_del (struct interface *ifp)
-{
-  struct ospf6_interface *oi;
-
-  oi = (struct ospf6_interface *) ifp->info;
-  if (oi == NULL)
-    return;
-
-  /* interface stop */
-  if (oi->area)
-    thread_execute (master, interface_down, oi, 0);
-
-  listnode_delete (oi->area->if_list, oi);
-  oi->area = (struct ospf6_area *) NULL;
-
-  /* cut link */
-  oi->interface = NULL;
-  ifp->info = NULL;
-
-  ospf6_interface_delete (oi);
-}
-
-void
 ospf6_interface_state_update (struct interface *ifp)
 {
   struct ospf6_interface *oi;
diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h
index 95a377f..8dffa7c 100644
--- a/ospf6d/ospf6_interface.h
+++ b/ospf6d/ospf6_interface.h
@@ -153,7 +153,6 @@  extern void ospf6_interface_enable (struct ospf6_interface *);
 extern void ospf6_interface_disable (struct ospf6_interface *);
 
 extern void ospf6_interface_if_add (struct interface *);
-extern void ospf6_interface_if_del (struct interface *);
 extern void ospf6_interface_state_update (struct interface *);
 extern void ospf6_interface_connected_route_update (struct interface *);
 
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index c8f20d8..b8366af 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -120,13 +120,6 @@  ospf6_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length,
     zlog_debug ("Zebra Interface delete: %s index %d mtu %d",
 		ifp->name, ifp->ifindex, ifp->mtu6);
 
-#if 0
-  /* XXX: ospf6_interface_if_del is not the right way to handle this,
-   * because among other thinkable issues, it will also clear all
-   * settings as they are contained in the struct ospf6_interface. */
-  ospf6_interface_if_del (ifp);
-#endif /*0*/
-
   ifp->ifindex = IFINDEX_INTERNAL;
   return 0;
 }