diff options
Diffstat (limited to 'pathd/path_ted.c')
| -rw-r--r-- | pathd/path_ted.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pathd/path_ted.c b/pathd/path_ted.c index d8ddd8cdc8..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, @@ -268,7 +269,7 @@ uint32_t path_ted_query_type_c(struct prefix *prefix, uint8_t algo) switch (prefix->family) { case AF_INET: case AF_INET6: - subnet = ls_find_subnet(ted_state_g.ted, *prefix); + subnet = ls_find_subnet(ted_state_g.ted, prefix); if (subnet) { if ((CHECK_FLAG(subnet->ls_pref->flags, LS_PREF_SR)) && (subnet->ls_pref->sr.algo == algo)) @@ -298,7 +299,7 @@ uint32_t path_ted_query_type_e(struct prefix *prefix, uint32_t iface_id) switch (prefix->family) { case AF_INET: case AF_INET6: - subnet = ls_find_subnet(ted_state_g.ted, *prefix); + subnet = ls_find_subnet(ted_state_g.ted, prefix); if (subnet && subnet->vertex && subnet->vertex->outgoing_edges) { /* from the vertex linked in subnet */ |
