mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-11 01:26:58 +02:00
BUG/MINOR: http: fix "set-tos" not working in certain configurations
s->req->prod->conn->addr.to.ss_family contains only useful data if conn_get_to_addr() is called early. If thats not the case (nothing in the configuration needs the destination address like logs, transparent, ...) then "set-tos" doesn't work. Fix this by checking s->req->prod->conn->addr.from.ss_family instead. Also fix a minor doc issue about set-tos in http-response.
This commit is contained in:
parent
dc13c11c1e
commit
2dd1d1a93f
@ -2803,7 +2803,8 @@ http-request { allow | deny | tarpit | auth [realm <realm>] | redirect <rule> |
|
|||||||
|
|
||||||
http-response { allow | deny | add-header <name> <fmt> | set-nice <nice> |
|
http-response { allow | deny | add-header <name> <fmt> | set-nice <nice> |
|
||||||
set-header <name> <fmt> | set-log-level <level> |
|
set-header <name> <fmt> | set-log-level <level> |
|
||||||
set-mark <mark> } [ { if | unless } <condition> ]
|
set-mark <mark> | set-tos <tos> }
|
||||||
|
[ { if | unless } <condition> ]
|
||||||
Access control for Layer 7 responses
|
Access control for Layer 7 responses
|
||||||
|
|
||||||
May be used in sections: defaults | frontend | listen | backend
|
May be used in sections: defaults | frontend | listen | backend
|
||||||
|
@ -3213,7 +3213,7 @@ http_req_get_intercept_rule(struct proxy *px, struct list *rules, struct session
|
|||||||
|
|
||||||
case HTTP_REQ_ACT_SET_TOS:
|
case HTTP_REQ_ACT_SET_TOS:
|
||||||
#ifdef IP_TOS
|
#ifdef IP_TOS
|
||||||
if (s->req->prod->conn->addr.to.ss_family == AF_INET)
|
if (s->req->prod->conn->addr.from.ss_family == AF_INET)
|
||||||
setsockopt(s->req->prod->conn->t.sock.fd, IPPROTO_IP, IP_TOS, &rule->arg.tos, sizeof(rule->arg.tos));
|
setsockopt(s->req->prod->conn->t.sock.fd, IPPROTO_IP, IP_TOS, &rule->arg.tos, sizeof(rule->arg.tos));
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -3299,7 +3299,7 @@ http_res_get_intercept_rule(struct proxy *px, struct list *rules, struct session
|
|||||||
|
|
||||||
case HTTP_RES_ACT_SET_TOS:
|
case HTTP_RES_ACT_SET_TOS:
|
||||||
#ifdef IP_TOS
|
#ifdef IP_TOS
|
||||||
if (s->req->prod->conn->addr.to.ss_family == AF_INET)
|
if (s->req->prod->conn->addr.from.ss_family == AF_INET)
|
||||||
setsockopt(s->req->prod->conn->t.sock.fd, IPPROTO_IP, IP_TOS, &rule->arg.tos, sizeof(rule->arg.tos));
|
setsockopt(s->req->prod->conn->t.sock.fd, IPPROTO_IP, IP_TOS, &rule->arg.tos, sizeof(rule->arg.tos));
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user