Klaus Demo nginx / ce4a23d
Geo: fixed handling of AF_UNIX client addresses (ticket #1684). Previously, AF_UNIX client addresses were handled as AF_INET, leading to unexpected results. Maxim Dounin 3 years ago
2 changed file(s) with 26 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
214214 break;
215215 #endif
216216
217 #if (NGX_HAVE_UNIX_DOMAIN)
218 case AF_UNIX:
219 vv = (ngx_http_variable_value_t *)
220 ngx_radix32tree_find(ctx->u.trees.tree, INADDR_NONE);
221 break;
222 #endif
223
217224 default: /* AF_INET */
218225 sin = (struct sockaddr_in *) addr.sockaddr;
219226 inaddr = ntohl(sin->sin_addr.s_addr);
273280 inaddr = INADDR_NONE;
274281 }
275282
283 break;
284 #endif
285
286 #if (NGX_HAVE_UNIX_DOMAIN)
287 case AF_UNIX:
288 inaddr = INADDR_NONE;
276289 break;
277290 #endif
278291
205205 break;
206206 #endif
207207
208 #if (NGX_HAVE_UNIX_DOMAIN)
209 case AF_UNIX:
210 vv = (ngx_stream_variable_value_t *)
211 ngx_radix32tree_find(ctx->u.trees.tree, INADDR_NONE);
212 break;
213 #endif
214
208215 default: /* AF_INET */
209216 sin = (struct sockaddr_in *) addr.sockaddr;
210217 inaddr = ntohl(sin->sin_addr.s_addr);
264271 inaddr = INADDR_NONE;
265272 }
266273
274 break;
275 #endif
276
277 #if (NGX_HAVE_UNIX_DOMAIN)
278 case AF_UNIX:
279 inaddr = INADDR_NONE;
267280 break;
268281 #endif
269282