Sorin, thank you.  I now have a small chunk of code that appears to do the job. 
 I do not have access to an IPv6 system to test with but it does identify the 
connection type correctly on my IPv4 system.

I am not sure what APR_UNIX is, but it is referenced in the Apache source.



/* ======================================================== */
/*     Testing code prefatory to including IPv6 support     */
/*                           BEGINS                         */
/* ======================================================== */

  switch(r->useragent_addr->family) {

    case APR_INET6:
      ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r,
                " Family %d - IPv6", r->useragent_addr->family);
      break;

    case APR_INET:
      ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r,
                " Family %d - IPv4", r->useragent_addr->family);
      break;

    case APR_UNIX:
      ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r,
                " Family %d - Unix", r->useragent_addr->family);
      break;

    default:
      ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r,
                "  Family %d - Unknown", r->useragent_addr->family);
      break;
  }

/* ======================================================== */
/*     Testing code prefatory to including IPv6 support     */
/*                            ENDS                          */
/* ======================================================== */

Reply via email to