From: Ondrej Zajicek Date: Tue, 17 Dec 2024 08:00:42 +0000 (+0100) Subject: Nest: Fix handling of 64-bit rte_src.private_id X-Git-Tag: v3.1.0~40^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d062e93120cbb94f8dbb3b73c1129d1848f6fca;p=thirdparty%2Fbird.git Nest: Fix handling of 64-bit rte_src.private_id The commit 21213be523baa7f2cbf0feaa617f265c55e9b17a expanded private_id in route source to u64, but forgot to modify function arguments, so it was still cropped at 32-bit, which may cause some collisions for L3VPN. This patch fixes that. --- diff --git a/nest/route.h b/nest/route.h index be3d759e7..3ff611824 100644 --- a/nest/route.h +++ b/nest/route.h @@ -593,8 +593,8 @@ typedef struct ea_list { #define EALF_BISECT 2 /* Use interval bisection for searching */ #define EALF_CACHED 4 /* Attributes belonging to cached rta */ -struct rte_src *rt_find_source(struct proto *p, u32 id); -struct rte_src *rt_get_source(struct proto *p, u32 id); +struct rte_src *rt_find_source(struct proto *p, u64 id); +struct rte_src *rt_get_source(struct proto *p, u64 id); static inline void rt_lock_source(struct rte_src *src) { src->uc++; } static inline void rt_unlock_source(struct rte_src *src) { src->uc--; } void rt_prune_sources(void); diff --git a/nest/rt-attr.c b/nest/rt-attr.c index a567720ed..7c49af174 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -124,13 +124,13 @@ rte_src_init(void) HASH_DEFINE_REHASH_FN(RSH, struct rte_src) struct rte_src * -rt_find_source(struct proto *p, u32 id) +rt_find_source(struct proto *p, u64 id) { return HASH_FIND(src_hash, RSH, p, id); } struct rte_src * -rt_get_source(struct proto *p, u32 id) +rt_get_source(struct proto *p, u64 id) { struct rte_src *src = rt_find_source(p, id);