mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 12:44:55 +00:00
*: Remove some unneeded functions
vrf_iflist_create -> By the time this is called in enable, the vrf's iflist is already created. Additionally this code should be a properly of the vrf to init/destroy not someone else. vrf_iflist_terminate -> This function should be a property of vrf deletion and does not need to be exposed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
7922fc65ae
commit
759927a1b9
19
bgpd/bgpd.c
19
bgpd/bgpd.c
@ -94,7 +94,6 @@ struct community_list_handler *bgp_clist;
|
|||||||
|
|
||||||
unsigned int multipath_num = MULTIPATH_NUM;
|
unsigned int multipath_num = MULTIPATH_NUM;
|
||||||
|
|
||||||
static void bgp_if_init (struct bgp *bgp);
|
|
||||||
static void bgp_if_finish (struct bgp *bgp);
|
static void bgp_if_finish (struct bgp *bgp);
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *zclient;
|
||||||
@ -3115,10 +3114,7 @@ bgp_get (struct bgp **bgp_val, as_t *as, const char *name,
|
|||||||
|
|
||||||
vrf = bgp_vrf_lookup_by_instance_type (bgp);
|
vrf = bgp_vrf_lookup_by_instance_type (bgp);
|
||||||
if (vrf)
|
if (vrf)
|
||||||
{
|
bgp_vrf_link (bgp, vrf);
|
||||||
bgp_vrf_link (bgp, vrf);
|
|
||||||
bgp_if_init (bgp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register with Zebra, if needed */
|
/* Register with Zebra, if needed */
|
||||||
@ -7654,19 +7650,6 @@ bgp_master_init (struct thread_master *master)
|
|||||||
QOBJ_REG (bm, bgp_master);
|
QOBJ_REG (bm, bgp_master);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Initialize interface list for instance, if needed. Invoked upon
|
|
||||||
* instance create.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
bgp_if_init (struct bgp *bgp)
|
|
||||||
{
|
|
||||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
|
|
||||||
return;
|
|
||||||
|
|
||||||
vrf_iflist_create (bgp->vrf_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free up connected routes and interfaces for a BGP instance. Invoked upon
|
* Free up connected routes and interfaces for a BGP instance. Invoked upon
|
||||||
* instance delete (non-default only) or BGP exit.
|
* instance delete (non-default only) or BGP exit.
|
||||||
|
18
lib/vrf.c
18
lib/vrf.c
@ -310,24 +310,6 @@ vrf_iflist_get (vrf_id_t vrf_id)
|
|||||||
return vrf->iflist;
|
return vrf->iflist;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the interface list for the specified VRF, if needed. */
|
|
||||||
void
|
|
||||||
vrf_iflist_create (vrf_id_t vrf_id)
|
|
||||||
{
|
|
||||||
struct vrf * vrf = vrf_lookup_by_id (vrf_id);
|
|
||||||
if (vrf && !vrf->iflist)
|
|
||||||
if_init (&vrf->iflist);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free the interface list of the specified VRF. */
|
|
||||||
void
|
|
||||||
vrf_iflist_terminate (vrf_id_t vrf_id)
|
|
||||||
{
|
|
||||||
struct vrf * vrf = vrf_lookup_by_id (vrf_id);
|
|
||||||
if (vrf && vrf->iflist)
|
|
||||||
if_terminate (&vrf->iflist);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VRF bit-map
|
* VRF bit-map
|
||||||
*/
|
*/
|
||||||
|
@ -108,6 +108,8 @@ extern struct vrf_name_head vrfs_by_name;
|
|||||||
*/
|
*/
|
||||||
extern void vrf_add_hook (int, int (*)(struct vrf *));
|
extern void vrf_add_hook (int, int (*)(struct vrf *));
|
||||||
|
|
||||||
|
int (*vrf_callback)(struct vrf *);
|
||||||
|
|
||||||
extern struct vrf *vrf_lookup_by_id (vrf_id_t);
|
extern struct vrf *vrf_lookup_by_id (vrf_id_t);
|
||||||
extern struct vrf *vrf_lookup_by_name (const char *);
|
extern struct vrf *vrf_lookup_by_name (const char *);
|
||||||
extern struct vrf *vrf_get (vrf_id_t, const char *);
|
extern struct vrf *vrf_get (vrf_id_t, const char *);
|
||||||
@ -146,10 +148,6 @@ extern void *vrf_info_lookup (vrf_id_t);
|
|||||||
extern struct list *vrf_iflist (vrf_id_t);
|
extern struct list *vrf_iflist (vrf_id_t);
|
||||||
/* Get the interface list of the specified VRF. Create one if not find. */
|
/* Get the interface list of the specified VRF. Create one if not find. */
|
||||||
extern struct list *vrf_iflist_get (vrf_id_t);
|
extern struct list *vrf_iflist_get (vrf_id_t);
|
||||||
/* Create the interface list for the specified VRF, if needed. */
|
|
||||||
extern void vrf_iflist_create (vrf_id_t vrf_id);
|
|
||||||
/* Free the interface list of the specified VRF. */
|
|
||||||
extern void vrf_iflist_terminate (vrf_id_t vrf_id);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VRF bit-map: maintaining flags, one bit per VRF ID
|
* VRF bit-map: maintaining flags, one bit per VRF ID
|
||||||
|
@ -61,7 +61,6 @@ pim_if_init (void)
|
|||||||
for (i = 0; i < MAXVIFS; i++)
|
for (i = 0; i < MAXVIFS; i++)
|
||||||
pim_iface_vif_index[i] = 0;
|
pim_iface_vif_index[i] = 0;
|
||||||
|
|
||||||
vrf_iflist_create(VRF_DEFAULT);
|
|
||||||
pim_ifchannel_list = list_new();
|
pim_ifchannel_list = list_new();
|
||||||
pim_ifchannel_list->cmp = (int (*)(void *, void *))pim_ifchannel_compare;
|
pim_ifchannel_list->cmp = (int (*)(void *, void *))pim_ifchannel_compare;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user