diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2022-01-04 21:48:13 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2022-01-17 14:03:26 +0100 |
commit | 2a27f13b2197d07d11454b6cc8d0e5fc5b6ded87 (patch) | |
tree | 0e3e3f4f21943f7b960b11e474216dc3a3c36b77 /pimd/pim_rp.c | |
parent | pimd: remove pim_str_sg_dump() (diff) | |
download | frr-2a27f13b2197d07d11454b6cc8d0e5fc5b6ded87.tar.xz frr-2a27f13b2197d07d11454b6cc8d0e5fc5b6ded87.zip |
pimd: move, rename and deploy pim_addr_is_any()
Replaces comparison against INADDR_ANY, so we can do IPv6 too.
(Renamed from "pim_is_addr_any" for "pim_addr_*" naming pattern, and
type fixed to bool.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_rp.c')
-rw-r--r-- | pimd/pim_rp.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index d356aff9f..f35adb0ce 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -536,8 +536,8 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, /* Find (*, G) upstream whose RP is not * configured yet */ - if ((up->upstream_addr.s_addr == INADDR_ANY) - && (up->sg.src.s_addr == INADDR_ANY)) { + if ((up->upstream_addr.s_addr == INADDR_ANY) && + pim_addr_is_any(up->sg.src)) { struct prefix grp; struct rp_info *trp_info; @@ -628,7 +628,7 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, route_node_get_lock_count(rn)); frr_each (rb_pim_upstream, &pim->upstream_head, up) { - if (up->sg.src.s_addr == INADDR_ANY) { + if (pim_addr_is_any(up->sg.src)) { struct prefix grp; struct rp_info *trp_info; @@ -778,9 +778,9 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr, /* Find the upstream (*, G) whose upstream address is * same as the deleted RP */ - if ((up->upstream_addr.s_addr - == rp_info->rp.rpf_addr.u.prefix4.s_addr) - && (up->sg.src.s_addr == INADDR_ANY)) { + if ((up->upstream_addr.s_addr == + rp_info->rp.rpf_addr.u.prefix4.s_addr) && + pim_addr_is_any(up->sg.src)) { struct prefix grp; grp.family = AF_INET; grp.prefixlen = IPV4_MAX_BITLEN; @@ -826,9 +826,9 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr, /* Find the upstream (*, G) whose upstream address is same as * the deleted RP */ - if ((up->upstream_addr.s_addr - == rp_info->rp.rpf_addr.u.prefix4.s_addr) - && (up->sg.src.s_addr == INADDR_ANY)) { + if ((up->upstream_addr.s_addr == + rp_info->rp.rpf_addr.u.prefix4.s_addr) && + pim_addr_is_any(up->sg.src)) { struct prefix grp; grp.family = AF_INET; @@ -914,7 +914,7 @@ int pim_rp_change(struct pim_instance *pim, struct in_addr new_rp_addr, listnode_add_sort(pim->rp_list, rp_info); frr_each (rb_pim_upstream, &pim->upstream_head, up) { - if (up->sg.src.s_addr == INADDR_ANY) { + if (pim_addr_is_any(up->sg.src)) { struct prefix grp; struct rp_info *trp_info; |