don't consider particular addresses for multipath
@@ -1750,6 +1750,7 @@ int picoquic_getaddrs_v4(struct sockaddr_in *sas, uint32_t *if_indexes, int sas_
}
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
+ bool remove_10 = false;
if (strncmp("docker", ifa->ifa_name, 6) == 0 ||
strncmp("lo", ifa->ifa_name, 2) == 0 ||
strncmp("tun", ifa->ifa_name, 3) == 0)
@@ -1757,11 +1758,22 @@ int picoquic_getaddrs_v4(struct sockaddr_in *sas, uint32_t *if_indexes, int sas_
/* Do not consider those addresses */
continue;
}
+ /* Special check for experiments */
+ if (strncmp("eth0", ifa->ifa_name, 4) == 0) {
+ remove_10 = true;
+ }
/* What if an interface has no IP address? */
if (ifa->ifa_addr) {
family = ifa->ifa_addr->sa_family;
if (family == AF_INET) {
struct sockaddr_in *sai = (struct sockaddr_in *) ifa->ifa_addr;
+ if (remove_10) {
+ in_addr_t a = sai->sin_addr.s_addr & (in_addr_t) 0xff;
+ if (a == (in_addr_t) 0x0a) {
+ /* Don't consider this address */
+ continue;
+ }
+ }
if (count < sas_length) {
if_index = if_nametoindex(ifa->ifa_name);
memcpy(&if_indexes[count], &if_index, sizeof(uint32_t));
