Exemple #1
0
static void update_has_gateway_fields(void) {
    struct ip_prefix_list *h;

    olsr_cnf->has_ipv4_gateway = false;
    olsr_cnf->has_ipv6_gateway = false;

    for (h = olsr_cnf->hna_entries; h != NULL; h = h->next) {
        olsr_cnf->has_ipv4_gateway |= ip_prefix_is_v4_inetgw(&h->net) || ip_prefix_is_mappedv4_inetgw(&h->net);
        olsr_cnf->has_ipv6_gateway |= ip_prefix_is_v6_inetgw(&h->net);
    }
}
Exemple #2
0
bool is_prefix_inetgw(const struct olsr_ip_prefix *prefix) {
  if (olsr_cnf->ip_version == AF_INET && ip_prefix_is_v4_inetgw(prefix)) {
    return true;
  }
  if (olsr_cnf->ip_version == AF_INET6) {
    if (ip_prefix_is_v6_inetgw(prefix) || ip_prefix_is_mappedv4_inetgw(prefix)) {
      return true;
    }
  }
  return false;
}