diff options
| author | Olivier Dugeon <olivier.dugeon@orange.com> | 2023-03-01 14:09:45 +0100 |
|---|---|---|
| committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2023-04-07 16:40:26 +0200 |
| commit | 7f2742b657134ed631c01fc918755320fa52c393 (patch) | |
| tree | 819a35a148f068b17903219e4572920656dca4a3 /pathd | |
| parent | 7564fcb8f9e532721ff11af2c639d9c33d8a19ad (diff) | |
pathd: Update TE to new Link State Edge key
Following the modification of the edge key in link state database
this patch updates the path_ted.c file to replace the old uint64_t edge key by
the new ls_edge_key structure when searching for an edge.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'pathd')
| -rw-r--r-- | pathd/path_ted.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pathd/path_ted.c b/pathd/path_ted.c index d8ddd8cdc8..86ce6d5a5f 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, |
