summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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,