Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathd: nai adjacency fix query type f for IPV6 #11910

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pathd/path_ted.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ uint32_t path_ted_query_type_f(struct ipaddr *local, struct ipaddr *remote)
}
break;
case IPADDR_V6:
key = (uint64_t)(local->ip._v6_addr.s6_addr32[0] & 0xffffffff)
| ((uint64_t)local->ip._v6_addr.s6_addr32[1] << 32);
key = (uint64_t)ntohl(local->ip._v6_addr.s6_addr32[2]) << 32 |
(uint64_t)ntohl(local->ip._v6_addr.s6_addr32[3]);
edge = ls_find_edge_by_key(ted_state_g.ted, key);
if (edge) {
if ((memcmp(&edge->attributes->standard.remote6,
&remote->ip._v6_addr,
sizeof(remote->ip._v6_addr))
&& CHECK_FLAG(edge->attributes->flags,
LS_ATTR_ADJ_SID))) {
sid = edge->attributes->adj_sid[0]
if ((0 == memcmp(&edge->attributes->standard.remote6,
&remote->ip._v6_addr,
sizeof(remote->ip._v6_addr)) &&
CHECK_FLAG(edge->attributes->flags,
LS_ATTR_ADJ_SID6))) {
sid = edge->attributes->adj_sid[ADJ_PRI_IPV6]
Comment on lines +250 to +255
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using 'if ((!memcmp(&edge ....' syntax?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return of memcmp is not boolean but an integer. The test of that value is meaningfull.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's true. I'll merge the patch

.sid; /* from primary */
break;
}
Expand Down