mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 21:33:55 +00:00
ospfd: Remember network LSA sequence numbers across up/downs of an interface
* ospf_interface.h: (struct ospf_if_params) add field for saved network LSA seqnum * ospf_interfa.c: (ospf_new_if_params) init network_lsa_seqnum field to initial seqnum - doesnt matter though. * ospf_lsa.c: (ospf_network_lsa_new) check for any saved sequence number, and use if it exists. Save the result back. This should help avoid needless round of LSUpdate/LSRequests when a neighbour has to tell the originator "uhm, i have something newer than that already". * ospf_vty.c: (show_ip_ospf_interface_sub) Show the saved network LSA seqnum
This commit is contained in:
parent
aa276fd783
commit
7eb5b47e54
@ -531,6 +531,8 @@ ospf_new_if_params (void)
|
|||||||
|
|
||||||
oip->auth_crypt = list_new ();
|
oip->auth_crypt = list_new ();
|
||||||
|
|
||||||
|
oip->network_lsa_seqnum = htonl(OSPF_INITIAL_SEQUENCE_NUMBER);
|
||||||
|
|
||||||
return oip;
|
return oip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,7 +571,8 @@ ospf_free_if_params (struct interface *ifp, struct in_addr addr)
|
|||||||
!OSPF_IF_PARAM_CONFIGURED (oip, type) &&
|
!OSPF_IF_PARAM_CONFIGURED (oip, type) &&
|
||||||
!OSPF_IF_PARAM_CONFIGURED (oip, auth_simple) &&
|
!OSPF_IF_PARAM_CONFIGURED (oip, auth_simple) &&
|
||||||
!OSPF_IF_PARAM_CONFIGURED (oip, auth_type) &&
|
!OSPF_IF_PARAM_CONFIGURED (oip, auth_type) &&
|
||||||
listcount (oip->auth_crypt) == 0)
|
listcount (oip->auth_crypt) == 0 &&
|
||||||
|
ntohl (oip->network_lsa_seqnum) != OSPF_INITIAL_SEQUENCE_NUMBER)
|
||||||
{
|
{
|
||||||
ospf_del_if_params (oip);
|
ospf_del_if_params (oip);
|
||||||
rn->info = NULL;
|
rn->info = NULL;
|
||||||
|
@ -73,6 +73,9 @@ struct ospf_if_params
|
|||||||
|
|
||||||
DECLARE_IF_PARAM (struct list *, auth_crypt); /* List of Auth cryptographic data. */
|
DECLARE_IF_PARAM (struct list *, auth_crypt); /* List of Auth cryptographic data. */
|
||||||
DECLARE_IF_PARAM (int, auth_type); /* OSPF authentication type */
|
DECLARE_IF_PARAM (int, auth_type); /* OSPF authentication type */
|
||||||
|
|
||||||
|
/* Other, non-configuration state */
|
||||||
|
u_int32_t network_lsa_seqnum; /* Network LSA seqnum */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -167,6 +170,7 @@ struct ospf_interface
|
|||||||
|
|
||||||
/* Configured varables. */
|
/* Configured varables. */
|
||||||
struct ospf_if_params *params;
|
struct ospf_if_params *params;
|
||||||
|
|
||||||
u_int32_t crypt_seqnum; /* Cryptographic Sequence Number */
|
u_int32_t crypt_seqnum; /* Cryptographic Sequence Number */
|
||||||
u_int32_t output_cost; /* Acutual Interface Output Cost */
|
u_int32_t output_cost; /* Acutual Interface Output Cost */
|
||||||
|
|
||||||
|
@ -1048,6 +1048,7 @@ ospf_network_lsa_new (struct ospf_interface *oi)
|
|||||||
struct stream *s;
|
struct stream *s;
|
||||||
struct ospf_lsa *new;
|
struct ospf_lsa *new;
|
||||||
struct lsa_header *lsah;
|
struct lsa_header *lsah;
|
||||||
|
struct ospf_if_params *oip;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
/* If there are no neighbours on this network (the net is stub),
|
/* If there are no neighbours on this network (the net is stub),
|
||||||
@ -1087,6 +1088,22 @@ ospf_network_lsa_new (struct ospf_interface *oi)
|
|||||||
memcpy (new->data, lsah, length);
|
memcpy (new->data, lsah, length);
|
||||||
stream_free (s);
|
stream_free (s);
|
||||||
|
|
||||||
|
/* Remember prior network LSA sequence numbers, even if we stop
|
||||||
|
* originating one for this oi, to try avoid re-originating LSAs with a
|
||||||
|
* prior sequence number, and thus speed up adjency forming & convergence.
|
||||||
|
*/
|
||||||
|
if ((oip = ospf_lookup_if_params (oi->ifp, oi->address->u.prefix4)))
|
||||||
|
{
|
||||||
|
new->data->ls_seqnum = oip->network_lsa_seqnum;
|
||||||
|
new->data->ls_seqnum = lsa_seqnum_increment (new);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
oip = ospf_get_if_params (oi->ifp, oi->address->u.prefix4);
|
||||||
|
ospf_if_update_params (oi->ifp, oi->address->u.prefix4);
|
||||||
|
}
|
||||||
|
oip->network_lsa_seqnum = new->data->ls_seqnum;
|
||||||
|
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,6 +1142,7 @@ ospf_network_lsa_refresh (struct ospf_lsa *lsa, struct ospf_interface *oi)
|
|||||||
{
|
{
|
||||||
struct ospf_area *area = lsa->area;
|
struct ospf_area *area = lsa->area;
|
||||||
struct ospf_lsa *new;
|
struct ospf_lsa *new;
|
||||||
|
struct ospf_if_params *oip;
|
||||||
|
|
||||||
assert (lsa->data);
|
assert (lsa->data);
|
||||||
|
|
||||||
@ -1135,7 +1153,10 @@ ospf_network_lsa_refresh (struct ospf_lsa *lsa, struct ospf_interface *oi)
|
|||||||
new = ospf_network_lsa_new (oi);
|
new = ospf_network_lsa_new (oi);
|
||||||
if (new == NULL)
|
if (new == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
|
||||||
|
oip = ospf_lookup_if_params (oi->ifp, oi->address->u.prefix4);
|
||||||
|
assert (oip != NULL);
|
||||||
|
oip->network_lsa_seqnum = new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
||||||
|
|
||||||
ospf_lsa_install (area->ospf, oi, new);
|
ospf_lsa_install (area->ospf, oi, new);
|
||||||
|
|
||||||
|
@ -2934,6 +2934,12 @@ show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Next network-LSA sequence number we'll use, if we're elected DR */
|
||||||
|
if (oi->params && ntohl (oi->params->network_lsa_seqnum)
|
||||||
|
!= OSPF_INITIAL_SEQUENCE_NUMBER)
|
||||||
|
vty_out (vty, " Saved Network-LSA sequence number 0x%x%s",
|
||||||
|
ntohl (oi->params->network_lsa_seqnum), VTY_NEWLINE);
|
||||||
|
|
||||||
vty_out (vty, " Multicast group memberships:");
|
vty_out (vty, " Multicast group memberships:");
|
||||||
if (OI_MEMBER_CHECK(oi, MEMBER_ALLROUTERS)
|
if (OI_MEMBER_CHECK(oi, MEMBER_ALLROUTERS)
|
||||||
|| OI_MEMBER_CHECK(oi, MEMBER_DROUTERS))
|
|| OI_MEMBER_CHECK(oi, MEMBER_DROUTERS))
|
||||||
|
Loading…
Reference in New Issue
Block a user