Index: modules/metadata/mod_remoteip.c =================================================================== --- modules/metadata/mod_remoteip.c (revision 1885775) +++ modules/metadata/mod_remoteip.c (working copy) @@ -145,6 +145,8 @@ apr_sockaddr_t *client_addr; /** Character representation of the client */ char *client_ip; + /** Non-zero if this is a LOCAL connection, not proxied. */ + int is_local; } remoteip_conn_config_t; typedef enum { HDR_DONE, HDR_ERROR, HDR_NEED_MORE } remoteip_parse_status_t; @@ -544,11 +546,17 @@ if (!config->header_name && !conn_config) { return DECLINED; } - + /* Easy parsing case - just position the data we already have from PROXY protocol handling allowing it to take precedence and return */ if (conn_config) { + /* Nothing further to do for a LOCAL connection (direct connection + * from a proxy). */ + if (conn_config->is_local) { + return DECLINED; + } + if (!conn_config->client_addr) { ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(03496) "RemoteIPProxyProtocol data is missing, but required! Aborting request."); @@ -950,6 +958,7 @@ switch (hdr->v2.ver_cmd & 0xF) { case 0x00: /* LOCAL command */ /* keep local connection address for LOCAL */ + conn_conf->is_local = 1; return HDR_DONE; case 0x01: /* PROXY command */ switch (hdr->v2.fam) {