Skip to content

Commit

Permalink
better filtering.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHenson committed Oct 18, 2023
1 parent bc90c6c commit 821552a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions source/linux/system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ static bool s_is_irrelevant_interface(const struct aws_byte_cursor name) {

/* loop-back is important but not for looking at the system configuration,
we want the actual cards. */
if (aws_byte_cursor_eq_c_str_ignore_case(&name, "lo")) {
struct aws_byte_cursor loopback_cur = aws_byte_cursor_from_c_str("lo");
if (aws_byte_cursor_starts_with_ignore_case(&name, &loopback_cur)) {
return true;
}

/* typical virtual devices we want to ignore. */
struct aws_byte_cursor bridge_dev_cur = aws_byte_cursor_from_c_str("br-");
/* typical docker devices. */
if (aws_byte_cursor_eq_c_str_ignore_case(&name, "docker") ||
aws_byte_cursor_eq_c_str_ignore_case(&name, "veth") ||
struct aws_byte_cursor docker_dev_cur = aws_byte_cursor_from_c_str("docker");
struct aws_byte_cursor virtual_eth_cur = aws_byte_cursor_from_c_str("veth");

if (aws_byte_cursor_starts_with_ignore_case(&name, &docker_dev_cur) ||
aws_byte_cursor_starts_with_ignore_case(&name, &virtual_eth_cur) ||
aws_byte_cursor_starts_with_ignore_case(&name, &bridge_dev_cur)) {
return true;
}
Expand Down Expand Up @@ -85,7 +89,7 @@ int aws_system_environment_load_platform_impl(struct aws_system_environment *env
aws_byte_buf_clean_up(&node_file);
}
aws_byte_buf_clean_up(&temp_numa_info);

aws_array_list_push_back(&env->str_list_network_cards, &device_name);
aws_array_list_push_back(&env->u16_nic_to_cpu_group, &group_id);
}
Expand Down

0 comments on commit 821552a

Please sign in to comment.