Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions ospfd/ospf_lsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,7 @@ struct ospf_lsa *ospf_nssa_lsa_refresh(struct ospf_area *area,
{
struct ospf *ospf = area->ospf;
struct ospf_lsa *new;
struct as_external_lsa *extlsa_old, *extlsa_new;
struct as_external_lsa *extlsa_new;

/* Delete LSA from neighbor retransmit-list. */
ospf_ls_retransmit_delete_nbr_as(ospf, lsa);
Expand All @@ -2450,18 +2450,37 @@ struct ospf_lsa *ospf_nssa_lsa_refresh(struct ospf_area *area,
zlog_debug(
"LSA[Type7:%pI4]: Could not originate NSSA-LSA",
&ei->p.prefix);
ospf_lsa_flush_area(lsa, area);
return NULL;
}
new->data->type = OSPF_AS_NSSA_LSA;
new->data->ls_seqnum = lsa_seqnum_increment(lsa);
new->area = area;

/* Preserve the NP bit and forwarding address. */
/* Preserve the NP bit. */
if (CHECK_FLAG(lsa->data->options, OSPF_OPTION_NP))
SET_FLAG(new->data->options, OSPF_OPTION_NP);
extlsa_old = (struct as_external_lsa *)lsa->data;

/*
* Set forwarding address for NSSA LSA. Per RFC 3101, if the P-bit
* is set and the newly computed address is 0, use an NSSA interface
* address. Without the P-bit, a zero forwarding address is valid.
*/
extlsa_new = (struct as_external_lsa *)new->data;
extlsa_new->e[0].fwd_addr = extlsa_old->e[0].fwd_addr;
if (CHECK_FLAG(new->data->options, OSPF_OPTION_NP) &&
extlsa_new->e[0].fwd_addr.s_addr == INADDR_ANY)
extlsa_new->e[0].fwd_addr = ospf_get_nssa_ip(area);

/* P-bit LSAs must have a non-zero forwarding address. */
if (CHECK_FLAG(new->data->options, OSPF_OPTION_NP) &&
extlsa_new->e[0].fwd_addr.s_addr == INADDR_ANY) {
if (IS_DEBUG_OSPF_NSSA)
zlog_debug("LSA[Type-7:%pI4]: Could not refresh, no NSSA interface address",
&new->data->id);
ospf_lsa_discard(new);
ospf_lsa_flush_area(lsa, area);
return NULL;
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.

/* Install newly created LSA into Type-7 LSDB. */
ospf_lsa_install(ospf, NULL, new);
Expand Down
11 changes: 7 additions & 4 deletions ospfd/ospf_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -9745,11 +9745,14 @@ DEFPY (ospf_forwarding_address_self,
"Set forwarding address to self for external LSAs\n")
{
VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf);
bool new_value = !no;

if (no)
ospf->forwarding_address_self = false;
else
ospf->forwarding_address_self = true;
if (ospf->forwarding_address_self != new_value) {
ospf->forwarding_address_self = new_value;

/* Refresh all external LSAs to apply the new config. */
ospf_schedule_asbr_redist_update(ospf);
Comment thread
greptile-apps[bot] marked this conversation as resolved.
}

return CMD_SUCCESS;
}
Expand Down
Loading