mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 06:50:17 +00:00
pim6d: Return type and parameter changes for api pim_rp_del_config
1. Return value of this function pim_rp_del_config is nowhere used. So made it as a void function. 2. Paramater const char *rp is first converted to string from prefix in the caller and then back to prefix in this api pim_rp_del_config. Fixed it by directly passing the address instead of string. Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
This commit is contained in:
parent
4fc1f59ea7
commit
99384c6e4d
@ -416,7 +416,6 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, struct prefix g
|
||||
const char *plist, enum rp_source rp_src_flag)
|
||||
{
|
||||
int result = 0;
|
||||
char rp[INET_ADDRSTRLEN];
|
||||
struct rp_info *rp_info;
|
||||
struct rp_info *rp_all;
|
||||
struct prefix group_all;
|
||||
@ -439,8 +438,6 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, struct prefix g
|
||||
prefix_copy(&rp_info->group, &group);
|
||||
rp_info->rp_src = rp_src_flag;
|
||||
|
||||
inet_ntop(AF_INET, &rp_info->rp.rpf_addr.u.prefix4, rp, sizeof(rp));
|
||||
|
||||
if (plist) {
|
||||
/*
|
||||
* Return if the prefix-list is already configured for this RP
|
||||
@ -467,11 +464,11 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, struct prefix g
|
||||
if (rp_info->rp.rpf_addr.u.prefix4.s_addr
|
||||
== tmp_rp_info->rp.rpf_addr.u.prefix4.s_addr) {
|
||||
if (tmp_rp_info->plist)
|
||||
pim_rp_del_config(pim, rp, NULL,
|
||||
pim_rp_del_config(pim, rp_addr, NULL,
|
||||
tmp_rp_info->plist);
|
||||
else
|
||||
pim_rp_del_config(
|
||||
pim, rp,
|
||||
pim, rp_addr,
|
||||
prefix2str(&tmp_rp_info->group,
|
||||
buffer, BUFSIZ),
|
||||
NULL);
|
||||
@ -504,7 +501,7 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, struct prefix g
|
||||
&& rp_info->rp.rpf_addr.u.prefix4.s_addr
|
||||
== tmp_rp_info->rp.rpf_addr.u.prefix4
|
||||
.s_addr) {
|
||||
pim_rp_del_config(pim, rp, NULL,
|
||||
pim_rp_del_config(pim, rp_addr, NULL,
|
||||
tmp_rp_info->plist);
|
||||
}
|
||||
}
|
||||
@ -657,11 +654,10 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, struct prefix g
|
||||
return PIM_SUCCESS;
|
||||
}
|
||||
|
||||
int pim_rp_del_config(struct pim_instance *pim, const char *rp,
|
||||
const char *group_range, const char *plist)
|
||||
void pim_rp_del_config(struct pim_instance *pim, pim_addr rp_addr,
|
||||
const char *group_range, const char *plist)
|
||||
{
|
||||
struct prefix group;
|
||||
struct in_addr rp_addr;
|
||||
int result;
|
||||
|
||||
if (group_range == NULL)
|
||||
@ -669,15 +665,15 @@ int pim_rp_del_config(struct pim_instance *pim, const char *rp,
|
||||
else
|
||||
result = str2prefix(group_range, &group);
|
||||
|
||||
if (!result)
|
||||
return PIM_GROUP_BAD_ADDRESS;
|
||||
if (!result) {
|
||||
if (PIM_DEBUG_PIM_TRACE)
|
||||
zlog_debug(
|
||||
"%s: String to prefix failed for %pPAs group",
|
||||
__func__, &rp_addr);
|
||||
return;
|
||||
}
|
||||
|
||||
result = inet_pton(AF_INET, rp, &rp_addr);
|
||||
if (result <= 0)
|
||||
return PIM_RP_BAD_ADDRESS;
|
||||
|
||||
result = pim_rp_del(pim, rp_addr, group, plist, RP_SRC_STATIC);
|
||||
return result;
|
||||
pim_rp_del(pim, rp_addr, group, plist, RP_SRC_STATIC);
|
||||
}
|
||||
|
||||
int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,
|
||||
|
@ -50,8 +50,8 @@ void pim_rp_list_hash_clean(void *data);
|
||||
int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr,
|
||||
struct prefix group, const char *plist,
|
||||
enum rp_source rp_src_flag);
|
||||
int pim_rp_del_config(struct pim_instance *pim, const char *rp,
|
||||
const char *group, const char *plist);
|
||||
void pim_rp_del_config(struct pim_instance *pim, pim_addr rp_addr,
|
||||
const char *group, const char *plist);
|
||||
int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,
|
||||
struct prefix group, const char *plist,
|
||||
enum rp_source rp_src_flag);
|
||||
|
Loading…
Reference in New Issue
Block a user