Merge pull request #11462 from donaldsharp/random_stuff_right

Random stuff right
This commit is contained in:
mobash-rasool 2022-06-24 17:23:31 +05:30 committed by GitHub
commit 8771cdcb94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 36 additions and 25 deletions

View File

@ -628,7 +628,6 @@ static void vnc_zebra_add_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd,
struct rfapi_nve_group_cfg *rfg = rfd->rfg; struct rfapi_nve_group_cfg *rfg = rfd->rfg;
afi_t afi = family2afi(rfd->vn_addr.addr_family); afi_t afi = family2afi(rfd->vn_addr.addr_family);
struct prefix nhp; struct prefix nhp;
// struct prefix *nhpp;
void *pAddr; void *pAddr;
vnc_zlog_debug_verbose("%s: entry, add=%d", __func__, add); vnc_zlog_debug_verbose("%s: entry, add=%d", __func__, add);
@ -660,7 +659,7 @@ static void vnc_zebra_add_del_nve(struct bgp *bgp, struct rfapi_descriptor *rfd,
return; return;
} }
pAddr = &nhp.u.prefix4; pAddr = &nhp.u.val;
/* /*
* Loop over the list of NVE-Groups configured for * Loop over the list of NVE-Groups configured for

View File

@ -206,7 +206,7 @@ static int bfd_handle_circuit_add_addr(struct isis_circuit *circuit)
struct isis_adjacency *adj; struct isis_adjacency *adj;
struct listnode *node; struct listnode *node;
if (circuit->area == 0) if (circuit->area == NULL)
return 0; return 0;
for (ALL_LIST_ELEMENTS_RO(circuit->area->adjacency_list, node, adj)) { for (ALL_LIST_ELEMENTS_RO(circuit->area->adjacency_list, node, adj)) {

View File

@ -2117,7 +2117,7 @@ static uint8_t *isis_snmp_find_circ(struct variable *v, oid *name,
switch (v->magic) { switch (v->magic) {
case ISIS_CIRC_IFINDEX: case ISIS_CIRC_IFINDEX:
if (circuit->interface == 0) if (circuit->interface == NULL)
return SNMP_INTEGER(0); return SNMP_INTEGER(0);
return SNMP_INTEGER(circuit->interface->ifindex); return SNMP_INTEGER(circuit->interface->ifindex);

View File

@ -120,7 +120,13 @@ void ospf6_auth_hdr_dump_recv(struct ospf6_header *ospfh, uint16_t length,
ospf6_at_hdr = ospf6_at_hdr =
(struct ospf6_auth_hdr *)((uint8_t *)ospfh + oh_len); (struct ospf6_auth_hdr *)((uint8_t *)ospfh + oh_len);
at_hdr_len = ntohs(ospf6_at_hdr->length); at_hdr_len = ntohs(ospf6_at_hdr->length);
hash_len = at_hdr_len - OSPF6_AUTH_HDR_MIN_SIZE; hash_len = at_hdr_len - (uint16_t)OSPF6_AUTH_HDR_MIN_SIZE;
if (hash_len > KEYCHAIN_MAX_HASH_SIZE) {
zlog_debug(
"Specified value for hash_len %u is greater than expected %u",
hash_len, KEYCHAIN_MAX_HASH_SIZE);
return;
}
memcpy(temp, ospf6_at_hdr->data, hash_len); memcpy(temp, ospf6_at_hdr->data, hash_len);
temp[hash_len] = '\0'; temp[hash_len] = '\0';
zlog_debug("OSPF6 Authentication Trailer"); zlog_debug("OSPF6 Authentication Trailer");

View File

@ -2198,7 +2198,7 @@ void gm_ifp_teardown(struct interface *ifp)
static void gm_update_ll(struct interface *ifp) static void gm_update_ll(struct interface *ifp)
{ {
struct pim_interface *pim_ifp = ifp->info; struct pim_interface *pim_ifp = ifp->info;
struct gm_if *gm_ifp = pim_ifp ? pim_ifp->mld : NULL; struct gm_if *gm_ifp = pim_ifp->mld;
bool was_querier; bool was_querier;
was_querier = was_querier =

View File

@ -88,6 +88,7 @@ struct pim_router {
uint32_t register_suppress_time; uint32_t register_suppress_time;
int packet_process; int packet_process;
uint32_t register_probe_time; uint32_t register_probe_time;
uint16_t multipath;
/* /*
* What is the default vrf that we work in * What is the default vrf that we work in

View File

@ -304,14 +304,14 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, struct in_addr bsr_addr,
* "check cache or get immediate result." But until that can * "check cache or get immediate result." But until that can
* be worked in, here's a copy of the code below :( * be worked in, here's a copy of the code below :(
*/ */
struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM]; struct pim_zlookup_nexthop nexthop_tab[router->multipath];
ifindex_t i; ifindex_t i;
struct interface *ifp = NULL; struct interface *ifp = NULL;
int num_ifindex; int num_ifindex;
memset(nexthop_tab, 0, sizeof(nexthop_tab)); memset(nexthop_tab, 0, sizeof(nexthop_tab));
num_ifindex = zclient_lookup_nexthop(pim, nexthop_tab, num_ifindex = zclient_lookup_nexthop(
MULTIPATH_NUM, bsr_addr, pim, nexthop_tab, router->multipath, bsr_addr,
PIM_NEXTHOP_LOOKUP_MAX); PIM_NEXTHOP_LOOKUP_MAX);
if (num_ifindex <= 0) if (num_ifindex <= 0)
@ -501,8 +501,8 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim,
struct prefix *src, struct prefix *grp, struct prefix *src, struct prefix *grp,
int neighbor_needed) int neighbor_needed)
{ {
struct pim_neighbor *nbrs[MULTIPATH_NUM], *nbr = NULL; struct pim_neighbor *nbrs[router->multipath], *nbr = NULL;
struct interface *ifps[MULTIPATH_NUM]; struct interface *ifps[router->multipath];
struct nexthop *nh_node = NULL; struct nexthop *nh_node = NULL;
ifindex_t first_ifindex; ifindex_t first_ifindex;
struct interface *ifp = NULL; struct interface *ifp = NULL;
@ -888,11 +888,11 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,
struct prefix *grp, int neighbor_needed) struct prefix *grp, int neighbor_needed)
{ {
struct pim_nexthop_cache *pnc; struct pim_nexthop_cache *pnc;
struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM]; struct pim_zlookup_nexthop nexthop_tab[router->multipath];
struct pim_neighbor *nbrs[MULTIPATH_NUM], *nbr = NULL; struct pim_neighbor *nbrs[router->multipath], *nbr = NULL;
struct pim_rpf rpf; struct pim_rpf rpf;
int num_ifindex; int num_ifindex;
struct interface *ifps[MULTIPATH_NUM], *ifp; struct interface *ifps[router->multipath], *ifp;
int first_ifindex; int first_ifindex;
int found = 0; int found = 0;
uint8_t i = 0; uint8_t i = 0;
@ -915,8 +915,9 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim,
} }
memset(nexthop_tab, 0, memset(nexthop_tab, 0,
sizeof(struct pim_zlookup_nexthop) * MULTIPATH_NUM); sizeof(struct pim_zlookup_nexthop) * router->multipath);
num_ifindex = zclient_lookup_nexthop(pim, nexthop_tab, MULTIPATH_NUM, num_ifindex =
zclient_lookup_nexthop(pim, nexthop_tab, router->multipath,
src_addr, PIM_NEXTHOP_LOOKUP_MAX); src_addr, PIM_NEXTHOP_LOOKUP_MAX);
if (num_ifindex < 1) { if (num_ifindex < 1) {
if (PIM_DEBUG_PIM_NHT) if (PIM_DEBUG_PIM_NHT)

View File

@ -54,7 +54,7 @@ void pim_rpf_set_refresh_time(struct pim_instance *pim)
bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop, bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,
pim_addr addr, int neighbor_needed) pim_addr addr, int neighbor_needed)
{ {
struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM]; struct pim_zlookup_nexthop nexthop_tab[router->multipath];
struct pim_neighbor *nbr = NULL; struct pim_neighbor *nbr = NULL;
int num_ifindex; int num_ifindex;
struct interface *ifp = NULL; struct interface *ifp = NULL;
@ -92,8 +92,9 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop,
} }
memset(nexthop_tab, 0, memset(nexthop_tab, 0,
sizeof(struct pim_zlookup_nexthop) * MULTIPATH_NUM); sizeof(struct pim_zlookup_nexthop) * router->multipath);
num_ifindex = zclient_lookup_nexthop(pim, nexthop_tab, MULTIPATH_NUM, num_ifindex =
zclient_lookup_nexthop(pim, nexthop_tab, router->multipath,
addr, PIM_NEXTHOP_LOOKUP_MAX); addr, PIM_NEXTHOP_LOOKUP_MAX);
if (num_ifindex < 1) { if (num_ifindex < 1) {
zlog_warn( zlog_warn(

View File

@ -452,6 +452,7 @@ static void pim_zebra_connected(struct zclient *zclient)
static void pim_zebra_capabilities(struct zclient_capabilities *cap) static void pim_zebra_capabilities(struct zclient_capabilities *cap)
{ {
router->mlag_role = cap->role; router->mlag_role = cap->role;
router->multipath = cap->ecmp;
} }
static zclient_handler *const pim_handlers[] = { static zclient_handler *const pim_handlers[] = {

View File

@ -211,7 +211,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,
metric = stream_getl(s); metric = stream_getl(s);
nexthop_num = stream_getc(s); nexthop_num = stream_getc(s);
if (nexthop_num < 1) { if (nexthop_num < 1 || nexthop_num > router->multipath) {
if (PIM_DEBUG_PIM_NHT_DETAIL) if (PIM_DEBUG_PIM_NHT_DETAIL)
zlog_debug("%s: socket %d bad nexthop_num=%d", __func__, zlog_debug("%s: socket %d bad nexthop_num=%d", __func__,
zlookup->sock, nexthop_num); zlookup->sock, nexthop_num);
@ -258,8 +258,9 @@ static int zclient_read_nexthop(struct pim_instance *pim,
nexthop_tab[num_ifindex].ifindex = nh_ifi; nexthop_tab[num_ifindex].ifindex = nh_ifi;
++num_ifindex; ++num_ifindex;
#else #else
zlog_warn("cannot use IPv4 nexthop %pI4 for IPv6 %pPA", zlog_warn(
&nh_ip4, &addr); "cannot use IPv4 nexthop %pI4(%d) for IPv6 %pPA",
&nh_ip4, nh_ifi, &addr);
#endif #endif
break; break;
case NEXTHOP_TYPE_IPV6_IFINDEX: case NEXTHOP_TYPE_IPV6_IFINDEX:

View File

@ -100,6 +100,7 @@ void pim_router_init(void)
router->debugs = 0; router->debugs = 0;
router->master = frr_init(); router->master = frr_init();
router->t_periodic = PIM_DEFAULT_T_PERIODIC; router->t_periodic = PIM_DEFAULT_T_PERIODIC;
router->multipath = MULTIPATH_NUM;
/* /*
RFC 4601: 4.6.3. Assert Metrics RFC 4601: 4.6.3. Assert Metrics