View | Details | Raw Unified | Return to bug 29404
Collapse All | Expand All

(-)httpd-2.2.11/modules/proxy/mod_proxy.c (+24 lines)
Line 1089 Link Here
1089
    ps->source_address = 0;
1090
    ps->source_address_set = 0;
Line 1132 Link Here
1134
    ps->source_address = (overrides->source_address_set == 0) ? base->source_address : overrides->source_address;
1135
    ps->source_address_set = overrides->source_address_set || base->source_address_set;
Line 1900 Link Here
1904
static const char *
1905
    set_source_address(cmd_parms *parms, void *dummy, const char *arg)
1906
{
1907
    proxy_server_conf *psf =
1908
    ap_get_module_config(parms->server->module_config, &proxy_module);
1909
    struct apr_sockaddr_t *addr;
1910
1911
    if (APR_SUCCESS == apr_sockaddr_info_get(&addr, arg, APR_UNSPEC, 0, 0, psf->pool)) {
1912
        psf->source_address = addr;
1913
        psf->source_address_set = 1;
1914
    }
1915
    else {
1916
        return "ProxySourceAddress invalid value";
1917
    }
1918
1919
    return NULL;
1920
}
1921
Line 2112 Link Here
2134
    AP_INIT_TAKE1("ProxySourceAddress", set_source_address, NULL, RSRC_CONF,
2135
     "Configure local source IP used for request forward"),     
(-)httpd-2.2.11/modules/proxy/mod_proxy.h (+2 lines)
Line 195 Link Here
195
    apr_sockaddr_t *source_address; /* the address the proxy client will use to make requests */
196
    char source_address_set; /* whether or not the source address is set */
(-)httpd-2.2.11/modules/proxy/mod_proxy_http.c (+1 lines)
Line 1174 Link Here
1174
    ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "header %s => %s", key, value);
(-)httpd-2.2.11/modules/proxy/proxy_util.c (-2 / +25 lines)
Line 1118 Link Here
1118
1118
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "ppr: url: %s", url);
1119
--
Line 1603 Link Here
1603
        if (conf->source_address) {
1604
            rv = apr_socket_bind(*newsock, conf->source_address);
1605
            if (rv != APR_SUCCESS) {
1606
                ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
1607
                    "proxy: %s: failed to bind socket to local address",
1608
                    proxy_function);
1609
            }
1610
        }
1611
Line 2228 Link Here
2237
    /* the local address to use for the outgoing connection */
2238
    apr_sockaddr_t *local_addr;
Line 2304 Link Here
2315
2316
        if (conf->source_address_set == 1) {
2317
            local_addr = apr_pcalloc(conn->pool, sizeof(apr_sockaddr_t));
2318
            memcpy(local_addr, conf->source_address, sizeof(apr_sockaddr_t));
2319
            local_addr->pool = conn->pool;
2320
            rv = apr_socket_bind(newsock, local_addr);
2321
            if (rv != APR_SUCCESS) {
2322
                ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
2323
                    "proxy: %s: failed to bind socket to local address", 
2324
                    proxy_function);
2325
            }
2326
        }
2327

Return to bug 29404