This commit is contained in:
Donald Sharp 2025-04-29 19:58:00 +00:00 committed by GitHub
commit 63ef8636cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 79 additions and 64 deletions

View file

@ -1110,7 +1110,7 @@ struct TLV_IPv4_Internal_type *eigrp_read_ipv4_tlv(struct stream *s)
tlv->prefix_length = stream_getc(s);
destination_tmp = stream_getc(s) << 24;
destination_tmp = (uint32_t)stream_getc(s) << 24;
if (tlv->prefix_length > 8)
destination_tmp |= stream_getc(s) << 16;
if (tlv->prefix_length > 16)

View file

@ -83,11 +83,11 @@ DECLARE_MTYPE(BITFIELD);
* return an id to bitfield v
*/
#define bf_release_index(v, id) \
(v).data[bf_index(id)] &= ~(1 << (bf_offset(id)))
(v).data[bf_index(id)] &= ~(1U << (bf_offset(id)))
/* check if an id is in use */
#define bf_test_index(v, id) \
((v).data[bf_index(id)] & (1 << (bf_offset(id))))
((v).data[bf_index(id)] & (1U << (bf_offset(id))))
/* check if the bit field has been setup */
#define bf_is_inited(v) ((v).data)
@ -110,7 +110,7 @@ DECLARE_MTYPE(BITFIELD);
#define bf_set_bit(v, b) \
do { \
size_t w = bf_index(b); \
(v).data[w] |= 1 << (bf_offset(b)); \
(v).data[w] |= 1U << (bf_offset(b)); \
(v).n += ((v).data[w] == WORD_MAX); \
if ((v).n == (v).m) { \
(v).m = (v).m + 1; \

View file

@ -1505,13 +1505,7 @@ void event_cancel_async(struct event_loop *master, struct event **thread,
{
assert(!(thread && eventobj) && (thread || eventobj));
if (thread && *thread)
frrtrace(9, frr_libfrr, event_cancel_async, master,
(*thread)->xref->funcname, (*thread)->xref->xref.file,
(*thread)->xref->xref.line, NULL, (*thread)->u.fd,
(*thread)->u.val, (*thread)->arg,
(*thread)->u.sands.tv_sec);
else
if (!thread)
frrtrace(9, frr_libfrr, event_cancel_async, master, NULL, NULL,
0, NULL, 0, 0, eventobj, 0);
@ -1521,6 +1515,14 @@ void event_cancel_async(struct event_loop *master, struct event **thread,
master->canceled = false;
if (thread) {
if (*thread)
frrtrace(9, frr_libfrr, event_cancel_async,
master, (*thread)->xref->funcname,
(*thread)->xref->xref.file,
(*thread)->xref->xref.line, NULL,
(*thread)->u.fd, (*thread)->u.val,
(*thread)->arg,
(*thread)->u.sands.tv_sec);
struct cancel_req *cr =
XCALLOC(MTYPE_TMP, sizeof(struct cancel_req));
cr->threadref = thread;

View file

@ -140,38 +140,38 @@ struct ls_node {
};
/* Link State flags to indicate which Attribute parameters are valid */
#define LS_ATTR_UNSET 0x00000000
#define LS_ATTR_NAME 0x00000001
#define LS_ATTR_METRIC 0x00000002
#define LS_ATTR_TE_METRIC 0x00000004
#define LS_ATTR_ADM_GRP 0x00000008
#define LS_ATTR_LOCAL_ADDR 0x00000010
#define LS_ATTR_NEIGH_ADDR 0x00000020
#define LS_ATTR_LOCAL_ADDR6 0x00000040
#define LS_ATTR_NEIGH_ADDR6 0x00000080
#define LS_ATTR_LOCAL_ID 0x00000100
#define LS_ATTR_NEIGH_ID 0x00000200
#define LS_ATTR_MAX_BW 0x00000400
#define LS_ATTR_MAX_RSV_BW 0x00000800
#define LS_ATTR_UNRSV_BW 0x00001000
#define LS_ATTR_REMOTE_AS 0x00002000
#define LS_ATTR_REMOTE_ADDR 0x00004000
#define LS_ATTR_REMOTE_ADDR6 0x00008000
#define LS_ATTR_DELAY 0x00010000
#define LS_ATTR_MIN_MAX_DELAY 0x00020000
#define LS_ATTR_JITTER 0x00040000
#define LS_ATTR_PACKET_LOSS 0x00080000
#define LS_ATTR_AVA_BW 0x00100000
#define LS_ATTR_RSV_BW 0x00200000
#define LS_ATTR_USE_BW 0x00400000
#define LS_ATTR_ADJ_SID 0x01000000
#define LS_ATTR_BCK_ADJ_SID 0x02000000
#define LS_ATTR_ADJ_SID6 0x04000000
#define LS_ATTR_BCK_ADJ_SID6 0x08000000
#define LS_ATTR_SRLG 0x10000000
#define LS_ATTR_EXT_ADM_GRP 0x20000000
#define LS_ATTR_ADJ_SRV6SID 0x40000000
#define LS_ATTR_BCK_ADJ_SRV6SID 0x80000000
#define LS_ATTR_UNSET 0x00000000U
#define LS_ATTR_NAME 0x00000001U
#define LS_ATTR_METRIC 0x00000002U
#define LS_ATTR_TE_METRIC 0x00000004U
#define LS_ATTR_ADM_GRP 0x00000008U
#define LS_ATTR_LOCAL_ADDR 0x00000010U
#define LS_ATTR_NEIGH_ADDR 0x00000020U
#define LS_ATTR_LOCAL_ADDR6 0x00000040U
#define LS_ATTR_NEIGH_ADDR6 0x00000080U
#define LS_ATTR_LOCAL_ID 0x00000100U
#define LS_ATTR_NEIGH_ID 0x00000200U
#define LS_ATTR_MAX_BW 0x00000400U
#define LS_ATTR_MAX_RSV_BW 0x00000800U
#define LS_ATTR_UNRSV_BW 0x00001000U
#define LS_ATTR_REMOTE_AS 0x00002000U
#define LS_ATTR_REMOTE_ADDR 0x00004000U
#define LS_ATTR_REMOTE_ADDR6 0x00008000U
#define LS_ATTR_DELAY 0x00010000U
#define LS_ATTR_MIN_MAX_DELAY 0x00020000U
#define LS_ATTR_JITTER 0x00040000U
#define LS_ATTR_PACKET_LOSS 0x00080000U
#define LS_ATTR_AVA_BW 0x00100000U
#define LS_ATTR_RSV_BW 0x00200000U
#define LS_ATTR_USE_BW 0x00400000U
#define LS_ATTR_ADJ_SID 0x01000000U
#define LS_ATTR_BCK_ADJ_SID 0x02000000U
#define LS_ATTR_ADJ_SID6 0x04000000U
#define LS_ATTR_BCK_ADJ_SID6 0x08000000U
#define LS_ATTR_SRLG 0x10000000U
#define LS_ATTR_EXT_ADM_GRP 0x20000000U
#define LS_ATTR_ADJ_SRV6SID 0x40000000U
#define LS_ATTR_BCK_ADJ_SRV6SID 0x80000000U
/* Link State Attributes */
struct ls_attributes {

View file

@ -152,8 +152,7 @@ extern void *qcalloc(struct memtype *mt, size_t size)
__attribute__((malloc, _ALLOC_SIZE(2), nonnull(1) _RET_NONNULL));
extern void *qrealloc(struct memtype *mt, void *ptr, size_t size)
__attribute__((_ALLOC_SIZE(3), nonnull(1) _RET_NONNULL));
extern void *qstrdup(struct memtype *mt, const char *str)
__attribute__((malloc, nonnull(1) _RET_NONNULL));
extern void *qstrdup(struct memtype *mt, const char *str);
extern void qcountfree(struct memtype *mt, void *ptr)
__attribute__((nonnull(1)));
extern void qfree(struct memtype *mt, void *ptr) __attribute__((nonnull(1)));

View file

@ -251,17 +251,25 @@ int yang_snodes_iterate(const struct lys_module *module, yang_iterate_cb cb,
if (ret == YANG_ITER_STOP)
return ret;
}
LY_LIST_FOR (&module_iter->compiled->rpcs->node, snode) {
ret = yang_snodes_iterate_subtree(snode, module, cb,
flags, arg);
if (ret == YANG_ITER_STOP)
return ret;
if (module_iter->compiled->rpcs) {
LY_LIST_FOR (&module_iter->compiled->rpcs->node, snode) {
ret = yang_snodes_iterate_subtree(snode, module,
cb, flags,
arg);
if (ret == YANG_ITER_STOP)
return ret;
}
}
LY_LIST_FOR (&module_iter->compiled->notifs->node, snode) {
ret = yang_snodes_iterate_subtree(snode, module, cb,
flags, arg);
if (ret == YANG_ITER_STOP)
return ret;
if (module_iter->compiled->notifs) {
LY_LIST_FOR (&module_iter->compiled->notifs->node,
snode) {
ret = yang_snodes_iterate_subtree(snode, module,
cb, flags,
arg);
if (ret == YANG_ITER_STOP)
return ret;
}
}
}

View file

@ -742,7 +742,8 @@ static void zlog_5424_cycle(struct zlog_cfg_5424 *zcf, int fd)
/* all of this is swapped in by zlog_target_replace() below,
* the old target is RCU-freed afterwards.
*/
zt = zlog_target_clone(MTYPE_LOG_5424, &zcf->active->zt,
zt = zlog_target_clone(MTYPE_LOG_5424,
zcf->active ? &zcf->active->zt : NULL,
sizeof(*zlt));
zlt = container_of(zt, struct zlt_5424, zt);

View file

@ -208,7 +208,8 @@ static bool zlog_file_cycle(struct zlog_cfg_file *zcf)
break;
}
zt = zlog_target_clone(MTYPE_LOG_FD, &zcf->active->zt,
zt = zlog_target_clone(MTYPE_LOG_FD,
zcf->active ? &zcf->active->zt : NULL,
sizeof(*zlt));
zlt = container_of(zt, struct zlt_fd, zt);
@ -551,7 +552,7 @@ void zlog_syslog_set_prio_min(int prio_min)
if (syslog_prio_min != ZLOG_DISABLED) {
newztc = zlog_target_clone(MTYPE_LOG_SYSL,
&zlt_syslog->zt,
zlt_syslog ? &zlt_syslog->zt : NULL,
sizeof(*newzt));
newzt = container_of(newztc, struct zlt_syslog, zt);
newzt->zt.prio_min = prio_min;
@ -561,7 +562,7 @@ void zlog_syslog_set_prio_min(int prio_min)
}
zlog_target_free(MTYPE_LOG_SYSL,
zlog_target_replace(&zlt_syslog->zt,
zlog_target_replace(zlt_syslog ? &zlt_syslog->zt : NULL,
&newzt->zt));
zlt_syslog = newzt;

View file

@ -154,7 +154,7 @@ def get_ip_networks(super_prefix, count):
return tuple(network.subnets(count_log2))[0:count]
@retry(retry_timeout=30, initial_wait=0.1)
@retry(retry_timeout=60, initial_wait=0.1)
def check_kernel(r1, super_prefix, count, add, is_blackhole, vrf, matchvia):
network = ipaddress.ip_network(super_prefix)
vrfstr = f" vrf {vrf}" if vrf else ""
@ -186,7 +186,7 @@ def addrgen(a, count, step=1):
a += step
@retry(retry_timeout=30, initial_wait=0.1)
@retry(retry_timeout=60, initial_wait=0.1)
def check_kernel_net(r1, net, vrf):
addr = ipaddress.ip_network(net)
vrfstr = f" vrf {vrf}" if vrf else ""
@ -200,7 +200,7 @@ def check_kernel_net(r1, net, vrf):
assert str(net) in kernel, f"Failed to find '{net}' in {nentries} entries"
@retry(retry_timeout=30, initial_wait=0.1)
@retry(retry_timeout=60, initial_wait=0.1)
def check_kernel_32(r1, start_addr, count, vrf, step=1):
start = ipaddress.ip_address(start_addr)
vrfstr = f" vrf {vrf}" if vrf else ""

View file

@ -1387,8 +1387,12 @@ static int netlink_route_change_read_multicast(struct nlmsghdr *h,
*(struct in6_addr *)RTA_DATA(tb[RTA_DST]);
}
if (tb[RTA_EXPIRES])
m->lastused = *(unsigned long long *)RTA_DATA(tb[RTA_EXPIRES]);
if (tb[RTA_EXPIRES]) {
unsigned long long temporary;
memcpy(&temporary, RTA_DATA(tb[RTA_EXPIRES]), sizeof(temporary));
m->lastused = temporary;
}
if (tb[RTA_MULTIPATH]) {
struct rtnexthop *rtnh =