router_is_already_dir_fetching_ds(const dir_server_t *ds,
                                  int serverdesc,
                                  int microdesc)
{
  tor_addr_port_t ipv4_dir_ap, ipv6_dir_ap;

  /* Assume IPv6 DirPort is the same as IPv4 DirPort */
  tor_addr_from_ipv4h(&ipv4_dir_ap.addr, ds->addr);
  ipv4_dir_ap.port = ds->dir_port;
  tor_addr_copy(&ipv6_dir_ap.addr, &ds->ipv6_addr);
  ipv6_dir_ap.port = ds->dir_port;

  return (router_is_already_dir_fetching(&ipv4_dir_ap, serverdesc, microdesc)
       || router_is_already_dir_fetching(&ipv6_dir_ap, serverdesc, microdesc));
}
router_is_already_dir_fetching_ds(const dir_server_t *ds,
                                  int serverdesc,
                                  int microdesc)
{
  tor_addr_port_t ipv4_dir_ap, ipv6_dir_ap;

   
  tor_addr_from_ipv4h(&ipv4_dir_ap.addr, ds->addr);
  ipv4_dir_ap.port = ds->dir_port;
  tor_addr_copy(&ipv6_dir_ap.addr, &ds->ipv6_addr);
  ipv6_dir_ap.port = ds->dir_port;

  return (router_is_already_dir_fetching(&ipv4_dir_ap, serverdesc, microdesc)
       || router_is_already_dir_fetching(&ipv6_dir_ap, serverdesc, microdesc));
}