summaryrefslogtreecommitdiff
path: root/pathd
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2023-04-20 18:33:21 +0200
committerGitHub <noreply@github.com>2023-04-20 18:33:21 +0200
commit7b343a9ed5381d6e66cb68a6aa396d2194de7444 (patch)
treece55d7f53e9f05634719b44217cf132bb4ebc952 /pathd
parente2bebeb6665a7608ab3d2a0979b87584b04b15aa (diff)
parentc62067c1a60e70c259aa4fb576f6acd106f5c612 (diff)
Merge pull request #12933 from Orange-OpenSource/link_state
lib: Update edge key in link state database
Diffstat (limited to 'pathd')
-rw-r--r--pathd/path_ted.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pathd/path_ted.c b/pathd/path_ted.c
index fd5c342d84..df23f93127 100644
--- a/pathd/path_ted.c
+++ b/pathd/path_ted.c
@@ -206,7 +206,7 @@ uint32_t path_ted_query_type_f(struct ipaddr *local, struct ipaddr *remote)
{
uint32_t sid = MPLS_LABEL_NONE;
struct ls_edge *edge;
- uint64_t key;
+ struct ls_edge_key key;
if (!path_ted_is_initialized())
return MPLS_LABEL_NONE;
@@ -218,7 +218,8 @@ uint32_t path_ted_query_type_f(struct ipaddr *local, struct ipaddr *remote)
case IPADDR_V4:
/* We have local and remote ip */
/* so check all attributes in ted */
- key = ((uint64_t)ntohl(local->ip._v4_addr.s_addr)) & 0xffffffff;
+ key.family = AF_INET;
+ IPV4_ADDR_COPY(&key.k.addr, &local->ip._v4_addr);
edge = ls_find_edge_by_key(ted_state_g.ted, key);
if (edge) {
if (edge->attributes->standard.remote.s_addr
@@ -232,8 +233,8 @@ uint32_t path_ted_query_type_f(struct ipaddr *local, struct ipaddr *remote)
}
break;
case IPADDR_V6:
- key = (uint64_t)ntohl(local->ip._v6_addr.s6_addr32[2]) << 32 |
- (uint64_t)ntohl(local->ip._v6_addr.s6_addr32[3]);
+ key.family = AF_INET6;
+ IPV6_ADDR_COPY(&key.k.addr6, &local->ip._v6_addr);
edge = ls_find_edge_by_key(ted_state_g.ted, key);
if (edge) {
if ((0 == memcmp(&edge->attributes->standard.remote6,