#define PR_O2_COOK_PSV 0x08000000 /* cookie ... preserve */
#define PR_O2_PGSQL_CHK 0x10000000 /* use PGSQL check for server health */
+#define PR_O2_DISPATCH 0x20000000 /* use dispatch mode */
/* end of proxy->options2 */
/* bits for sticking rules */
goto out;
}
}
- else if (!*(int *)&s->be->dispatch_addr.sin_addr &&
- !(s->be->options & PR_O_TRANSP)) {
+ else if (!(s->be->options2 & PR_O2_DISPATCH) && !(s->be->options & PR_O_TRANSP)) {
err = SRV_STATUS_NOSRV;
goto out;
}
}
}
}
- else if (*(int *)&s->be->dispatch_addr.sin_addr) {
+ else if (s->be->options2 & PR_O2_DISPATCH) {
/* connect to the defined dispatch addr */
s->req->cons->addr.s.to = s->be->dispatch_addr;
}
goto out;
}
curproxy->dispatch_addr = *sk;
+ curproxy->options2 |= PR_O2_DISPATCH;
}
else if (!strcmp(args[0], "balance")) { /* set balancing with optional algorithm */
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
cfgerr++;
}
#endif
- else if (*(int *)&curproxy->dispatch_addr.sin_addr != 0) {
+ else if (curproxy->options2 & PR_O2_DISPATCH) {
Warning("config : dispatch address of %s '%s' will be ignored in balance mode.\n",
proxy_type_str(curproxy), curproxy->id);
err_code |= ERR_WARN;
}
}
else if (!(curproxy->options & (PR_O_TRANSP | PR_O_HTTP_PROXY)) &&
- (*(int *)&curproxy->dispatch_addr.sin_addr == 0)) {
+ !(curproxy->options2 & PR_O2_DISPATCH)) {
/* If no LB algo is set in a backend, and we're not in
* transparent mode, dispatch mode nor proxy mode, we
* want to use balance roundrobin by default.