mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 10:54:47 +00:00
pim6d: IPv6-adjust pim_upstream addr
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
11928ecf19
commit
01adb431d3
@ -54,20 +54,17 @@ static void on_trace(const char *label, struct interface *ifp,
|
||||
}
|
||||
|
||||
static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
|
||||
uint16_t holdtime, struct in_addr upstream,
|
||||
pim_sgaddr *sg, uint8_t source_flags)
|
||||
uint16_t holdtime, pim_addr upstream, pim_sgaddr *sg,
|
||||
uint8_t source_flags)
|
||||
{
|
||||
struct pim_interface *pim_ifp = NULL;
|
||||
|
||||
if (PIM_DEBUG_PIM_TRACE) {
|
||||
char up_str[INET_ADDRSTRLEN];
|
||||
pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str));
|
||||
if (PIM_DEBUG_PIM_TRACE)
|
||||
zlog_debug(
|
||||
"%s: join (S,G)=%pSG rpt=%d wc=%d upstream=%s holdtime=%d from %pPA on %s",
|
||||
"%s: join (S,G)=%pSG rpt=%d wc=%d upstream=%pPAs holdtime=%d from %pPA on %s",
|
||||
__func__, sg, !!(source_flags & PIM_RPT_BIT_MASK),
|
||||
!!(source_flags & PIM_WILDCARD_BIT_MASK), up_str,
|
||||
!!(source_flags & PIM_WILDCARD_BIT_MASK), &upstream,
|
||||
holdtime, &neigh->source_addr, ifp->name);
|
||||
}
|
||||
|
||||
pim_ifp = ifp->info;
|
||||
assert(pim_ifp);
|
||||
@ -116,20 +113,17 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
|
||||
}
|
||||
|
||||
static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
|
||||
uint16_t holdtime, struct in_addr upstream,
|
||||
pim_sgaddr *sg, uint8_t source_flags)
|
||||
uint16_t holdtime, pim_addr upstream, pim_sgaddr *sg,
|
||||
uint8_t source_flags)
|
||||
{
|
||||
struct pim_interface *pim_ifp = NULL;
|
||||
|
||||
if (PIM_DEBUG_PIM_TRACE) {
|
||||
char up_str[INET_ADDRSTRLEN];
|
||||
pim_inet4_dump("<upstream?>", upstream, up_str, sizeof(up_str));
|
||||
if (PIM_DEBUG_PIM_TRACE)
|
||||
zlog_debug(
|
||||
"%s: prune (S,G)=%pSG rpt=%d wc=%d upstream=%s holdtime=%d from %pPA on %s",
|
||||
"%s: prune (S,G)=%pSG rpt=%d wc=%d upstream=%pPAs holdtime=%d from %pPA on %s",
|
||||
__func__, sg, source_flags & PIM_RPT_BIT_MASK,
|
||||
source_flags & PIM_WILDCARD_BIT_MASK, up_str, holdtime,
|
||||
&neigh->source_addr, ifp->name);
|
||||
}
|
||||
source_flags & PIM_WILDCARD_BIT_MASK, &upstream,
|
||||
holdtime, &neigh->source_addr, ifp->name);
|
||||
|
||||
pim_ifp = ifp->info;
|
||||
assert(pim_ifp);
|
||||
|
@ -534,7 +534,7 @@ 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) &&
|
||||
if (pim_addr_is_any(up->upstream_addr) &&
|
||||
pim_addr_is_any(up->sg.src)) {
|
||||
struct prefix grp;
|
||||
struct rp_info *trp_info;
|
||||
@ -772,8 +772,10 @@ 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) &&
|
||||
pim_addr rpf_addr;
|
||||
|
||||
rpf_addr = pim_addr_from_prefix(&rp_info->rp.rpf_addr);
|
||||
if (!pim_addr_cmp(up->upstream_addr, rpf_addr) &&
|
||||
pim_addr_is_any(up->sg.src)) {
|
||||
struct prefix grp;
|
||||
|
||||
@ -781,7 +783,7 @@ int pim_rp_del(struct pim_instance *pim, struct in_addr rp_addr,
|
||||
trp_info = pim_rp_find_match_group(pim, &grp);
|
||||
if (trp_info == rp_all) {
|
||||
pim_upstream_rpf_clear(pim, up);
|
||||
up->upstream_addr.s_addr = INADDR_ANY;
|
||||
up->upstream_addr = PIMADDR_ANY;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -819,8 +821,10 @@ 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) &&
|
||||
pim_addr rpf_addr;
|
||||
|
||||
rpf_addr = pim_addr_from_prefix(&rp_info->rp.rpf_addr);
|
||||
if (!pim_addr_cmp(up->upstream_addr, rpf_addr) &&
|
||||
pim_addr_is_any(up->sg.src)) {
|
||||
struct prefix grp;
|
||||
|
||||
|
@ -234,7 +234,7 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
|
||||
if (PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(up->flags))
|
||||
return PIM_RPF_OK;
|
||||
|
||||
if (up->upstream_addr.s_addr == INADDR_ANY) {
|
||||
if (pim_addr_is_any(up->upstream_addr)) {
|
||||
zlog_debug("%s(%s): RP is not configured yet for %s",
|
||||
__func__, caller, up->sg_str);
|
||||
return PIM_RPF_OK;
|
||||
@ -248,13 +248,9 @@ enum pim_rpf_result pim_rpf_update(struct pim_instance *pim,
|
||||
old->rpf_addr = saved.rpf_addr;
|
||||
}
|
||||
|
||||
nht_p.family = AF_INET;
|
||||
nht_p.prefixlen = IPV4_MAX_BITLEN;
|
||||
nht_p.u.prefix4.s_addr = up->upstream_addr.s_addr;
|
||||
pim_addr_to_prefix(&nht_p, up->upstream_addr);
|
||||
|
||||
src.family = AF_INET;
|
||||
src.prefixlen = IPV4_MAX_BITLEN;
|
||||
src.u.prefix4 = up->upstream_addr; // RP or Src address
|
||||
pim_addr_to_prefix(&src, up->upstream_addr); // RP or Src address
|
||||
pim_addr_to_prefix(&grp, up->sg.grp);
|
||||
|
||||
if ((pim_addr_is_any(up->sg.src) && I_am_RP(pim, up->sg.grp)) ||
|
||||
|
@ -259,11 +259,9 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
|
||||
* to INADDR_ANY. This is done in order to avoid de-registering for
|
||||
* 255.255.255.255 which is maintained for some reason..
|
||||
*/
|
||||
if (up->upstream_addr.s_addr != INADDR_ANY) {
|
||||
if (!pim_addr_is_any(up->upstream_addr)) {
|
||||
/* Deregister addr with Zebra NHT */
|
||||
nht_p.family = AF_INET;
|
||||
nht_p.prefixlen = IPV4_MAX_BITLEN;
|
||||
nht_p.u.prefix4 = up->upstream_addr;
|
||||
pim_addr_to_prefix(&nht_p, up->upstream_addr);
|
||||
if (PIM_DEBUG_PIM_TRACE)
|
||||
zlog_debug(
|
||||
"%s: Deregister upstream %s addr %pFX with Zebra NHT",
|
||||
@ -713,7 +711,7 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
|
||||
{
|
||||
enum pim_upstream_state old_state = up->join_state;
|
||||
|
||||
if (up->upstream_addr.s_addr == INADDR_ANY) {
|
||||
if (pim_addr_is_any(up->upstream_addr)) {
|
||||
if (PIM_DEBUG_PIM_EVENTS)
|
||||
zlog_debug("%s: RPF not configured for %s", __func__,
|
||||
up->sg_str);
|
||||
@ -937,7 +935,7 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim,
|
||||
if (PIM_UPSTREAM_FLAG_TEST_SRC_NOCACHE(up->flags))
|
||||
pim_upstream_keep_alive_timer_start(
|
||||
up, pim->keep_alive_time);
|
||||
} else if (up->upstream_addr.s_addr != INADDR_ANY) {
|
||||
} else if (!pim_addr_is_any(up->upstream_addr)) {
|
||||
pim_upstream_update_use_rpt(up,
|
||||
false /*update_mroute*/);
|
||||
rpf_result = pim_rpf_update(pim, up, NULL, __func__);
|
||||
@ -1912,7 +1910,7 @@ void pim_upstream_find_new_rpf(struct pim_instance *pim)
|
||||
* Scan all (S,G) upstreams searching for RPF'(S,G)=neigh_addr
|
||||
*/
|
||||
frr_each (rb_pim_upstream, &pim->upstream_head, up) {
|
||||
if (up->upstream_addr.s_addr == INADDR_ANY) {
|
||||
if (pim_addr_is_any(up->upstream_addr)) {
|
||||
if (PIM_DEBUG_PIM_TRACE)
|
||||
zlog_debug(
|
||||
"%s: RP not configured for Upstream %s",
|
||||
|
@ -354,9 +354,7 @@ static void pim_vxlan_orig_mr_up_add(struct pim_vxlan_sg *vxlan_sg)
|
||||
* iif
|
||||
*/
|
||||
if (!PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(up->flags)) {
|
||||
nht_p.family = AF_INET;
|
||||
nht_p.prefixlen = IPV4_MAX_BITLEN;
|
||||
nht_p.u.prefix4 = up->upstream_addr;
|
||||
pim_addr_to_prefix(&nht_p, up->upstream_addr);
|
||||
pim_delete_tracked_nexthop(vxlan_sg->pim, &nht_p, up,
|
||||
NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user