* keepalived-0.5.8 released.
* Added an OpenSSL Licence exception to grant Keepalived compilation
with OpenSSL Toolkit.
Thanks to Andres Salomon, <dilinger@voxel.net> for suggesting.
* Added connection port selection for Healthcheckers (TCP_CHECK,
HTTP|SSL_GET). Can be usefull for Healthcheck in fwmark LVS topology
for grouping service.
Thanks to Richard L. Allbery, <rla@prideindustries.com> for suggesting.
See samples directory for examples.
* Fixed some IPVS exclusion code when running --disable-lvs.
* Added support to VirtualHost selection when using HTTP|SSL_GET.
See samples directory for examples.
* Added VirtualHost selection into the genhash utility.
* Fixed some IPVS sync daemon initializations issues.
* Cometics patches in IPVS wrapper framework.
* Added support to quoted string. This can be usefull if you are using
MISC_CHECK and you want to pass arguments to called script. See samples.
Thanks to Benoit Gaussen, <ben@trez42.net> for suggesting.
* Prepare work on real_server_group in order to group some realserver
declaration.
* VRRP : Fixed a password length exception causing an unwanted dropping
issue.
* VRRP : Enhanced the MASTER state to send gratuitous arp if receiving
a remote lower prio advert => This fix a remote stalled ARP cache.
Thanks to Simon Kirby, <sim@netnation.com> for discussing this case.
--- /dev/null
+/*
+ * Soft: Keepalived is a failover program for the LVS project
+ * <www.linuxvirtualserver.org>. It monitor & manipulate
+ * a loadbalanced server pool using multi-layer checks.
+ *
+ * Part: Dynamic data structure definition.
+ *
+ * Version: $Id: data.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
+ *
+ * Author: Alexandre Cassen, <acassen@linux-vs.org>
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include "data.h"
+#include "memory.h"
+#include "utils.h"
+#include "check_api.h"
+#include "vrrp.h"
+
+extern data *conf_data;
+
+/* email facility functions */
+static void free_email(void *data)
+{
+ FREE(data);
+}
+static void dump_email(void *data)
+{
+ char *addr = data;
+ syslog(LOG_INFO, " Email notification = %s", addr);
+}
+void alloc_email(char *addr)
+{
+ int size = strlen(addr);
+ char *new;
+
+ new = (char *)MALLOC(size+1);
+ memcpy(new, addr, size);
+
+ list_add(conf_data->email, new);
+}
+
+/* SSL facility functions */
+SSL_DATA *alloc_ssl(void)
+{
+ SSL_DATA *ssl = (SSL_DATA *)MALLOC(sizeof(SSL_DATA));
+ return ssl;
+}
+static void free_ssl(void)
+{
+ SSL_DATA *ssl = conf_data->ssl;
+
+ if (!ssl) return;
+ FREE_PTR(ssl->password);
+ FREE_PTR(ssl->cafile);
+ FREE_PTR(ssl->certfile);
+ FREE_PTR(ssl->keyfile);
+ FREE(ssl);
+}
+static void dump_ssl(void)
+{
+ SSL_DATA *ssl = conf_data->ssl;
+
+ if (ssl->password)
+ syslog(LOG_INFO, " Password : %s", ssl->password);
+ if (ssl->cafile)
+ syslog(LOG_INFO, " CA-file : %s", ssl->cafile);
+ if (ssl->certfile)
+ syslog(LOG_INFO, " Certificate file : %s", ssl->certfile);
+ if (ssl->keyfile)
+ syslog(LOG_INFO, " Key file : %s", ssl->keyfile);
+ if (!ssl->password && !ssl->cafile && !ssl->certfile && !ssl->keyfile)
+ syslog(LOG_INFO, " Using autogen SSL context");
+}
+
+/* VRRP facility functions */
+static void free_vrrp(void *data)
+{
+ vrrp_rt *vrrp = data;
+
+ FREE(vrrp->iname);
+ FREE_PTR(vrrp->isync);
+ FREE_PTR(vrrp->lvs_syncd_if);
+ FREE_PTR(vrrp->vaddr);
+ FREE(vrrp->ipsecah_counter);
+ FREE(vrrp);
+}
+static void dump_vrrp(void *data)
+{
+ vrrp_rt *vrrp = data;
+ int i;
+
+ syslog(LOG_INFO, " VRRP Instance = %s", vrrp->iname);
+ if (vrrp->isync)
+ syslog(LOG_INFO, " Sync with instance = %s", vrrp->isync);
+ if (vrrp->init_state == VRRP_STATE_BACK)
+ syslog(LOG_INFO, " Want State = BACKUP");
+ else
+ syslog(LOG_INFO, " Want State = MASTER");
+ syslog(LOG_INFO, " Runing on device = %s", IF_NAME(vrrp->ifp));
+ if (vrrp->lvs_syncd_if)
+ syslog(LOG_INFO, " Runing LVS sync daemon on interface = %s"
+ , vrrp->lvs_syncd_if);
+ syslog(LOG_INFO, " Virtual Router ID = %d", vrrp->vrid);
+ syslog(LOG_INFO, " Priority = %d", vrrp->priority);
+ syslog(LOG_INFO, " Advert interval = %dsec", vrrp->adver_int/TIMER_HZ);
+ if (vrrp->preempt)
+ syslog(LOG_INFO, " Preempt Active");
+ if (vrrp->auth_type) {
+ syslog(LOG_INFO, " Authentication type = %s",
+ (vrrp->auth_type == VRRP_AUTH_AH)?"IPSEC_AH":"SIMPLE_PASSWORD" );
+ syslog(LOG_INFO, " Password = %s", vrrp->auth_data);
+ }
+ syslog(LOG_INFO, " VIP count = %d", vrrp->naddr);
+ for (i = 0; i < vrrp->naddr; i++)
+ syslog(LOG_INFO, " VIP%d = %s", i+1, ip_ntoa(vrrp->vaddr[i].addr));
+ if (vrrp->notify_exec)
+ syslog(LOG_INFO, " Using notification script = %s"
+ , vrrp->notify_file);
+ if (vrrp->smtp_alert)
+ syslog(LOG_INFO, " Using smtp notification");
+}
+void alloc_vrrp(char *iname)
+{
+ int size = strlen(iname);
+ seq_counter *counter;
+ vrrp_rt *new;
+
+ /* Allocate new VRRP structure */
+ new = (vrrp_rt *) MALLOC(sizeof(vrrp_rt));
+ counter = (seq_counter *) MALLOC(sizeof(seq_counter));
+
+ /* Build the structure */
+ new->ipsecah_counter = counter;
+
+ /* Set default values */
+ new->wantstate = VRRP_STATE_BACK;
+ new->init_state = VRRP_STATE_BACK;
+ new->adver_int = TIMER_HZ;
+ new->iname = (char *)MALLOC(size+1);
+ memcpy(new->iname, iname, size);
+
+ list_add(conf_data->vrrp, new);
+}
+void alloc_vrrp_vip(char *vip)
+{
+ vrrp_rt *vrrp = LIST_TAIL_DATA(conf_data->vrrp);
+ uint32_t ipaddr = inet_addr(vip);
+
+ vrrp->naddr++;
+ if (vrrp->vaddr)
+ vrrp->vaddr = REALLOC(vrrp->vaddr, vrrp->naddr*sizeof(*vrrp->vaddr));
+ else
+ vrrp->vaddr = (vip_addr *)MALLOC(sizeof(*vrrp->vaddr));
+ vrrp->vaddr[vrrp->naddr-1].addr = ipaddr;
+ vrrp->vaddr[vrrp->naddr-1].set = 0;
+}
+
+/* Virtual server facility functions */
+static void free_vs(void *data)
+{
+ virtual_server *vs = data;
+ FREE_PTR(vs->virtualhost);
+ FREE_PTR(vs->s_svr);
+ if (!LIST_ISEMPTY(vs->rs))
+ free_list(vs->rs);
+ FREE(vs);
+}
+static void dump_vs(void *data)
+{
+ virtual_server *vs = data;
+
+ if (vs->vfwmark)
+ syslog(LOG_INFO, " VS FWMARK = %d", vs->vfwmark);
+ else
+ syslog(LOG_INFO, " VIP = %s, VPORT = %d"
+ , ip_ntoa(SVR_IP(vs))
+ , ntohs(SVR_PORT(vs)));
+ if (vs->virtualhost)
+ syslog(LOG_INFO, " VirtualHost = %s", vs->virtualhost);
+ syslog(LOG_INFO, " delay_loop = %d, lb_algo = %s"
+ , vs->delay_loop
+ , vs->sched);
+ if (atoi(vs->timeout_persistence) > 0)
+ syslog(LOG_INFO, " persistence timeout = %s"
+ , vs->timeout_persistence);
+ if (vs->granularity_persistence)
+ syslog(LOG_INFO, " persistence granularity = %s"
+ , ip_ntoa(vs->granularity_persistence));
+ syslog(LOG_INFO, " protocol = %s"
+ , (vs->service_type == IPPROTO_TCP)?"TCP":"UDP");
+
+ switch (vs->loadbalancing_kind) {
+#ifdef _WITH_LVS_
+#ifdef _KRNL_2_2_
+ case 0:
+ syslog(LOG_INFO, " lb_kind = NAT");
+ syslog(LOG_INFO, " nat mask = %s", ip_ntoa(vs->nat_mask));
+ break;
+ case IP_MASQ_F_VS_DROUTE:
+ syslog(LOG_INFO, " lb_kind = DR");
+ break;
+ case IP_MASQ_F_VS_TUNNEL:
+ syslog(LOG_INFO, " lb_kind = TUN");
+ break;
+#else
+ case IP_VS_CONN_F_MASQ:
+ syslog(LOG_INFO, " lb_kind = NAT");
+ break;
+ case IP_VS_CONN_F_DROUTE:
+ syslog(LOG_INFO, " lb_kind = DR");
+ break;
+ case IP_VS_CONN_F_TUNNEL:
+ syslog(LOG_INFO, " lb_kind = TUN");
+ break;
+#endif
+#endif
+ }
+
+ if (vs->s_svr) {
+ syslog(LOG_INFO, " sorry server = %s:%d"
+ , ip_ntoa(SVR_IP(vs->s_svr))
+ , ntohs(SVR_PORT(vs->s_svr)));
+ }
+ if (!LIST_ISEMPTY(vs->rs))
+ dump_list(vs->rs);
+}
+void alloc_vs(char *ip, char *port)
+{
+ virtual_server *new;
+
+ new = (virtual_server *)MALLOC(sizeof(virtual_server));
+
+ if (!strcmp(ip, "fwmark")) {
+ new->vfwmark = atoi(port);
+ } else {
+ new->addr_ip = inet_addr(ip);
+ new->addr_port = htons(atoi(port));
+ }
+ new->delay_loop = KEEPALIVED_DEFAULT_DELAY;
+ strncpy(new->timeout_persistence, "0", 1);
+ new->virtualhost = NULL;
+
+ list_add(conf_data->vs, new);
+}
+
+/* Sorry server facility functions */
+void alloc_ssvr(char *ip, char *port)
+{
+ virtual_server *vs = LIST_TAIL_DATA(conf_data->vs);
+
+ vs->s_svr = (real_server *)MALLOC(sizeof(real_server));
+ vs->s_svr->weight = 1;
+ vs->s_svr->addr_ip = inet_addr(ip);
+ vs->s_svr->addr_port = htons(atoi(port));
+}
+
+/* Real server facility functions */
+static void free_rs(void *data)
+{
+ real_server *rs = data;
+ FREE(rs);
+}
+static void dump_rs(void *data)
+{
+ real_server *rs = data;
+ syslog(LOG_INFO, " RIP = %s, RPORT = %d, WEIGHT = %d"
+ , ip_ntoa(SVR_IP(rs))
+ , ntohs(SVR_PORT(rs))
+ , rs->weight);
+}
+void alloc_rs(char *ip, char *port)
+{
+ virtual_server *vs = LIST_TAIL_DATA(conf_data->vs);
+ real_server *new;
+
+ new = (real_server *)MALLOC(sizeof(real_server));
+
+ new->addr_ip = inet_addr(ip);
+ new->addr_port = htons(atoi(port));
+ new->alive = 1;
+
+ if (LIST_ISEMPTY(vs->rs))
+ vs->rs = alloc_list(free_rs, dump_rs);
+ list_add(vs->rs, new);
+ vs->last_rs_type = RS;
+}
+
+/* data facility functions */
+data *alloc_data(void)
+{
+ data *new;
+
+ new = (data *)MALLOC(sizeof(data));
+ new->email = alloc_list(free_email, dump_email);
+ new->vrrp = alloc_list(free_vrrp, dump_vrrp);
+ new->vs = alloc_list(free_vs, dump_vs);
+
+ return new;
+}
+void free_data(void)
+{
+ free_ssl();
+ free_list(conf_data->email);
+ free_list(conf_data->vrrp);
+ free_list(conf_data->vs);
+
+ FREE_PTR(conf_data->lvs_id);
+ FREE_PTR(conf_data->email_from);
+ FREE(conf_data);
+}
+void dump_data(void)
+{
+ if (conf_data->lvs_id ||
+ conf_data->smtp_server ||
+ conf_data->smtp_connection_to ||
+ conf_data->email_from) {
+ syslog(LOG_INFO, "------< Global definitions >------");
+ }
+ if (conf_data->lvs_id)
+ syslog(LOG_INFO, " LVS ID = %s", conf_data->lvs_id);
+ if (conf_data->smtp_server)
+ syslog(LOG_INFO, " Smtp server = %s", ip_ntoa(conf_data->smtp_server));
+ if (conf_data->smtp_connection_to)
+ syslog(LOG_INFO, " Smtp server connection timeout = %d"
+ , conf_data->smtp_connection_to);
+ if (conf_data->email_from) {
+ syslog(LOG_INFO, " Email notification from = %s"
+ , conf_data->email_from);
+ dump_list(conf_data->email);
+ }
+ if (conf_data->ssl) {
+ syslog(LOG_INFO, "------< SSL definitions >------");
+ dump_ssl();
+ }
+ if (!LIST_ISEMPTY(conf_data->vrrp)) {
+ syslog(LOG_INFO, "------< VRRP Topology >------");
+ dump_list(conf_data->vrrp);
+ }
+#ifdef _WITH_LVS_
+ if (!LIST_ISEMPTY(conf_data->vs)) {
+ syslog(LOG_INFO, "------< LVS Topology >------");
+ syslog(LOG_INFO, " System is compiled with LVS v%d.%d.%d"
+ , NVERSION(IP_VS_VERSION_CODE));
+ dump_list(conf_data->vs);
+ }
+ dump_checkers_queue();
+#endif
+}
+2002-05-21 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-0.5.8 released.
+ * Added an OpenSSL Licence exception to grant Keepalived compilation
+ with OpenSSL Toolkit.
+ Thanks to Andres Salomon, <dilinger@voxel.net> for suggesting.
+ * Added connection port selection for Healthcheckers (TCP_CHECK,
+ HTTP|SSL_GET). Can be usefull for Healthcheck in fwmark LVS topology
+ for grouping service.
+ Thanks to Richard L. Allbery, <rla@prideindustries.com> for suggesting.
+ See samples directory for examples.
+ * Fixed some IPVS exclusion code when running --disable-lvs.
+ * Added support to VirtualHost selection when using HTTP|SSL_GET.
+ See samples directory for examples.
+ * Added VirtualHost selection into the genhash utility.
+ * Fixed some IPVS sync daemon initializations issues.
+ * Cometics patches in IPVS wrapper framework.
+ * Added support to quoted string. This can be usefull if you are using
+ MISC_CHECK and you want to pass arguments to called script. See samples.
+ Thanks to Benoit Gaussen, <ben@trez42.net> for suggesting.
+ * Prepare work on real_server_group in order to group some realserver
+ declaration.
+ * VRRP : Fixed a password length exception causing an unwanted dropping
+ issue.
+ * VRRP : Enhanced the MASTER state to send gratuitous arp if receiving
+ a remote lower prio advert => This fix a remote stalled ARP cache.
+ Thanks to Simon Kirby, <sim@netnation.com> for discussing this case.
+
2002-05-02 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-0.5.7 released.
* Review autoconf/automake scripts to be more generic on system and code
multiplexer.
Keepalived is free software. See the file COPYING for copying conditions.
+
+
+OPENSSL TOOLKIT LICENCE EXCEPTION
+
+In addition, as the copyright holder of Keepalived,
+I, Alexandre Cassen, <acassen@linux-vs.org>,
+grant the following special exception:
+
+ I, Alexandre Cassen, <acassen@linux-vs.org>, explicitly allow
+ the compilation and distribution of the Keepalived software with
+ the OpenSSL Toolkit.
+
*
* Part: Checkers registration.
*
- * Version: $Id: check_api.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_api.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Checkers arguments structures definitions.
*
- * Version: $Id: check_api.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_api.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#define CHECKER_VALUE_STRING(X) (set_value(X))
#define CHECKER_RIP(C) (SVR_IP((C)->rs))
#define CHECKER_RPORT(C) (SVR_PORT((C)->rs))
+#define CHECKER_VHOST(C) (VHOST((C)->vs))
/* Prototypes definition */
extern void init_checkers_queue(void);
*
* Part: WEB CHECK. Common HTTP/SSL checker primitives.
*
- * Version: $Id: check_http.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_http.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
syslog(LOG_INFO, " Keepalive method = HTTP_GET");
else
syslog(LOG_INFO, " Keepalive method = SSL_GET");
+ if (http_get_chk->connection_port)
+ syslog(LOG_INFO, " Connection port = %d"
+ , ntohs(http_get_chk->connection_port));
syslog(LOG_INFO, " Connection timeout = %d" , http_get_chk->connection_to);
syslog(LOG_INFO, " Nb get retry = %d" , http_get_chk->nb_get_retry);
syslog(LOG_INFO, " Delay before retry = %d"
, http_get_chk->delay_before_retry);
dump_list(http_get_chk->url);
}
-void http_get_handler(vector strvec)
+static http_get_checker *alloc_http_get(char *proto)
{
http_get_checker *http_get_chk;
- char *str = VECTOR_SLOT(strvec, 0);
http_get_chk = (http_get_checker *)MALLOC(sizeof(http_get_checker));
http_get_chk->arg = (http_arg *)MALLOC(sizeof(http_arg));
- http_get_chk->proto = (!strcmp(str, "HTTP_GET"))?PROTO_HTTP:PROTO_SSL;
+ http_get_chk->proto = (!strcmp(proto, "HTTP_GET"))?PROTO_HTTP:PROTO_SSL;
http_get_chk->url = alloc_list(free_url, dump_url);
+ return http_get_chk;
+}
+
+void http_get_handler(vector strvec)
+{
+ http_get_checker *http_get_chk;
+ char *str = VECTOR_SLOT(strvec, 0);
+
/* queue new checker */
+ http_get_chk = alloc_http_get(str);
queue_checker(free_http_get_check, dump_http_get_check
, http_connect_thread
, http_get_chk);
}
+void connect_p_handler(vector strvec)
+{
+ http_get_checker *http_get_chk = CHECKER_GET();
+ http_get_chk->connection_port = htons(CHECKER_VALUE_INT(strvec));
+}
void connect_to_handler(vector strvec)
{
http_get_checker *http_get_chk = CHECKER_GET();
{
install_keyword("HTTP_GET", &http_get_handler);
install_sublevel();
+ install_keyword("connect_port", &connect_p_handler);
install_keyword("connect_timeout", &connect_to_handler);
install_keyword("nb_get_retry", &nb_get_retry_handler);
install_keyword("delay_before_retry", &delay_before_retry_handler);
{
install_keyword("SSL_GET", &http_get_handler);
install_sublevel();
+ install_keyword("connect_port", &connect_p_handler);
install_keyword("connect_timeout", &connect_to_handler);
install_keyword("nb_get_retry", &nb_get_retry_handler);
install_keyword("delay_before_retry", &delay_before_retry_handler);
* http_handle_response (next checker thread registration)
*/
+uint16_t get_service_port(checker *checker)
+{
+ http_get_checker *http_get_check = CHECKER_ARG(checker);
+ uint16_t addr_port;
+
+ /*
+ * Set the remote connection port.
+ * If a specific checker port is specified, we used this.
+ * If we are balancing all services (host rather than service),
+ * then assume we want to use default ports for HTTP or HTTPS.
+ * Known as 'Layer3 stickyness'.
+ */
+ addr_port = CHECKER_RPORT(checker);
+ if (!addr_port)
+ addr_port = htons((http_get_check->proto == PROTO_SSL)?443:80);
+ if (http_get_check->connection_port)
+ addr_port = http_get_check->connection_port;
+ return addr_port;
+}
+
/*
* Simple epilog functions. Handling event timeout.
* Finish the checker with memory managment or url rety check.
checker *checker = THREAD_ARG(thread);
http_get_checker *http_get_check = CHECKER_ARG(checker);
http_arg *http_arg = HTTP_ARG(http_get_check);
+#ifdef _DEBUG_
+ uint16_t addr_port = get_service_port(checker);
+#endif
/*
* The get retry implementation mean that we retry performing
syslog(LOG_DEBUG, "Retry %s server [%s:%d] after %d retry."
, debug_msg
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker))
+ , ntohs(addr_port)
, http_arg->retry_it - 1);
#endif
return epilog(thread,2,0,1);
syslog(LOG_DEBUG, "Timeout %s server [%s:%d]."
, debug_msg
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
#endif
/* check if server is currently alive */
if (ISALIVE(checker->rs)) {
checker *checker = THREAD_ARG(thread);
http_get_checker *http_get_check = CHECKER_ARG(checker);
#ifdef _DEBUG_
+ uint16_t addr_port = get_service_port(checker);
http_arg *http_arg = HTTP_ARG(http_get_check);
#endif
int r, di = 0;
#ifdef _DEBUG_
syslog(LOG_DEBUG, "MD5SUM to [%s:%d] url(%d) = [%s]."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker))
+ , ntohs(addr_port)
, http_arg->url_it + 1
, digest_tmp);
#endif
syslog(LOG_DEBUG, "MD5 digest error to [%s:%d] url(%d)"
", expecting MD5SUM [%s]."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker))
+ , ntohs(addr_port)
, http_arg->url_it + 1
, fetched_url->digest);
#endif
#ifdef _DEBUG_
syslog(LOG_DEBUG, "MD5 digest success to [%s:%d] url(%d)."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker))
+ , ntohs(addr_port)
, http_arg->url_it + 1);
#endif
return epilog(thread,1,1,0)+1;
http_get_checker *http_get_check = CHECKER_ARG(checker);
http_arg *http_arg = HTTP_ARG(http_get_check);
REQ *req = HTTP_REQ(http_arg);
+#ifdef _DEBUG_
+ uint16_t addr_port = get_service_port(checker);
+#endif
unsigned char digest[16];
int r = 0;
#ifdef _DEBUG_
syslog(LOG_DEBUG, "Read error with server [%s:%d]: %s"
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker))
+ , ntohs(addr_port)
, strerror(errno));
#endif
if (ISALIVE(checker->rs)) {
http_get_checker *http_get_check = CHECKER_ARG(checker);
http_arg *http_arg = HTTP_ARG(http_get_check);
REQ *req = HTTP_REQ(http_arg);
+ uint16_t addr_port = get_service_port(checker);
+ char *vhost = CHECKER_VHOST(checker);
char *str_request;
url *fetched_url;
int ret = 0;
str_request = (char *)MALLOC(GET_REQUEST_BUFFER_LENGTH);
fetched_url = fetch_next_url(http_get_check);
-
snprintf(str_request, GET_REQUEST_BUFFER_LENGTH
, REQUEST_TEMPLATE
, fetched_url->path
- , ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
-
+ , (vhost)?vhost:ip_ntoa(CHECKER_RIP(checker))
+ , ntohs(addr_port));
#ifdef _DEBUG_
syslog(LOG_DEBUG, "Processing url(%d) of [%s:%d]."
, http_arg->url_it + 1
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
#endif
/* Send the GET request to remote Web server */
if (!ret) {
syslog(LOG_INFO, "Cannot send get request to [%s:%d]."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
/* check if server is currently alive */
if (ISALIVE(checker->rs)) {
{
checker *checker = THREAD_ARG(thread);
http_get_checker *http_get_check = CHECKER_ARG(checker);
+ uint16_t addr_port = get_service_port(checker);
#ifdef _DEBUG_
http_arg *http_arg = HTTP_ARG(http_get_check);
REQ *req = HTTP_REQ(http_arg);
status = tcp_socket_state(thread->u.fd, thread
, CHECKER_RIP(checker)
- , CHECKER_RPORT(checker)
+ , addr_port
, http_check_thread);
switch (status) {
case connect_error:
#ifdef _DEBUG_
syslog(LOG_DEBUG, "Error connecting server [%s:%d]."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
#endif
/* check if server is currently alive */
if (ISALIVE(checker->rs)) {
#ifdef _DEBUG_
syslog(LOG_DEBUG, "Remote Web server [%s:%d] connected."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
#endif
thread_add_write(thread->master, http_request_thread
, checker
#ifdef _DEBUG_
syslog(LOG_DEBUG, "Connection trouble to: [%s:%d]."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
if (http_get_check->proto == PROTO_SSL)
ssl_printerr(SSL_get_error(req->ssl, ret));
#endif
checker *checker = THREAD_ARG(thread);
http_get_checker *http_get_check = CHECKER_ARG(checker);
http_arg *http_arg = HTTP_ARG(http_get_check);
+ uint16_t addr_port = get_service_port(checker);
url *fetched_url;
enum connect_result status;
- uint16_t addr_port;
int fd;
/* Find eventual url end */
#ifdef _DEBUG_
syslog(LOG_DEBUG, "Remote Web server [%s:%d] succeed on service."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
#endif
}
http_arg->req = NULL;
return 0;
}
- /*
- * Set the remote connection port.
- * If we are balancing all services (host rather than service),
- * then assume we want to use default ports for HTTP or HTTPS.
- * Known as 'Layer3 stickyness'
- */
- addr_port = CHECKER_RPORT(checker);
- if (!addr_port)
- addr_port = htons((http_get_check->proto == PROTO_SSL)?443:80);
-
status = tcp_connect(fd, CHECKER_RIP(checker), addr_port);
/* handle tcp connection status & register check worker thread */
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_http.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
} url;
typedef struct _http_get_checker {
int proto;
+ uint16_t connection_port;
int connection_to;
int nb_get_retry;
int delay_before_retry;
#define REQUEST_TEMPLATE "GET %s HTTP/1.0\r\n" \
"User-Agent:KeepAliveClient\r\n" \
"Host: %s:%d\r\n\r\n"
-
/* macro utility */
#define HTTP_ARG(X) ((X)->arg)
#define HTTP_REQ(X) ((X)->req)
* Part: MISC CHECK. Perform a system call to run an extra
* system prog or script.
*
- * Version: $Id: check_misc.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_misc.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
*
* Part: check_misc.c include file.
*
- * Version: $Id: check_misc.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_misc.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
* url, compute a MD5 over this result and match it to the
* expected value.
*
- * Version: $Id: check_ssl.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_ssl.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_http.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: TCP checker.
*
- * Version: $Id: check_tcp.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_tcp.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
tcp_checker *tcp_chk = CHECKER_DATA(data);
syslog(LOG_INFO, " Keepalive method = TCP_CHECK");
+ if (tcp_chk->connection_port)
+ syslog(LOG_INFO, " Connection port = %d"
+ , ntohs(tcp_chk->connection_port));
syslog(LOG_INFO, " Connection timeout = %d"
, tcp_chk->connection_to);
}
, tcp_connect_thread
, tcp_chk);
}
+void connect_port_handler(vector strvec)
+{
+ tcp_checker *tcp_chk = CHECKER_GET();
+ tcp_chk->connection_port = htons(CHECKER_VALUE_INT(strvec));
+}
void connect_timeout_handler(vector strvec)
{
tcp_checker *tcp_chk = CHECKER_GET();
{
install_keyword("TCP_CHECK", &tcp_check_handler);
install_sublevel();
+ install_keyword("connect_port", &connect_port_handler);
install_keyword("connect_timeout", &connect_timeout_handler);
install_sublevel_end();
}
int tcp_check_thread(thread *thread)
{
checker *checker;
+ tcp_checker *tcp_check;
+ uint16_t addr_port;
int status;
checker = THREAD_ARG(thread);
+ tcp_check = CHECKER_ARG(checker);
+ addr_port = CHECKER_RPORT(checker);
+ if (tcp_check->connection_port)
+ addr_port = tcp_check->connection_port;
status = tcp_socket_state(thread->u.fd, thread
, CHECKER_RIP(checker)
- , CHECKER_RPORT(checker)
+ , addr_port
, tcp_check_thread);
/* If status = connect_success, TCP connection to remote host is established.
#ifdef _DEBUG_
syslog(LOG_DEBUG, "TCP connection to [%s:%d] success."
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
#endif
close(thread->u.fd);
#ifdef _DEBUG_
syslog(LOG_DEBUG, "TCP connection to [%s:%d] failed !!!"
, ip_ntoa(CHECKER_RIP(checker))
- , ntohs(CHECKER_RPORT(checker)));
+ , ntohs(addr_port));
#endif
if (ISALIVE(checker->rs)) {
checker *checker;
tcp_checker *tcp_check;
int fd;
+ uint16_t addr_port;
int status;
checker = THREAD_ARG(thread);
return 0;
}
- status = tcp_connect(fd, CHECKER_RIP(checker)
- , CHECKER_RPORT(checker));
+ addr_port = CHECKER_RPORT(checker);
+ if (tcp_check->connection_port)
+ addr_port = tcp_check->connection_port;
+ status = tcp_connect(fd, CHECKER_RIP(checker), addr_port);
/* handle tcp connection status & register check worker thread */
tcp_connection_state(fd, status, thread
*
* Part: check_tcp.c include file.
*
- * Version: $Id: check_tcp.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: check_tcp.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
/* Checker argument structure */
typedef struct _tcp_checker {
+ uint16_t connection_port;
int connection_to;
} tcp_checker;
Keepalived version : ${VERSION}
Compiler : ${CC}
Compiler flags : ${CFLAGS}
-Compiler flags : ${CFLAGS}
Linux Kernel release : ${KERNEL_VERSION}
Startup scripts location : ${SYSTEM_SCRIPT_DIR}
EOF
Keepalived version : ${VERSION}
Compiler : ${CC}
Compiler flags : ${CFLAGS}
-Compiler flags : ${CFLAGS}
Linux Kernel release : ${KERNEL_VERSION}
Startup scripts location : ${SYSTEM_SCRIPT_DIR}
EOF
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: main.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Daemon process handling.
*
- * Version: $Id: daemon.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: daemon.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: data.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: data.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
static void free_vs(void *data)
{
virtual_server *vs = data;
+ FREE_PTR(vs->virtualhost);
FREE_PTR(vs->s_svr);
if (!LIST_ISEMPTY(vs->rs))
free_list(vs->rs);
static void dump_vs(void *data)
{
virtual_server *vs = data;
+
if (vs->vfwmark)
syslog(LOG_INFO, " VS FWMARK = %d", vs->vfwmark);
else
syslog(LOG_INFO, " VIP = %s, VPORT = %d"
, ip_ntoa(SVR_IP(vs))
, ntohs(SVR_PORT(vs)));
+ if (vs->virtualhost)
+ syslog(LOG_INFO, " VirtualHost = %s", vs->virtualhost);
syslog(LOG_INFO, " delay_loop = %d, lb_algo = %s"
, vs->delay_loop
, vs->sched);
, (vs->service_type == IPPROTO_TCP)?"TCP":"UDP");
switch (vs->loadbalancing_kind) {
+#ifdef _WITH_LVS_
#ifdef _KRNL_2_2_
case 0:
syslog(LOG_INFO, " lb_kind = NAT");
syslog(LOG_INFO, " lb_kind = TUN");
break;
#endif
+#endif
}
if (vs->s_svr) {
, ip_ntoa(SVR_IP(vs->s_svr))
, ntohs(SVR_PORT(vs->s_svr)));
}
-
- dump_list(vs->rs);
+ if (!LIST_ISEMPTY(vs->rs))
+ dump_list(vs->rs);
}
void alloc_vs(char *ip, char *port)
{
}
new->delay_loop = KEEPALIVED_DEFAULT_DELAY;
strncpy(new->timeout_persistence, "0", 1);
+ new->virtualhost = NULL;
list_add(conf_data->vs, new);
}
if (LIST_ISEMPTY(vs->rs))
vs->rs = alloc_list(free_rs, dump_rs);
-
list_add(vs->rs, new);
}
}
void dump_data(void)
{
- if (conf_data->lvs_id &&
- conf_data->smtp_server &&
- conf_data->smtp_connection_to &&
+ if (conf_data->lvs_id ||
+ conf_data->smtp_server ||
+ conf_data->smtp_connection_to ||
conf_data->email_from) {
syslog(LOG_INFO, "------< Global definitions >------");
+ }
+ if (conf_data->lvs_id)
syslog(LOG_INFO, " LVS ID = %s", conf_data->lvs_id);
+ if (conf_data->smtp_server)
syslog(LOG_INFO, " Smtp server = %s", ip_ntoa(conf_data->smtp_server));
+ if (conf_data->smtp_connection_to)
syslog(LOG_INFO, " Smtp server connection timeout = %d"
, conf_data->smtp_connection_to);
+ if (conf_data->email_from) {
syslog(LOG_INFO, " Email notification from = %s"
, conf_data->email_from);
dump_list(conf_data->email);
}
-
if (conf_data->ssl) {
syslog(LOG_INFO, "------< SSL definitions >------");
dump_ssl();
syslog(LOG_INFO, "------< VRRP Topology >------");
dump_list(conf_data->vrrp);
}
+#ifdef _WITH_LVS_
if (!LIST_ISEMPTY(conf_data->vs)) {
syslog(LOG_INFO, "------< LVS Topology >------");
syslog(LOG_INFO, " System is compiled with LVS v%d.%d.%d"
, NVERSION(IP_VS_VERSION_CODE));
dump_list(conf_data->vs);
}
-#ifdef _WITH_LVS_
dump_checkers_queue();
#endif
}
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: data.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: data.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include <arpa/inet.h>
#include <openssl/ssl.h>
+#ifdef _WITH_LVS_
#ifdef _KRNL_2_2_
#include <linux/ip_masq.h>
#include <net/ip_masq.h>
#define SCHED_MAX_LENGTH IP_VS_SCHEDNAME_MAXLEN
#endif
#include <net/ip_vs.h>
+#else
+ #define SCHED_MAX_LENGTH 1
+#endif
/* local includes */
#include "list.h"
uint16_t service_type;
int delay_loop;
char sched[SCHED_MAX_LENGTH];
+ char timeout_persistence[MAX_TIMEOUT_LENGTH];
unsigned loadbalancing_kind;
uint32_t nat_mask;
- char timeout_persistence[MAX_TIMEOUT_LENGTH];
uint32_t granularity_persistence;
+ char *virtualhost;
real_server *s_svr;
list rs;
} virtual_server;
#define ISALIVE(R) ((R)->alive)
#define SVR_IP(H) ((H)->addr_ip)
#define SVR_PORT(H) ((H)->addr_port)
+#define VHOST(V) ((V)->virtualhost)
+#define LAST_RS_TYPE(V) ((V)->last_rs_type)
/* prototypes */
extern void alloc_email(char *addr);
static char *build_request(REQ* req)
{
char *request;
+ char *vhost;
int request_len = 0;
request_len = strlen(REQUEST_TEMPLATE) +
request = xmalloc(request_len);
if (!request) return NULL;
+ vhost = req->host;
+ if (req->virtualhost)
+ vhost = req->virtualhost;
snprintf(request, request_len
, REQUEST_TEMPLATE
, req->url
- , req->host
+ , vhost
, req->port);
return request;
}
" %s --url -u Use the specified remote server url.\n"
" %s --use-private-key -K Use the specified SSL private key.\n"
" %s --use-password -P Use the specified SSL private key password.\n"
+ " %s --use-virtualhost -V Use the specified VirtualHost GET query.\n"
" %s --use-certificate -C Use the specified SSL Certificate file.\n"
" %s --help -h Display this short inlined help screen.\n"
" %s --version -v Display the version number\n",
- prog, prog, prog, prog, prog, prog, prog, prog, prog);
+ prog, prog, prog, prog, prog, prog, prog, prog, prog, prog);
}
/* Command line parser */
{"port", 'p', POPT_ARG_STRING, &optarg, 'p'},
{"url", 'u', POPT_ARG_STRING, &optarg, 'u'},
{"use-private-key", 'K', POPT_ARG_STRING, &optarg, 'K'},
+ {"use-virtualhost", 'V', POPT_ARG_STRING, &optarg, 'V'},
{"use-password", 'P', POPT_ARG_STRING, &optarg, 'P'},
{"use-certificate", 'C', POPT_ARG_STRING, &optarg, 'C'},
{NULL, 0, 0, NULL, 0}
case 'P':
req->password = optarg;
break;
+ case 'V':
+ req->virtualhost = optarg;
+ break;
case 'C':
req->cafile = optarg;
break;
/* Build version */
#define PROG "genhash"
-#define VERSION "0.5.3 (03/22, 2002)"
+#define VERSION "0.5.8 (05/17, 2002)"
/* HTTP/HTTPS GET command */
#define REQUEST_TEMPLATE "GET %s HTTP/1.0\r\n" \
int ssl;
char *keyfile;
char *password;
+ char *virtualhost;
char *cafile;
} REQ;
* library to add/remove server MASQ rules to the kernel
* firewall framework.
*
- * Version: $Id: ipfwwrapper.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: ipfwwrapper.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: ipfwwrapper.c include file.
*
- * Version: $Id: ipfwwrapper.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: ipfwwrapper.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* Part: IPVS Kernel wrapper. Use setsockopt call to add/remove
* server to/from the loadbalanced server pool.
*
- * Version: $Id: ipvswrapper.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: ipvswrapper.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
syslog(LOG_INFO, "IPVS WRAPPER : Virtual service [%s:%d] illegal timeout."
, ip_ntoa(SVR_IP(vs))
, ntohs(SVR_PORT(vs)));
- if (urule.timeout != 0 || vs->granularity_persistence)
+ if (ctl.u.vs_user.timeout != 0 || vs->granularity_persistence)
ctl.u.vs_user.vs_flags = IP_VS_SVC_F_PERSISTENT;
/* VS specific */
/*
* IPVS synchronization daemon state transition
*/
-int ipvs_syncd_goto_master_thread(thread *thread)
-{
- char *ifname = THREAD_ARG(thread);
- ipvs_syncd_cmd(IPVS_STARTDAEMON, ifname, IPVS_MASTER);
- return 0;
-}
-
-int ipvs_syncd_master_thread(thread *thread)
+void ipvs_syncd_master(char *ifname)
{
- char *ifname = THREAD_ARG(thread);
ipvs_syncd_cmd(IPVS_STOPDAEMON, ifname, IPVS_BACKUP);
- thread_add_timer(master, ipvs_syncd_goto_master_thread
- , ifname
- , IPVS_CMD_DELAY);
- return 0;
-}
-
-int ipvs_syncd_goto_backup_thread(thread *thread)
-{
- char *ifname = THREAD_ARG(thread);
- ipvs_syncd_cmd(IPVS_STARTDAEMON, ifname, IPVS_BACKUP);
- return 0;
+ ipvs_syncd_cmd(IPVS_STARTDAEMON, ifname, IPVS_MASTER);
}
-int ipvs_syncd_backup_thread(thread *thread)
+void ipvs_syncd_backup(char *ifname)
{
- char *ifname = THREAD_ARG(thread);
ipvs_syncd_cmd(IPVS_STOPDAEMON, ifname, IPVS_MASTER);
- thread_add_timer(master, ipvs_syncd_goto_backup_thread
- , ifname
- , IPVS_CMD_DELAY);
- return 0;
+ ipvs_syncd_cmd(IPVS_STARTDAEMON, ifname, IPVS_BACKUP);
}
/*
*
* Part: ipvswrapper.c include file.
*
- * Version: $Id: ipvswrapper.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: ipvswrapper.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include <netinet/udp.h>
#include <netinet/tcp.h>
+#ifdef _WITH_LVS_
#ifdef _KRNL_2_2_
#include <linux/ip_fw.h>
#include <net/ip_masq.h>
#endif
#include <net/ip_vs.h>
+#endif
/* locale includes */
#include "scheduler.h"
extern int string_to_number(const char *s, int min, int max);
extern int ipvs_cmd(int cmd, virtual_server *vserver, real_server *rserver);
extern int ipvs_syncd_cmd(int cmd, char *ifname, int state);
-extern int ipvs_syncd_master_thread(thread *thread);
-extern int ipvs_syncd_backup_thread(thread *thread);
+extern void ipvs_syncd_master(char *ifname);
+extern void ipvs_syncd_backup(char *ifname);
#endif
*
* Part: Manipulation functions for IPVS & IPFW wrappers.
*
- * Version: $id: ipwrapper.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $id: ipwrapper.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
extern data *conf_data;
-int clear_service_vs(virtual_server *vs)
+static int clear_service_rs(virtual_server *vs, list l)
{
element e;
- for (e = LIST_HEAD(vs->rs); e; ELEMENT_NEXT(e)) {
- /* IPVS cleaning server entry */
- if (!ipvs_cmd(LVS_CMD_DEL_DEST, vs, e->data))
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ if (!ipvs_cmd(LVS_CMD_DEL_DEST, vs, ELEMENT_DATA(e)))
return 0;
-
#ifdef _KRNL_2_2_
- /* IPFW cleaning server entry if granularity = /32 */
+ /* if we have a /32 mask, we create one nat rules per
+ * realserver.
+ */
if (vs->nat_mask == HOST_NETMASK)
- if (!ipfw_cmd(IP_FW_CMD_DEL, vs, e->data))
+ if(!ipfw_cmd(IP_FW_CMD_DEL, vs, ELEMENT_DATA(e)))
return 0;
#endif
}
+ return 1;
+}
+int clear_service_vs(virtual_server *vs)
+{
+ /* Processing real server queue */
+ if (!LIST_ISEMPTY(vs->rs))
+ if (!clear_service_rs(vs, vs->rs))
+ return 0;
if (!ipvs_cmd(LVS_CMD_DEL, vs, NULL))
return 0;
return 1;
}
}
-int init_service_vs(virtual_server *vs)
+static int init_service_rs(virtual_server *vs, list l)
{
element e;
- /* Init the IPVS root */
- if (!ipvs_cmd(LVS_CMD_ADD, vs, NULL))
- return 0;
-
- for (e = LIST_HEAD(vs->rs); e; ELEMENT_NEXT(e)) {
- if (!ipvs_cmd(LVS_CMD_ADD_DEST, vs, e->data))
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ if (!ipvs_cmd(LVS_CMD_ADD_DEST, vs, ELEMENT_DATA(e)))
return 0;
-
#ifdef _KRNL_2_2_
/* if we have a /32 mask, we create one nat rules per
* realserver.
*/
if (vs->nat_mask == HOST_NETMASK)
- if(!ipfw_cmd(IP_FW_CMD_ADD, vs, e->data))
+ if(!ipfw_cmd(IP_FW_CMD_ADD, vs, ELEMENT_DATA(e)))
return 0;
#endif
}
return 1;
}
+int init_service_vs(virtual_server *vs)
+{
+ /* Init the IPVS root */
+ if (!ipvs_cmd(LVS_CMD_ADD, vs, NULL))
+ return 0;
+
+ /* Processing real server queue */
+ if (!LIST_ISEMPTY(vs->rs))
+ if (!init_service_rs(vs, vs->rs))
+ return 0;
+ return 1;
+}
+
int init_services(void)
{
element e;
*
* Part: ipwrapper.c include file.
*
- * Version: $Id: ipwrapper.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: ipwrapper.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* Part: Layer4 checkers handling. Register worker threads &
* upper layer checkers.
*
- * Version: $Id: layer4.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: layer4.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: layer4.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: List structure manipulation.
*
- * Version: $Id: list.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: list.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: list.c include file.
*
- * Version: $Id: list.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: list.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: main.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Main program include file.
*
- * Version: $Id: main.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: main.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
/* Build version */
#define PROG "Keepalived"
-#define VERSION_CODE 0x000507
-#define DATE_CODE 0x160402
+#define VERSION_CODE 0x000508
+#define DATE_CODE 0x150502
#define KEEPALIVED_VERSION(version) \
(version >> 16) & 0xFF, \
* Part: Memory management framework. This framework is used to
* find any memory leak.
*
- * Version: $Id: memory.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: memory.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: memory.c include file.
*
- * Version: $Id: memory.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: memory.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: parser.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: parser.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
while (1) {
start = cp;
- while (!isspace((int) *cp) && *cp != '\0')
+ if (*cp == '"') {
cp++;
- strlen = cp - start;
- token = MALLOC(strlen + 1);
- memcpy(token, start, strlen);
- *(token + strlen) = '\0';
+ token = MALLOC(2);
+ *(token) = '"';
+ *(token + 1) = '\0';
+ } else {
+ while (!isspace((int) *cp) && *cp != '\0' && *cp != '"')
+ cp++;
+ strlen = cp - start;
+ token = MALLOC(strlen + 1);
+ memcpy(token, start, strlen);
+ *(token + strlen) = '\0';
+ }
/* Alloc & set the slot */
vector_alloc_slot(strvec);
{
char *str = VECTOR_SLOT(strvec, 1);
int size = strlen(str);
- void *alloc;
-
- alloc = MALLOC(size+1);
- memcpy(alloc, str, size);
+ int i = 0;
+ int len = 0;
+ char *alloc = NULL;
+
+ if (*str == '"') {
+ for (i = 2; i < VECTOR_SIZE(strvec); i++) {
+ str = VECTOR_SLOT(strvec, i);
+ len += strlen(str);
+ if (!alloc)
+ alloc = (char *)MALLOC(sizeof(char *) * (len + 1));
+ else {
+ alloc = REALLOC(alloc, sizeof(char *) * (len + 1));
+ strncat(alloc, " ", 1);
+ }
+ if (*str != '"')
+ strncat(alloc, str, strlen(str));
+ }
+ } else {
+ alloc = MALLOC(sizeof(char *) * (size + 1));
+ memcpy(alloc, str, size);
+ }
return alloc;
}
}
static void lbkind_handler(vector strvec)
{
+#ifdef _WITH_LVS_
virtual_server *vs = LIST_TAIL_DATA(conf_data->vs);
char *str = VECTOR_SLOT(strvec, 1);
else
syslog(LOG_DEBUG, "PARSER : unknown [%s] routing method."
, str);
+#endif
}
static void natmask_handler(vector strvec)
{
char *str = VECTOR_SLOT(strvec, 1);
vs->service_type = (!strcmp(str, "TCP"))?IPPROTO_TCP:IPPROTO_UDP;
}
+static void virtualhost_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(conf_data->vs);
+ vs->virtualhost = set_value(strvec);
+}
/* Sorry Servers handlers */
static void ssvr_handler(vector strvec)
install_keyword("auth_pass", &vrrp_auth_pass_handler);
install_sublevel_end();
+#ifdef _WITH_LVS_
/* Virtual server mapping */
install_keyword_root("virtual_server", &vs_handler);
install_keyword("delay_loop", &delay_handler);
install_keyword("persistence_timeout", &pto_handler);
install_keyword("persistence_granularity", &pgr_handler);
install_keyword("protocol", &proto_handler);
+ install_keyword("virtualhost", &virtualhost_handler);
/* Real server mapping */
install_keyword("sorry_server", &ssvr_handler);
install_keyword("real_server", &rs_handler);
install_sublevel();
- install_keyword("weight", &weight_handler);
+ install_keyword("weight", &weight_handler);
/* Checkers mapping */
-#ifdef _WITH_LVS_
- install_checkers_keyword();
-#endif
+ install_checkers_keyword();
install_sublevel_end();
+#endif
}
void init_data(char *conf_file)
*
* Part: cfreader.c include file.
*
- * Version: $Id: parser.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: parser.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: pidfile utility.
*
- * Version: $Id: pidfile.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: pidfile.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: pidfile.c include file.
*
- * Version: $Id: pidfile.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: pidfile.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
lvs_id LVS_DEVEL
}
-virtual_server 192.168.200.100 80 {
+virtual_server 192.168.200.100 443 {
delay_loop 6
lb_algo rr
lb_kind NAT
persistence_timeout 50
protocol TCP
- real_server 192.168.201.100 80 {
+ real_server 192.168.201.100 443 {
weight 1
SSL_GET {
url {
path /
- digest FF20AD2481F97B1754EF3E12ECD3A9CC
+ digest ff20ad2481f97b1754ef3e12ecd3a9cc
}
+ connect_port 443
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
--- /dev/null
+! Sample configuration for use Linux FWMARK
+
+global_defs {
+ lvs_id io
+}
+
+virtual_server fwmark 1 {
+ delay_loop 6
+ lb_algo rr
+ lb_kind NAT
+ persistence_timeout 900
+ protocol TCP
+
+ real_server 192.168.201.100 {
+ weight 1
+ TCP_CHECK {
+ connect_timeout 3
+ }
+ }
+
+ real_server 192.168.201.101 {
+ weight 1
+ TCP_CHECK {
+ connect_timeout 3
+ }
+ }
+}
+
+
+
persistence_timeout 50
protocol TCP
- sorry_server 192.168.200.200 1358
-
- real_server 192.168.200.2 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl3/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
-
- real_server 192.168.200.3 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334c
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334c
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
-
real_server 192.168.200.6 1358 {
weight 1
MISC_CHECK {
}
-virtual_server 10.10.10.3 1358 {
- delay_loop 3
- lb_algo rr
- lb_kind NAT
- nat_mask 255.255.255.0
- persistence_timeout 50
- protocol TCP
-
- real_server 192.168.200.4 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl3/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
-
- real_server 192.168.200.5 1358 {
- weight 1
- HTTP_GET {
- url {
- path /testurl/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl2/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- url {
- path /testurl3/test.jsp
- digest 640205b7b0fc66c1ea91c463fac6334d
- }
- connect_timeout 3
- nb_get_retry 3
- delay_before_retry 3
- }
- }
-}
--- /dev/null
+! Configuration File for keepalived
+
+global_defs {
+ notification_email {
+ acassen
+ }
+ notification_email_from Alexandre.Cassen@firewall.loc
+ smtp_server 192.168.200.1
+ smtp_connect_timeout 30
+ lvs_id LVS_DEVEL
+}
+
+virtual_server 10.10.10.2 1358 {
+ delay_loop 6
+ lb_algo rr
+ lb_kind NAT
+ nat_mask 255.255.255.0
+ persistence_timeout 50
+ protocol TCP
+
+ real_server 192.168.200.6 1358 {
+ weight 1
+ MISC_CHECK {
+ misc_path "/usr/local/bin/script.sh arg1 arg2"
+ }
+ }
+
+}
+
--- /dev/null
+! Sample configuration for real server group declaration
+! Note yet implemented .....
+
+global_defs {
+ lvs_id io
+}
+
+real_server_group G1 {
+ real_server 192.168.201.100 80 {
+ weight 1
+ }
+ real_server 192.168.201.101 80 {
+ weight 1
+ }
+}
+
+virtual_server 192.168.200.10 80 {
+ delay_loop 6
+ lb_algo rr
+ lb_kind NAT
+ persistence_timeout 900
+ protocol TCP
+! virtualhost www.cplusfrn.com
+
+ real_group G1 {
+ HTTP_GET {
+ url {
+ path /
+ digest ff20ad2481f97b1754ef3e12ecd3a9cc
+ }
+ connect_timeout 3
+ nb_get_retry 3
+ delay_before_retry 3
+ }
+ }
+}
--- /dev/null
+! Configuration File for keepalived
+
+global_defs {
+ notification_email {
+ acassen
+ }
+ notification_email_from Alexandre.Cassen@firewall.loc
+ smtp_server 192.168.200.1
+ smtp_connect_timeout 30
+ lvs_id LVS_DEVEL
+}
+
+virtual_server 192.168.200.100 80 {
+ delay_loop 6
+ lb_algo rr
+ lb_kind NAT
+ persistence_timeout 50
+ protocol TCP
+ virtualhost www.firewall.loc # The VirtualHost string to use
+ # in the GET query.
+
+ real_server 192.168.201.100 80 {
+ weight 1
+ SSL_GET {
+ url {
+ path /
+ digest ff20ad2481f97b1754ef3e12ecd3a9cc
+ }
+ url {
+ path /mrtg/
+ digest 9b3a0c85a887a256d6939da88aabd8cd
+ }
+ connect_timeout 3
+ nb_get_retry 3
+ delay_before_retry 3
+ }
+ }
+}
* the thread management routine (thread.c) present in the
* very nice zebra project (http://www.zebra.org).
*
- * Version: $Id: scheduler.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: scheduler.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: scheduler.c include file.
*
- * Version: $Id: scheduler.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: scheduler.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* using the smtp protocol according to the RFC 821. A non blocking
* timeouted connection is used to handle smtp protocol.
*
- * Version: $Id: smtp.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: smtp.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: smtp.c include file.
*
- * Version: $Id: smtp.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: smtp.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Timer manipulations.
*
- * Version: $Id: timer.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: timer.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: timer.c include file.
*
- * Version: $Id: timer.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: timer.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: General program utils.
*
- * Version: $Id: utils.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: utils.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: utils.h include file.
*
- * Version: $Id: utils.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: utils.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Vector structure manipulation.
*
- * Version: $Id: vector.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vector.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vector.c include file.
*
- * Version: $Id: vector.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vector.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* master fails, a backup server takes over.
* The original implementation has been made by jerome etienne.
*
- * Version: $Id: vrrp.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
if (hd->auth_type == VRRP_AUTH_PASS) {
char *pw = (char *)ip + ntohs(ip->tot_len)
- sizeof(vrrp->auth_data);
- if (memcmp(pw, vrrp->auth_data, sizeof(vrrp->auth_data))) {
+ if (strncmp(pw, vrrp->auth_data, strlen(vrrp->auth_data)) != 0) {
syslog(LOG_INFO, "receive an invalid passwd!");
return VRRP_PACKET_KO;
}
#ifdef _HAVE_IPVS_SYNCD_
/* Check if sync daemon handling is needed */
if (vrrp->lvs_syncd_if)
- thread_add_timer(master, ipvs_syncd_master_thread
- , vrrp->lvs_syncd_if
- , IPVS_CMD_DELAY);
+ ipvs_syncd_master(vrrp->lvs_syncd_if);
#endif
if (vrrp->wantstate == VRRP_STATE_MAST) {
#ifdef _HAVE_IPVS_SYNCD_
/* Check if sync daemon handling is needed */
if (vrrp->lvs_syncd_if)
- thread_add_timer(master, ipvs_syncd_backup_thread
- , vrrp->lvs_syncd_if
- , IPVS_CMD_DELAY);
+ ipvs_syncd_backup(vrrp->lvs_syncd_if);
#endif
/* set the new vrrp state */
vrrp->ms_down_timer = 3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);
vrrp->state = VRRP_STATE_BACK;
return 1;
+ } else if (hd->priority < vrrp->priority) {
+ /* We receive a lower prio adv we just refresh remote ARP cache */
+ vrrp_send_gratuitous_arp(vrrp);
+ return 0;
}
return 0;
*
* Part: vrrp.c program include file.
*
- * Version: $Id: vrrp.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Based on the Jerome Etienne, <jetienne@arobas.net> code.
*
* Part: Interfaces manipulation.
*
- * Version: $Id: vrrp_if.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_if.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_if.c include file.
*
- * Version: $Id: vrrp_if.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_if.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: NETLINK IPv4 address manipulation.
*
- * Version: $Id: vrrp_ipaddress.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_ipaddress.c include file.
*
- * Version: $Id: vrrp_ipaddress.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* authentication data encryption using HMAC MD5 according to
* RFCs 2085 & 2104.
*
- * Version: $Id: vrrp_ipsecah.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_ipsecah.c include file.
*
- * Version: $Id: vrrp_ipsecah.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: NETLINK kernel command channel.
*
- * Version: $Id: vrrp_netlink.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_netlink.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_netlink.c include file.
*
- * Version: $Id: vrrp_netlink.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_netlink.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Sheduling framework for vrrp code.
*
- * Version: $Id: vrrp_scheduler.c,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_scheduler.c,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
if (vrrp->priority == VRRP_PRIO_OWNER ||
vrrp->wantstate == VRRP_STATE_MAST) {
+#ifdef _HAVE_IPVS_SYNCD_
+ /* Check if sync daemon handling is needed */
+ if (vrrp->lvs_syncd_if)
+ ipvs_syncd_cmd(IPVS_STARTDAEMON, vrrp->lvs_syncd_if
+ , IPVS_MASTER);
+#endif
vrrp->state = VRRP_STATE_GOTO_MASTER;
} else {
vrrp->ms_down_timer = 3 * vrrp->adver_int
*
* Part: vrrp_scheduler.c include file.
*
- * Version: $Id: vrrp_scheduler.h,v 0.5.7 2002/05/02 22:18:07 acassen Exp $
+ * Version: $Id: vrrp_scheduler.h,v 0.5.8 2002/05/21 16:09:46 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*