示例#1
0
文件: connected.c 项目: yubo/quagga
/* communicate the withdrawal of a connected address */
static void connected_withdraw(struct connected *ifc)
{
	if (!ifc)
		return;

	/* Update interface address information to protocol daemon. */
	if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL)) {
		zebra_interface_address_delete_update(ifc->ifp, ifc);

		if (ifc->address->family == AF_INET)
			if_subnet_delete(ifc->ifp, ifc);

		if (ifc->address->family == AF_INET)
			connected_down_ipv4(ifc->ifp, ifc);
#ifdef HAVE_IPV6
		else
			connected_down_ipv6(ifc->ifp, ifc);
#endif

		UNSET_FLAG(ifc->conf, ZEBRA_IFC_REAL);
	}

	/* The address is not in the kernel anymore, so clear the flag */
	UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);

	if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED)) {
		listnode_delete(ifc->ifp->connected, ifc);
		connected_free(ifc);
	}
}
示例#2
0
/* withdraw a connected address */
static void
connected_withdraw (struct connected *ifc)
{
  if (! ifc)
    return;

  /* Update interface address information to protocol daemon. */
  if (CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL))
    {
      zebra_interface_address_delete_update (ifc->ifp, ifc);

      if_subnet_delete (ifc->ifp, ifc);
      
      if (ifc->address->family == AF_INET)
        connected_down_ipv4 (ifc->ifp, ifc);
#ifdef HAVE_IPV6
      else
        connected_down_ipv6 (ifc->ifp, ifc);
#endif

      UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
    }

  if (!CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED))
    {
	  /*  
		router_id_del_address(ifc);
	    listnode_delete (ifc->ifp->connected, ifc);
	    connected_free (ifc);*/
		
	  if(ifc->address->family == AF_INET)
	  {
		  router_id_del_address(ifc);
		  listnode_delete (ifc->ifp->connected, ifc);
		  connected_free (ifc);
	  }
	  else
	  {
		 if(!CHECK_FLAG(ifc->ipv6_config, RTMD_IPV6_ADDR_CONFIG))
		  {
			 router_id_del_address(ifc);
			 listnode_delete (ifc->ifp->connected, ifc);
			 connected_free (ifc);
		  }
		 else
		  {
			 zlog_debug("%s: line %d, Cannot delete IPv6 config addr .\n",__func__,__LINE__);
		  }
	   }
		
    }
}