* keepalived-0.6.8 released.
* Alex Kramarov, <alex@incredimail.com> & Remi Nivet, <Remi.Nivet@atosorigin.com>
reported an assertion error during smtp notification process. The assertion
caused a bad file descriptor registration during in_progress connection
handling. Fixed registering an event thread calling upper level SMTP
protocol in_progress connection handler. So the SMTP stream handlers use
global I/O multiplexer on connection success.
* Benoit Gaussen, <ben@trez42.net> and I added support to "inhibit" feature.
Added a new keyword called "inhibit_on_failure" for real_server declaration.
If specified the real_server will not be removed from the IPVS topology if
real_server fail according to checker result. Instead of removing the entry
from IPVS topology, the corresponding real_server weight will be set to 0.
When real_server will be back, then weight will be set back to original value.
See sample directory for example.
* Added support to IP_MASQ_CMD_SET_DEST for 2.2 krnl and IP_VS_SO_SET_EDITDEST
for 2.4 IPVS code to provide support to "inhibit" feature.
* Review Makefile.in to exit on compilation error.
* Extended autconf script to check for kernel netlink support.
* keepalived-0.6.7 released.
* Rewrote the previous SMTP notification framework. New code use a strong
multi-threaded FSM design.
* Moved the SMTP get_local_name() into utils.c
* IPVS : updated the code to support IPVS_SVC_PERSISTENT_TIMEOUT. Introduced
into the new libipvs coming with ipvs-1.0.4.
* VRRP : Extended the mcast membership subscription to handle more robust
mcast subscription errors. Removed the previous ugly stalling sleeping
call retry for membership subscription. Membership subscriptions are now
multi-threaded to not degrade global scheduling timer.
* VRRP : Remi Nivet, <Remi.Nivet@atosorigin.com> pointed out a buffer
overflow during the sending advert interface binding process.
* Some more cosmetics patches.
* Review the Makefile(s) code dependencies.
* Updated the TODO file.
+2002-07-16 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-0.6.8 released.
+ * Alex Kramarov, <alex@incredimail.com> & Remi Nivet, <Remi.Nivet@atosorigin.com>
+ reported an assertion error during smtp notification process. The assertion
+ caused a bad file descriptor registration during in_progress connection
+ handling. Fixed registering an event thread calling upper level SMTP
+ protocol in_progress connection handler. So the SMTP stream handlers use
+ global I/O multiplexer on connection success.
+ * Benoit Gaussen, <ben@trez42.net> and I added support to "inhibit" feature.
+ Added a new keyword called "inhibit_on_failure" for real_server declaration.
+ If specified the real_server will not be removed from the IPVS topology if
+ real_server fail according to checker result. Instead of removing the entry
+ from IPVS topology, the corresponding real_server weight will be set to 0.
+ When real_server will be back, then weight will be set back to original value.
+ See sample directory for example.
+ * Added support to IP_MASQ_CMD_SET_DEST for 2.2 krnl and IP_VS_SO_SET_EDITDEST
+ for 2.4 IPVS code to provide support to "inhibit" feature.
+ * Review Makefile.in to exit on compilation error.
+ * Extended autconf script to check for kernel netlink support.
+
+2002-07-12 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-0.6.7 released.
+ * Rewrote the previous SMTP notification framework. New code use a strong
+ multi-threaded FSM design.
+ * Moved the SMTP get_local_name() into utils.c
+ * IPVS : updated the code to support IPVS_SVC_PERSISTENT_TIMEOUT. Introduced
+ into the new libipvs coming with ipvs-1.0.4.
+ * VRRP : Extended the mcast membership subscription to handle more robust
+ mcast subscription errors. Removed the previous ugly stalling sleeping
+ call retry for membership subscription. Membership subscriptions are now
+ multi-threaded to not degrade global scheduling timer.
+ * VRRP : Remi Nivet, <Remi.Nivet@atosorigin.com> pointed out a buffer
+ overflow during the sending advert interface binding process.
+ * Some more cosmetics patches.
+
2002-07-05 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-0.6.6 released.
* added indentation style .indent.pro
* Refine autoconf/automake scripts. Added automake support to libipvs and
libipfwc. Added code selection compilation for libipvs and libipfwc.
* Review Makefile(s) to use more convenient facilities like distclean, ...
+ * Review the Makefile(s) code dependencies.
* Added support to modprobe_ipvs if the ip_vs.o module is not loaded.
If modprobe fails then IPVS is assumed unavailable.
* Refine the IPVS wrapper to be more tolerant. When a VS or RS is already
instance want to run on an interface administratively shut. Added extension
to FSM to force transition to FAULT state during bootstrap if the interface
is shut.
+ * Updated the TODO file.
* Some cosmetics patches.
2002-07-01 Alexandre Cassen <acassen@linux-vs.org>
install:
$(MAKE) -C keepalived install
$(MAKE) -C genhash install
+
+rpm:
+ rpm -ba keepalived.spec
* Insert LDAP, FTP, SSH, IMAP, POP, RADIUS checkers.
* Add minimum configuration verification (realserver must have
a checker defined, ...)
+* VRRP : finish IPSEC-AH integration for seqnum synchronization when
+ using vrrp_sync_group in fallback mode.
* documentation:
- hackers guide
- code documentation
- - users guide
* code cleanup:
- name space cleanup
- function returnval check
- - maybe put *.h files into a ../include directory
- - maybe add a ../healthcheck directory for the checks
-* more choice with parameters, less hardcoded values:
- - a general.conf could help, stuff like timeouts and so on
+ - beautifull the genhash code
+ - check_ssl.c audit the password_cb() call back func
+ for buffer overflow.
+ - check smtp.c to release allocated buffer when terminate
+ thread is registered. Occur when sigint is receive when
+ smtp alertes have not been able to finish the whole sending
+ sequence.
+* more choice with parameters, less hardcoded values
* functionality:
- better startup check mechanism to prevent long debugging sessions
- - hooks for external checktools. For node-failover
+ - hooks in VRRP framework for external checktools.
+ As state transition decision
- a VTYSH to administrate keepalived on the fly
- - something I forgot right now :)
+* Configuration file reload on signal. Extend the parser to use
+ global scheduler with conf file stream.
+* something I forgot right now :)
fi
done
-for ac_hdr in openssl/ssl.h openssl/md5.h openssl/err.h
+for ac_hdr in linux/netlink.h linux/rtnetlink.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
else
echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in openssl/ssl.h openssl/md5.h openssl/err.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1197: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1202 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
{ echo "configure: error:
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!" 1>&2; exit 1; }
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1201: checking for $ac_hdr" >&5
+echo "configure:1241: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1206 "configure"
+#line 1246 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
echo $ac_n "checking for MD5_Init in -lcrypto""... $ac_c" 1>&6
-echo "configure:1241: checking for MD5_Init in -lcrypto" >&5
+echo "configure:1281: checking for MD5_Init in -lcrypto" >&5
ac_lib_var=`echo crypto'_'MD5_Init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1249 "configure"
+#line 1289 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
MD5_Init()
; return 0; }
EOF
-if { (eval echo configure:1260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for SSL_CTX_new in -lssl""... $ac_c" 1>&6
-echo "configure:1289: checking for SSL_CTX_new in -lssl" >&5
+echo "configure:1329: checking for SSL_CTX_new in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_new | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lssl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1297 "configure"
+#line 1337 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
SSL_CTX_new()
; return 0; }
EOF
-if { (eval echo configure:1308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for poptGetContext in -lpopt""... $ac_c" 1>&6
-echo "configure:1337: checking for poptGetContext in -lpopt" >&5
+echo "configure:1377: checking for poptGetContext in -lpopt" >&5
ac_lib_var=`echo popt'_'poptGetContext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lpopt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1345 "configure"
+#line 1385 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
poptGetContext()
; return 0; }
EOF
-if { (eval echo configure:1356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test "${ci_linux}" = "yes"; then
echo $ac_n "checking for cluster_maxnodes in -lcluster""... $ac_c" 1>&6
-echo "configure:1386: checking for cluster_maxnodes in -lcluster" >&5
+echo "configure:1426: checking for cluster_maxnodes in -lcluster" >&5
ac_lib_var=`echo cluster'_'cluster_maxnodes | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lcluster $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1394 "configure"
+#line 1434 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
cluster_maxnodes()
; return 0; }
EOF
-if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS -I$kernelinc"
CFLAGS="$CFLAGS -I$kernelinc"
echo $ac_n "checking for kernel >= 2.4.0""... $ac_c" 1>&6
-echo "configure:1438: checking for kernel >= 2.4.0" >&5
+echo "configure:1478: checking for kernel >= 2.4.0" >&5
if test "$cross_compiling" = yes; then
KERN="_KRNL_2_2_"
else
cat > conftest.$ac_ext <<EOF
-#line 1446 "configure"
+#line 1486 "configure"
#include "confdefs.h"
#include <stdlib.h>
#endif
}
EOF
-if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
KERN="_KRNL_2_4_"
if test "$enable_lvs" != "no"; then
ac_safe=`echo "net/ip_vs.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for net/ip_vs.h""... $ac_c" 1>&6
-echo "configure:1483: checking for net/ip_vs.h" >&5
+echo "configure:1523: checking for net/ip_vs.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1488 "configure"
+#line 1528 "configure"
#include "confdefs.h"
#include <net/ip_vs.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
echo $ac_n "checking for IPVS version""... $ac_c" 1>&6
-echo "configure:1525: checking for IPVS version" >&5
+echo "configure:1565: checking for IPVS version" >&5
if test "$cross_compiling" = yes; then
IPVS_MAJOR="0"
else
cat > conftest.$ac_ext <<EOF
-#line 1534 "configure"
+#line 1574 "configure"
#include "confdefs.h"
#include <stdlib.h>
}
EOF
-if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
IPVS_MAJOR=`head -n 1 ipvsinfo | tail -n 1`
fi
if test "$enable_vrrp" != "no"; then
- VRRP_SUPPORT="_WITH_VRRP_"
+ echo $ac_n "checking for kernel netlink support""... $ac_c" 1>&6
+echo "configure:1622: checking for kernel netlink support" >&5
+ if test "$cross_compiling" = yes; then
+
+ echo "$ac_t""no" 1>&6
+
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1629 "configure"
+#include "confdefs.h"
+
+ #include <asm/types.h>
+ #include <sys/socket.h>
+ #include <linux/netlink.h>
+ int main (void) {
+ int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ if (fd < 0)
+ exit(1);
+ close(fd);
+ exit(0);
+ }
+EOF
+if { (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ echo "$ac_t""yes" 1>&6
+ VRRP_SUPPORT="_WITH_VRRP_"
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -fr conftest*
+fi
+
fi
if test "${ci_linux}" = "yes"; then
IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
if test "$IPVS_SUPPORT" = "_WITH_LVS_"; then
echo $ac_n "checking for LVS syncd support""... $ac_c" 1>&6
-echo "configure:1608: checking for LVS syncd support" >&5
+echo "configure:1686: checking for LVS syncd support" >&5
if test "$IPVS_MAJOR" -ge 1 -a "$KERN" = "_KRNL_2_4_"; then
IPVS_SYNCD="_HAVE_IPVS_SYNCD_"
elif test "$IPVS_MINOR" -ge 9 -a "$IPVS_PATCH" -ge 2 -a "$KERN" = "_KRNL_2_4_"; then
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1631: checking for working const" >&5
+echo "configure:1709: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1636 "configure"
+#line 1714 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1706: checking for pid_t" >&5
+echo "configure:1784: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1711 "configure"
+#line 1789 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1739: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1817: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1744 "configure"
+#line 1822 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1776: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1854: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1782 "configure"
+#line 1860 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
+#line 1878 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1822: checking return type of signal handlers" >&5
+echo "configure:1900: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1827 "configure"
+#line 1905 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:1844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
for ac_func in gettimeofday select socket strerror strtol uname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1865: checking for $ac_func" >&5
+echo "configure:1943: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1870 "configure"
+#line 1948 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h sys/ioctl.h sys/time.h)
+AC_CHECK_HEADERS(linux/netlink.h linux/rtnetlink.h)
AC_CHECK_HEADERS(openssl/ssl.h openssl/md5.h openssl/err.h,,AC_MSG_ERROR([
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!]))
AC_MSG_ERROR([keepalived MUST be compiled at least with LVS or VRRP framework])
fi
+dnl ----[ Checks for kernel netlink support ]----
if test "$enable_vrrp" != "no"; then
- VRRP_SUPPORT="_WITH_VRRP_"
+ AC_MSG_CHECKING([for kernel netlink support])
+ AC_TRY_RUN([
+ #include <asm/types.h>
+ #include <sys/socket.h>
+ #include <linux/netlink.h>
+ int main (void) {
+ int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ if (fd < 0)
+ exit(1);
+ close(fd);
+ exit(0);
+ }], [
+ AC_MSG_RESULT(yes)
+ VRRP_SUPPORT="_WITH_VRRP_"
+ ], [
+ AC_MSG_RESULT(no)
+ ], [
+ AC_MSG_RESULT(no)
+ ])
fi
if test "${ci_linux}" = "yes"; then
clean:
rm -f core *.o
-distclean:
+distclean: clean
rm -f Makefile
uninstall:
Summary: Generic HA monitor build upon VRRP and services poller, strongly recommanded for LVS HA.
Name: keepalived
-Packager: Christophe Varoqui <christophe.varoqui@free.fr>
-Version: 0.6.6
+Packager: Christophe Varoqui, <christophe.varoqui@free.fr>
+Version: 0.6.7
Release: 1
-Source: http://www.keepalived.org/software/keepalived-0.6.6.tar.gz
+Source: http://www.keepalived.org/software/keepalived-0.6.7.tar.gz
Copyright: GPL
Group: Utilities/File
BuildRoot: /tmp/%{name}-%{version}.build
%prep
rm -rf %{buildroot}
-%setup -n keepalived-0.6.6
+%setup -n keepalived-0.6.7
%build
./configure --prefix=%{buildroot} --exec-prefix=%{buildroot} --sysconfdir=%{buildroot}/etc
all:
@set -e; \
for i in $(SUBDIRS); do \
- $(MAKE) -C $$i; done && \
- echo "Building $(EXEC) in $(BIN)" && \
+ $(MAKE) -C $$i || exit 1; done && \
+ echo "Building $(BIN)/$(EXEC)" && \
$(CC) -o $(BIN)/$(EXEC) $(LDFLAGS) `find $(SUBDIRS) -name '*.[oa]'`
strip $(BIN)/$(EXEC)
@echo ""
debug:
@set -e; \
for i in $(SUBDIRS); do \
- $(MAKE) -C $$i; done && \
- echo "Building $(EXEC) in $(BIN)" && \
+ $(MAKE) -C $$i || exit 1; done && \
+ echo "Building $(BIN)/$(EXEC)" && \
$(CC) -o $(BIN)/$(EXEC) $(LDFLAGS) `find $(SUBDIRS) -name '*.[oa]'`
@echo ""
@echo "Make complete"
distclean: clean
rm -f Makefile
+
+
+main.o: main.c ../include/main.h
+memory.o: memory.c ../include/memory.h
+daemon.o: daemon.c ../include/daemon.h
+pidfile.o: pidfile.c ../include/pidfile.h
+utils.o: utils.c ../include/utils.h
+timer.o: timer.c ../include/timer.h
+scheduler.o: scheduler.c ../include/scheduler.h ../include/memory.h \
+ ../include/utils.h
+vector.o: vector.c ../include/vector.h ../include/memory.h
+list.o: list.c ../include/list.h ../include/memory.h
+data.o: data.c ../include/data.h ../include/memory.h ../include/utils.h \
+ ../include/check_api.h ../include/vrrp.h ../include/vrrp_sync.h
+parser.o: parser.c ../include/parser.h ../include/memory.h ../include/vrrp.h \
+ ../include/vrrp_if.h ../include/check_api.h
+layer4.o: layer4.c ../include/layer4.h ../include/check_api.h ../include/utils.h
+smtp.o: smtp.c ../include/smtp.h ../include/memory.h ../include/list.h \
+ ../include/utils.h
+
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: main.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: data.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: data.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
inet_ntop2(SVR_IP(rs))
, ntohs(SVR_PORT(rs))
, rs->weight);
+ if (rs->inhibit)
+ syslog(LOG_INFO, " -> Inhibit service on failure");
}
void
inet_ston(ip, &new->addr_ip);
new->addr_port = htons(atoi(port));
- new->alive = 1;
if (LIST_ISEMPTY(vs->rs))
vs->rs = alloc_list(free_rs, dump_rs);
* Part: Layer4 checkers handling. Register worker threads &
* upper layer checkers.
*
- * Version: $Id: layer4.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: layer4.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: List structure manipulation.
*
- * Version: $Id: list.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: list.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Main program structure.
*
- * Version: $Id: main.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: main.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
keepalived_free_final();
#endif
- closelog();
/* finally return from system */
+ closelog();
exit(0);
}
* Part: Memory management framework. This framework is used to
* find any memory leak.
*
- * Version: $Id: memory.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: memory.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
}
if (buffer != NULL)
- free(buffer);
+ xfree(buffer);
if (debug & 1)
printf("%sfree [%3d:%3d], %p, %4ld at %s, %3d, %s\n",
* data structure representation the conf file representing
* the loadbalanced server pool.
*
- * Version: $Id: parser.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: parser.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
real_server *rs = LIST_TAIL_DATA(vs->rs);
rs->weight = atoi(VECTOR_SLOT(strvec, 1));
}
+static void
+inhibit_handler(vector strvec)
+{
+ virtual_server *vs = LIST_TAIL_DATA(conf_data->vs);
+ real_server *rs = LIST_TAIL_DATA(vs->rs);
+ rs->inhibit = 1;
+}
/* Real Servers Groups for VS handlers */
static void
install_keyword("real_server", &rs_handler);
install_sublevel();
install_keyword("weight", &weight_handler);
+ install_keyword("inhibit_on_failure", &inhibit_handler);
/* Checkers mapping */
install_checkers_keyword();
*
* Part: pidfile utility.
*
- * Version: $Id: pidfile.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: pidfile.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* the thread management routine (thread.c) present in the
* very nice zebra project (http://www.zebra.org).
*
- * Version: $Id: scheduler.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: scheduler.c,v 0.6.8 2002/07/16 02:41:25 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.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: smtp.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include "utils.h"
extern data *conf_data;
-
-/* static prototype */
-static int smtp_send_cmd_thread(thread *);
+extern thread_master *master;
+
+/* SMTP FSM definition */
+static int connection_error(thread *);
+static int connection_in_progress(thread *);
+static int connection_timeout(thread *);
+static int connection_success(thread *);
+static int helo_cmd(thread *);
+static int mail_cmd(thread *);
+static int rcpt_cmd(thread *);
+static int data_cmd(thread *);
+static int body_cmd(thread *);
+static int quit_cmd(thread *);
+
+static int connection_code(thread *, int);
+static int helo_code(thread *, int);
+static int mail_code(thread *, int);
+static int rcpt_code(thread *, int);
+static int data_code(thread *, int);
+static int body_code(thread *, int);
+static int quit_code(thread *, int);
+
+static int smtp_read_thread(thread *);
+static int smtp_send_thread(thread *);
+
+struct {
+ int (*send) (thread *);
+ int (*read) (thread *, int);
+} SMTP_FSM[SMTP_MAX_FSM_STATE] = {
+/* Stream Write Handlers | Stream Read handlers *
+ *-------------------------------+--------------------------*/
+ {connection_error, NULL}, /* connect_error */
+ {connection_in_progress, NULL}, /* connect_in_progress */
+ {connection_timeout, NULL}, /* connect_timeout */
+ {connection_success, connection_code}, /* connect_success */
+ {helo_cmd, helo_code}, /* HELO */
+ {mail_cmd, mail_code}, /* MAIL */
+ {rcpt_cmd, rcpt_code}, /* RCPT */
+ {data_cmd, data_code}, /* DATA */
+ {body_cmd, body_code}, /* BODY */
+ {quit_cmd, quit_code} /* QUIT */
+};
static void
free_smtp_all(smtp_thread_arg * smtp_arg)
return list_element(conf_data->email, smtp_arg->email_it);
}
+/* layer4 connection handlers */
+static int
+connection_error(thread * thread)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ DBG("SMTP connection ERROR to [%s:%d].",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+ free_smtp_all(smtp_arg);
+ return 0;
+}
+static int
+connection_timeout(thread * thread)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ DBG("Timeout connecting SMTP server [%s:%d].",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+ free_smtp_all(smtp_arg);
+ return 0;
+}
+static int
+connection_in_progress(thread * thread)
+{
+ int status;
+
+ DBG("SMTP connection to [%s:%d] now IN_PROGRESS.",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+
+ /*
+ * Here we use the propriety of a union structure,
+ * each element of the structure have the same value.
+ */
+ status =
+ tcp_socket_state(thread->u.fd, thread, conf_data->smtp_server,
+ htons(SMTP_PORT), connection_in_progress);
+
+ if (status != connect_in_progress)
+ SMTP_FSM_SEND(status, thread);
+
+ return 0;
+}
static int
-smtp_read_cmd_thread(thread * thread)
+connection_success(thread * thread)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ DBG("Remote SMTP server [%s:%d] connected.",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+
+ smtp_arg->stage = connect_success;
+ thread_add_read(thread->master, smtp_read_thread, smtp_arg,
+ smtp_arg->fd, conf_data->smtp_connection_to);
+ return 0;
+}
+
+/* SMTP protocol handlers */
+static int
+smtp_read_thread(thread * thread)
{
smtp_thread_arg *smtp_arg;
- char *fetched_email;
char *buffer;
char *reply;
int rcv_buffer_size = 0;
if (thread->type == THREAD_READ_TIMEOUT) {
DBG("Timeout reading data to remote SMTP server [%s:%d].",
inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- close(thread->u.fd);
- return 0;
+ SMTP_FSM_READ(QUIT, thread, 0);
+ return -1;
}
buffer = smtp_arg->buffer;
- while ((rcv_buffer_size =
- read(thread->u.fd, buffer + smtp_arg->buflen,
- SMTP_BUFFER_LENGTH - smtp_arg->buflen)) != 0) {
- if (rcv_buffer_size == -1) {
- if (errno == EAGAIN)
- goto end;
- DBG("Error reading data to remote SMTP server [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- close(thread->u.fd);
- return 0;
- }
+ rcv_buffer_size = read(thread->u.fd, buffer + smtp_arg->buflen,
+ SMTP_BUFFER_LENGTH - smtp_arg->buflen);
- /* received data overflow buffer size ? */
- if (smtp_arg->buflen >= SMTP_BUFFER_MAX) {
- DBG("Received buffer from remote SMTP server [%s:%d]"
- " overflow our get read buffer length.",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- close(thread->u.fd);
- return 0;
- } else {
- smtp_arg->buflen += rcv_buffer_size;
- buffer[smtp_arg->buflen] = 0; /* NULL terminate */
- if (rcv_buffer_size < SMTP_BUFFER_LENGTH)
- goto end;
- }
+ if (rcv_buffer_size == -1) {
+ if (errno == EAGAIN)
+ goto end;
+ DBG("Error reading data from remote SMTP server [%s:%d].",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+ SMTP_FSM_READ(QUIT, thread, 0);
+ return 0;
}
- end:
+ /* received data overflow buffer size ? */
+ if (smtp_arg->buflen >= SMTP_BUFFER_MAX) {
+ DBG("Received buffer from remote SMTP server [%s:%d]"
+ " overflow our get read buffer length.",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+ SMTP_FSM_READ(QUIT, thread, 0);
+ return 0;
+ } else {
+ smtp_arg->buflen += rcv_buffer_size;
+ buffer[smtp_arg->buflen] = 0; /* NULL terminate */
+ }
-// printf("Received : %s", buffer);
+end:
/* parse the buffer, finding the last line of the response for the code */
reply = buffer;
smtp_arg->buflen -= (reply - buffer);
buffer[smtp_arg->buflen] = 0;
- thread_add_read(thread->master, smtp_read_cmd_thread,
- smtp_arg, thread->u.fd,
- conf_data->smtp_connection_to);
+ thread_add_read(thread->master, smtp_read_thread, smtp_arg,
+ thread->u.fd, conf_data->smtp_connection_to);
return 0;
}
buffer[smtp_arg->buflen] = 0;
if (status == -1) {
- thread_add_read(thread->master, smtp_read_cmd_thread, smtp_arg,
+ thread_add_read(thread->master, smtp_read_thread, smtp_arg,
thread->u.fd, conf_data->smtp_connection_to);
return 0;
}
- /* setting the next stage */
- switch (smtp_arg->stage) {
- case CONNECTION:
- if (status == 220) {
- smtp_arg->stage = HELO;
- } else {
- DBG("Error connecting smtp server : [%s]",
- buffer);
- smtp_arg->stage = ERROR;
- }
- break;
+ SMTP_FSM_READ(smtp_arg->stage, thread, status);
- case HELO:
- if (status == 250) {
- smtp_arg->stage = MAIL;
- } else {
- DBG("Error processing HELO cmd : [%s]",
- buffer);
- smtp_arg->stage = ERROR;
- }
- break;
+ /* Registering next smtp command processing thread */
+ if (smtp_arg->stage != ERROR) {
+ thread_add_write(thread->master, smtp_send_thread, smtp_arg,
+ smtp_arg->fd, conf_data->smtp_connection_to);
+ } else {
+ DBG("Can not read data from remote SMTP server [%s:%d].",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+ SMTP_FSM_READ(QUIT, thread, 0);
+ }
- case MAIL:
- if (status == 250) {
- smtp_arg->stage = RCPT;
- } else {
- DBG("Error processing MAIL FROM cmd : [%s]",
- buffer);
- smtp_arg->stage = ERROR;
- }
- break;
+ return 0;
+}
- case RCPT:
- if (status == 250) {
- smtp_arg->email_it++;
+static int
+smtp_send_thread(thread * thread)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ if (thread->type == THREAD_WRITE_TIMEOUT) {
+ DBG("Timeout sending data to remote SMTP server [%s:%d].",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+ SMTP_FSM_READ(QUIT, thread, 0);
+ return 0;
+ }
- fetched_email = fetch_next_email(smtp_arg);
+ SMTP_FSM_SEND(smtp_arg->stage, thread);
- if (!fetched_email)
- smtp_arg->stage = DATA;
- } else {
- DBG("Error processing RCPT TO cmd : [%s]",
- buffer);
- smtp_arg->stage = ERROR;
- }
- break;
+ /* Handle END command */
+ if (smtp_arg->stage == END) {
+ SMTP_FSM_READ(QUIT, thread, 0);
+ return 0;
+ }
- case DATA:
- if (status == 354) {
- smtp_arg->stage = BODY;
- } else {
- DBG("Error processing DATA cmd : [%s]",
- buffer);
- smtp_arg->stage = ERROR;
- }
- break;
+ /* Registering next smtp command processing thread */
+ if (smtp_arg->stage != ERROR) {
+ thread_add_read(thread->master, smtp_read_thread, smtp_arg,
+ thread->u.fd, conf_data->smtp_connection_to);
+ } else {
+ DBG("Can not send data to remote SMTP server [%s:%d].",
+ inet_ntop2(conf_data->smtp_server), SMTP_PORT);
+ SMTP_FSM_READ(QUIT, thread, 0);
+ }
- case BODY:
- if (status == 250) {
- smtp_arg->stage = QUIT;
- syslog(LOG_INFO, "SMTP alert successfully sent.");
- } else {
- DBG("Error processing DOT cmd : [%s]",
- buffer);
- smtp_arg->stage = ERROR;
- }
- break;
+ return 0;
+}
- case QUIT:
- /* final state, we are disconnected from the remote host */
- free_smtp_all(smtp_arg);
- close(thread->u.fd);
- return 0;
- case ERROR:
- break;
+static int
+connection_code(thread * thread, int status)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ if (status == 220) {
+ smtp_arg->stage++;
+ } else {
+ DBG("Error connecting smtp server");
+ smtp_arg->stage = ERROR;
}
- /* Registering next smtp command processing thread */
- thread_add_write(thread->master, smtp_send_cmd_thread, smtp_arg,
- thread->u.fd, conf_data->smtp_connection_to);
return 0;
}
-/* Getting localhost official canonical name */
-static char *
-get_local_name(void)
+/* HELO command processing */
+static int
+helo_cmd(thread * thread)
{
- struct hostent *host;
- struct utsname name;
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+ char *buffer;
- if (uname(&name) < 0)
- return NULL;
+ buffer = (char *)MALLOC(SMTP_BUFFER_MAX);
+ snprintf(buffer, SMTP_BUFFER_MAX, SMTP_HELO_CMD,
+ get_local_name());
+ if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
+ smtp_arg->stage = ERROR;
+ FREE(buffer);
- if (!(host = gethostbyname(name.nodename)))
- return NULL;
+ return 0;
+}
+static int
+helo_code(thread * thread, int status)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ if (status == 250) {
+ smtp_arg->stage++;
+ } else {
+ DBG("Error processing HELO cmd");
+ smtp_arg->stage = ERROR;
+ }
- return host->h_name;
+ return 0;
}
+/* MAIL command processing */
static int
-smtp_send_cmd_thread(thread * thread)
+mail_cmd(thread * thread)
{
- smtp_thread_arg *smtp_arg;
- char *fetched_email;
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
char *buffer;
- smtp_arg = THREAD_ARG(thread);
+ buffer = (char *)MALLOC(SMTP_BUFFER_MAX);
+ snprintf(buffer, SMTP_BUFFER_MAX, SMTP_MAIL_CMD,
+ conf_data->email_from);
+ if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
+ smtp_arg->stage = ERROR;
+ FREE(buffer);
- if (thread->type == THREAD_WRITE_TIMEOUT) {
- DBG("Timeout sending data to remote SMTP server [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- close(thread->u.fd);
- return 0;
+ return 0;
+}
+static int
+mail_code(thread * thread, int status)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ if (status == 250) {
+ smtp_arg->stage++;
+ } else {
+ DBG("Error processing MAIL cmd");
+ smtp_arg->stage = ERROR;
}
- /* allocate temporary command buffer */
- buffer = (char *) MALLOC(SMTP_BUFFER_MAX);
+ return 0;
+}
- switch (smtp_arg->stage) {
- case CONNECTION:
- break;
+/* RCPT command processing */
+static int
+rcpt_cmd(thread * thread)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+ char *buffer;
+ char *fetched_email;
- case HELO:
- snprintf(buffer, SMTP_BUFFER_MAX, SMTP_HELO_CMD,
- get_local_name());
- if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
- smtp_arg->stage = ERROR;
- break;
+ buffer = (char *)MALLOC(SMTP_BUFFER_MAX);
+ /* We send RCPT TO command multiple time to add all our email receivers.
+ * --rfc821.3.1
+ */
+ fetched_email = fetch_next_email(smtp_arg);
- case MAIL:
- snprintf(buffer, SMTP_BUFFER_MAX, SMTP_MAIL_CMD,
- conf_data->email_from);
- if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
- smtp_arg->stage = ERROR;
- break;
+ snprintf(buffer, SMTP_BUFFER_MAX, SMTP_RCPT_CMD, fetched_email);
+ if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
+ smtp_arg->stage = ERROR;
+ FREE(buffer);
- case RCPT:
- /* We send RCPT TO command multiple time to add all our email receivers.
- * --rfc821.3.1
- */
- fetched_email = fetch_next_email(smtp_arg);
+ return 0;
+}
+static int
+rcpt_code(thread * thread, int status)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+ char *fetched_email;
- snprintf(buffer, SMTP_BUFFER_MAX, SMTP_RCPT_CMD, fetched_email);
- if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
- smtp_arg->stage = ERROR;
- break;
+ if (status == 250) {
+ smtp_arg->email_it++;
- case DATA:
- if (send(thread->u.fd, SMTP_DATA_CMD, strlen(SMTP_DATA_CMD), 0)
- == -1)
- smtp_arg->stage = ERROR;
- break;
+ fetched_email = fetch_next_email(smtp_arg);
- case BODY:
- snprintf(buffer, SMTP_BUFFER_MAX, SMTP_HEADERS_CMD,
- conf_data->email_from, smtp_arg->subject);
- /* send the subject field */
- if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
- smtp_arg->stage = ERROR;
-
- memset(buffer, 0, SMTP_BUFFER_MAX);
- snprintf(buffer, SMTP_BUFFER_MAX, SMTP_BODY_CMD,
- smtp_arg->body);
- /* send the the body field */
- if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
- smtp_arg->stage = ERROR;
-
- /* send the sending dot */
- if (send(thread->u.fd, SMTP_SEND_CMD, strlen(SMTP_SEND_CMD), 0)
- == -1)
- smtp_arg->stage = ERROR;
- break;
+ if (!fetched_email)
+ smtp_arg->stage++;
+ } else {
+ DBG("Error processing RCPT cmd");
+ smtp_arg->stage = ERROR;
+ }
- case QUIT:
- if (send(thread->u.fd, SMTP_QUIT_CMD, strlen(SMTP_QUIT_CMD), 0)
- == -1)
- smtp_arg->stage = ERROR;
- break;
+ return 0;
+}
- case ERROR:
- DBG("Can not send data to remote SMTP server [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- /* we just cleanup the room */
- free_smtp_all(smtp_arg);
- close(thread->u.fd);
- FREE(buffer);
- return 0;
- break;
- }
+/* DATA command processing */
+static int
+data_cmd(thread * thread)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
-// printf("Sending : %s", buffer);
+ if (send(thread->u.fd, SMTP_DATA_CMD, strlen(SMTP_DATA_CMD), 0)
+ == -1)
+ smtp_arg->stage = ERROR;
+ return 0;
+}
+static int
+data_code(thread * thread, int status)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
- /* Registering next smtp command processing thread */
- thread_add_read(thread->master, smtp_read_cmd_thread, smtp_arg,
- thread->u.fd, conf_data->smtp_connection_to);
+ if (status == 354) {
+ smtp_arg->stage++;
+ } else {
+ DBG("Error processing DATA cmd");
+ smtp_arg->stage = ERROR;
+ }
- FREE(buffer);
return 0;
}
-/* SMTP checkers threads */
+/* BODY command processing.
+ * Do we need to use mutli-thread for multi-part body
+ * handling ? Don t really think :)
+ */
static int
-smtp_check_thread(thread * thread)
+body_cmd(thread * thread)
{
- smtp_thread_arg *smtp_arg;
- int status;
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+ char *buffer;
- smtp_arg = THREAD_ARG(thread);
+ buffer = (char *)MALLOC(SMTP_BUFFER_MAX);
- status =
- tcp_socket_state(thread->u.fd, thread, conf_data->smtp_server,
- htons(SMTP_PORT)
- , smtp_check_thread);
+ snprintf(buffer, SMTP_BUFFER_MAX, SMTP_HEADERS_CMD,
+ conf_data->email_from, smtp_arg->subject);
- switch (status) {
- case connect_error:
- DBG("Error connecting SMTP server [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- break;
+ /* send the subject field */
+ if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
+ smtp_arg->stage = ERROR;
- case connect_timeout:
- DBG("Timeout writing data to SMTP server [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- break;
+ memset(buffer, 0, SMTP_BUFFER_MAX);
+ snprintf(buffer, SMTP_BUFFER_MAX, SMTP_BODY_CMD,
+ smtp_arg->body);
- case connect_success:
- /* Remote SMTP server is connected.
- * Register the next step thread smtp_cmd_thread.
- */
- DBG("Remote SMTP server [%s:%d] connected.",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- thread_add_write(thread->master, smtp_send_cmd_thread, smtp_arg,
- thread->u.fd, conf_data->smtp_connection_to);
- break;
- }
+ /* send the the body field */
+ if (send(thread->u.fd, buffer, strlen(buffer), 0) == -1)
+ smtp_arg->stage = ERROR;
+
+ /* send the sending dot */
+ if (send(thread->u.fd, SMTP_SEND_CMD, strlen(SMTP_SEND_CMD), 0)
+ == -1)
+ smtp_arg->stage = ERROR;
+ FREE(buffer);
return 0;
}
-
static int
-smtp_connect_thread(thread * thread)
+body_code(thread * thread, int status)
{
- smtp_thread_arg *smtp_arg;
- enum connect_result status;
- int fd;
-
- smtp_arg = THREAD_ARG(thread);
-
- /* Return if no smtp server is defined */
- if (conf_data->smtp_server == 0) {
- free_smtp_all(smtp_arg);
- return 0;
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
+
+ if (status == 250) {
+ syslog(LOG_INFO, "SMTP alert successfully sent.");
+ smtp_arg->stage++;
+ } else {
+ DBG("Error processing DOT cmd");
+ smtp_arg->stage = ERROR;
}
- if ((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
- DBG("SMTP connect fail to create socket.");
- return 0;
- }
+ return 0;
+}
- status = tcp_connect(fd, conf_data->smtp_server, htons(SMTP_PORT));
+/* QUIT command processing */
+static int
+quit_cmd(thread * thread)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
- switch (status) {
- case connect_error:
- DBG("SMTP connection ERROR to [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- close(fd);
- return 0;
- break;
+ if (send(thread->u.fd, SMTP_QUIT_CMD, strlen(SMTP_QUIT_CMD), 0)
+ == -1)
+ smtp_arg->stage = ERROR;
+ else
+ smtp_arg->stage++;
+ return 0;
+}
+static int
+quit_code(thread * thread, int status)
+{
+ smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
- case connect_timeout:
- DBG("Timeout connecting SMTP server [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- free_smtp_all(smtp_arg);
- close(fd);
- return 0;
- break;
+ /* final state, we are disconnected from the remote host */
+ free_smtp_all(smtp_arg);
+ close(thread->u.fd);
+ return 0;
+}
- case connect_success:
- DBG("SMTP connection SUCCESS to [%s:%d].",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- break;
+/* connect remote SMTP server */
+static void
+smtp_connect(smtp_thread_arg *smtp_arg)
+{
+ enum connect_result status;
- /* Checking non-blocking connect, we wait until socket is writable */
- case connect_in_progress:
- DBG("SMTP connection to [%s:%d] now IN_PROGRESS.",
- inet_ntop2(conf_data->smtp_server), SMTP_PORT);
- break;
+ if ((smtp_arg->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))
+ == -1) {
+ DBG("SMTP connect fail to create socket.");
+ free_smtp_all(smtp_arg);
+ return;
}
- /* connection have succeeded or still in progress */
- thread_add_write(thread->master, smtp_check_thread, smtp_arg, fd,
- conf_data->smtp_connection_to);
- return 1;
+ status = tcp_connect(smtp_arg->fd, conf_data->smtp_server,
+ htons(SMTP_PORT));
+
+ /* Handle connection status code */
+ thread_add_event(master, SMTP_FSM[status].send, smtp_arg,
+ smtp_arg->fd);
}
+/* Main entry point */
void
smtp_alert(thread_master * master, real_server * rs, vrrp_rt * vrrp,
const char *subject, const char *body)
smtp_thread_arg *smtp_arg;
/* Only send mail if email specified */
- if (!LIST_ISEMPTY(conf_data->email)) {
+ if (!LIST_ISEMPTY(conf_data->email) &&
+ conf_data->smtp_server != 0) {
/* allocate & initialize smtp argument data structure */
smtp_arg = (smtp_thread_arg *) MALLOC(sizeof (smtp_thread_arg));
smtp_arg->subject = (char *) MALLOC(MAX_HEADERS_LENGTH);
smtp_arg->body = (char *) MALLOC(MAX_BODY_LENGTH);
smtp_arg->buffer = (char *) MALLOC(SMTP_BUFFER_MAX);
- smtp_arg->stage = CONNECTION; /* first smtp command set to HELO */
-
/* format subject if rserver is specified */
if (rs)
snprintf(smtp_arg->subject, MAX_HEADERS_LENGTH,
strncpy(smtp_arg->body, body, MAX_BODY_LENGTH);
- thread_add_event(master, smtp_connect_thread, smtp_arg, 0);
+ smtp_connect(smtp_arg);
}
}
*
* Part: Timer manipulations.
*
- * Version: $Id: timer.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: timer.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: General program utils.
*
- * Version: $Id: utils.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: utils.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
memcpy(dst, tmp, INADDRSZ);
return 1;
}
+
+/* Getting localhost official canonical name */
+char *
+get_local_name(void)
+{
+ struct hostent *host;
+ struct utsname name;
+
+ if (uname(&name) < 0)
+ return NULL;
+
+ if (!(host = gethostbyname(name.nodename)))
+ return NULL;
+
+ return host->h_name;
+}
*
* Part: Vector structure manipulation.
*
- * Version: $Id: vector.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vector.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
delay_loop 6
lb_algo rr
lb_kind NAT
- nat_mask 255.255.255.0
persistence_timeout 50
protocol TCP
check_misc.o ipwrapper.o ipvswrapper.o $(CI_LINUX_OBJ)
ifeq ($(KERNEL),_KRNL_2_2_)
-OBJS += ipfwwrapper.o
-HEADERS += ipfwwrapper.h
+ OBJS += ipfwwrapper.o
+ HEADERS += ipfwwrapper.h
endif
HEADERS = $(OBJS:.o=.h)
distclean: clean
rm -f Makefile
+
+check_api.o: check_api.c ../include/check_api.h ../include/parser.h \
+ ../include/memory.h ../include/utils.h ../include/check_misc.h \
+ ../include/check_tcp.h ../include/check_http.h ../include/check_ssl.h
+check_tcp.o: check_tcp.c ../include/check_tcp.h ../include/check_api.h \
+ ../include/memory.h ../include/ipwrapper.h ../include/layer4.h \
+ ../include/smtp.h ../include/utils.h ../include/parser.h
+check_http.o: check_http.c ../include/check_http.h ../include/check_ssl.h \
+ ../include/check_api.h ../include/memory.h ../include/parser.h \
+ ../include/utils.h
+check_ssl.o: check_ssl.c ../include/check_ssl.h ../include/check_api.h \
+ ../include/memory.h ../include/parser.h ../include/smtp.h \
+ ../include/utils.h
+check_misc.o: check_misc.c ../include/check_misc.h ../include/check_api.h \
+ ../include/memory.h ../include/ipwrapper.h ../include/smtp.h \
+ ../include/utils.h ../include/parser.h ../include/daemon.h
+ipwrapper.o: ipwrapper.c ../include/ipwrapper.h ../include/utils.h
+ipvswrapper.o: ipvswrapper.c ../include/ipvswrapper.h ../include/utils.h
*
* Part: Checkers registration.
*
- * Version: $Id: check_api.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_api.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: CI-LINUX checker. Integration to Compaq Cluster Infrastructure.
*
- * Version: $Id: check_ci.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_ci.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Aneesh Kumar K.V, <aneesh.kumar@digital.com>
*
* Part: WEB CHECK. Common HTTP/SSL checker primitives.
*
- * Version: $Id: check_http.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_http.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
* Part: MISC CHECK. Perform a system call to run an extra
* system prog or script.
*
- * Version: $Id: check_misc.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_misc.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: 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.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_ssl.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: TCP checker.
*
- * Version: $Id: check_tcp.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_tcp.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
* library to add/remove server MASQ rules to the kernel
* firewall framework.
*
- * Version: $Id: ipfwwrapper.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: ipfwwrapper.c,v 0.6.8 2002/07/16 02:41:25 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.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: ipvswrapper.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include "ipvswrapper.h"
#include "utils.h"
+/* local helpers functions */
+static int parse_timeout(char *, unsigned *);
+static int string_to_number(const char *, int, int);
+static int modprobe_ipvs(void);
+
#ifdef _KRNL_2_2_ /* KERNEL 2.2 LVS handling */
int
ctl.u.vs_user.dport = SVR_PORT(rs);
}
+ /* Does the service use inhibit flag ? */
+ if (ctl.m_cmd == IP_MASQ_CMD_DEL_DEST && rs->inhibit) {
+ ctl.m_cmd = IP_MASQ_CMD_SET_DEST;
+ ctl.u.vs_user.weight = 0;
+ }
+ if (ctl.m_cmd == IP_MASQ_CMD_ADD_DEST && rs->inhibit && rs->alive)
+ ctl.m_cmd = IP_MASQ_CMD_SET_DEST;
+
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
if (sockfd == -1) {
syslog(LOG_INFO,
return IPVS_SUCCESS;
}
-#else /* KERNEL 2.4 LVS handling */
-/* 2.4 prototypes */
-static int modprobe_ipvs(void);
+
+
+#else /* KERNEL 2.4 LVS handling */
static int
ipvs_talk(int cmd, struct ip_vs_rule_user *urule)
if (!parse_timeout(vs->timeout_persistence, &urule.timeout))
syslog(LOG_INFO,
"IPVS : Virtual service [%s:%d] illegal timeout.",
- inet_ntop2(SVR_IP(vs))
- , ntohs(SVR_PORT(vs)));
+ inet_ntop2(SVR_IP(vs)), ntohs(SVR_PORT(vs)));
+
if (urule.timeout != 0 || vs->granularity_persistence)
urule.vs_flags = IP_VS_SVC_F_PERSISTENT;
urule.dport = SVR_PORT(rs);
}
+ /* Does the service use inhibit flag ? */
+ if (cmd == IP_VS_SO_SET_DELDEST && rs->inhibit) {
+ urule.weight = 0;
+ cmd = IP_VS_SO_SET_EDITDEST;
+ }
+ if (cmd == IP_VS_SO_SET_ADDDEST && rs->inhibit && rs->alive)
+ cmd = IP_VS_SO_SET_EDITDEST;
+
/* Talk to the IPVS channel */
return ipvs_talk(cmd, &urule);
}
#endif
/*
- * IPVS synchronization daemon state transition
+ * Common IPVS functions
*/
void
ipvs_syncd_master(char *ifname)
}
/*
- * Source code from the ipvsadm.c Wensong code
+ * Utility functions coming from Wensong code
*/
-int
+static int
parse_timeout(char *buf, unsigned *timeout)
{
int i;
if ((i = string_to_number(buf, 0, 86400 * 31)) == -1)
return 0;
- *timeout = i * HZ;
+ *timeout = i * (IP_VS_TEMPLATE_TIMEOUT / (6*60));
return 1;
}
-int
+static int
string_to_number(const char *s, int min, int max)
{
int number;
return -1;
}
-static int modprobe_ipvs(void)
+static int
+modprobe_ipvs(void)
{
char *argv[] = { "/sbin/modprobe", "-s", "-k", "--", "ip_vs", NULL };
int child;
*
* Part: Manipulation functions for IPVS & IPFW wrappers.
*
- * Version: $id: ipwrapper.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $id: ipwrapper.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
}
rs->alive = alive;
- syslog(LOG_INFO, "Adding service [%s:%d] to VS [%s:%d]",
- inet_ntoa2(SVR_IP(rs), rsip)
+ syslog(LOG_INFO, "%s service [%s:%d] to VS [%s:%d]",
+ (rs->inhibit) ? "Enabling" : "Adding"
+ , inet_ntoa2(SVR_IP(rs), rsip)
, ntohs(SVR_PORT(rs))
, inet_ntoa2(SVR_IP(vs), vsip)
, ntohs(SVR_PORT(vs)));
} else {
rs->alive = alive;
- syslog(LOG_INFO, "Removing service [%s:%d] from VS [%s:%d]",
- inet_ntoa2(SVR_IP(rs), rsip)
+ syslog(LOG_INFO, "%s service [%s:%d] from VS [%s:%d]",
+ (rs->inhibit) ? "Disabling" : "Removing"
+ , inet_ntoa2(SVR_IP(rs), rsip)
, ntohs(SVR_PORT(rs))
, inet_ntoa2(SVR_IP(vs), vsip)
, ntohs(SVR_PORT(vs)));
init_service_rs(virtual_server * vs, list l)
{
element e;
+ real_server *rs;
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
- if (!ipvs_cmd(LVS_CMD_ADD_DEST, vs, ELEMENT_DATA(e)))
+ rs = ELEMENT_DATA(e);
+ if (!ipvs_cmd(LVS_CMD_ADD_DEST, vs, rs))
return 0;
+ else
+ rs->alive = 1;
#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, ELEMENT_DATA(e)))
+ if (!ipfw_cmd(IP_FW_CMD_ADD, vs, rs))
return 0;
#endif
}
*
* Part: Checkers arguments structures definitions.
*
- * Version: $Id: check_api.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_api.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: check_ci.c include file.
*
- * Version: $Id: check_ci.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_ci.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Aneesh Kumar K.V, <aneesh.kumar@digital.com>
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_http.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: check_misc.c include file.
*
- * Version: $Id: check_misc.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_misc.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
* Eric Jarman, <ehj38230@cmsu2.cmsu.edu>
*
* Part: check_http.c include file.
*
- * Version: $Id: check_http.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_http.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: check_tcp.c include file.
*
- * Version: $Id: check_tcp.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: check_tcp.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Daemon process handling.
*
- * Version: $Id: daemon.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: daemon.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Dynamic data structure definition.
*
- * Version: $Id: data.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: data.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
uint32_t addr_ip;
uint16_t addr_port;
int weight;
+ int inhibit; /* Set weight to 0 instead of removing
+ * the service from IPVS topology.
+ */
int alive;
} real_server;
*
* Part: ipfwwrapper.c include file.
*
- * Version: $Id: ipfwwrapper.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: ipfwwrapper.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: ipvswrapper.c include file.
*
- * Version: $Id: ipvswrapper.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: ipvswrapper.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include <net/ip_vs.h>
#endif
+#ifndef IP_VS_TEMPLATE_TIMEOUT
+#define IP_VS_TEMPLATE_TIMEOUT IPVS_SVC_PERSISTENT_TIMEOUT
+#endif
+
/* locale includes */
#include "scheduler.h"
#include "data.h"
#ifdef _HAVE_IPVS_SYNCD_
#define IPVS_STARTDAEMON IP_VS_SO_SET_STARTDAEMON
-#define IPVS_STOPDAEMON IP_VS_SO_SET_STOPDAEMON
+#define IPVS_STOPDAEMON IP_VS_SO_SET_STOPDAEMON
#define IPVS_MASTER IP_VS_STATE_MASTER
#define IPVS_BACKUP IP_VS_STATE_BACKUP
#else
extern thread_master *master;
/* prototypes */
-extern int parse_timeout(char *buf, unsigned *timeout);
-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 void ipvs_syncd_master(char *ifname);
*
* Part: ipwrapper.c include file.
*
- * Version: $Id: ipwrapper.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: ipwrapper.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
/* LVS command set by kernel */
#ifdef _KRNL_2_2_
-#define LVS_CMD_ADD IP_MASQ_CMD_ADD
-#define LVS_CMD_DEL IP_MASQ_CMD_DEL
-#define LVS_CMD_ADD_DEST IP_MASQ_CMD_ADD_DEST
-#define LVS_CMD_DEL_DEST IP_MASQ_CMD_DEL_DEST
+#define LVS_CMD_ADD IP_MASQ_CMD_ADD
+#define LVS_CMD_DEL IP_MASQ_CMD_DEL
+#define LVS_CMD_ADD_DEST IP_MASQ_CMD_ADD_DEST
+#define LVS_CMD_DEL_DEST IP_MASQ_CMD_DEL_DEST
+#define LVS_CMD_EDIT_DEST IP_MASQ_CMD_SET_DEST
#else
-#define LVS_CMD_ADD IP_VS_SO_SET_ADD
-#define LVS_CMD_DEL IP_VS_SO_SET_DEL
-#define LVS_CMD_ADD_DEST IP_VS_SO_SET_ADDDEST
-#define LVS_CMD_DEL_DEST IP_VS_SO_SET_DELDEST
+#define LVS_CMD_ADD IP_VS_SO_SET_ADD
+#define LVS_CMD_DEL IP_VS_SO_SET_DEL
+#define LVS_CMD_ADD_DEST IP_VS_SO_SET_ADDDEST
+#define LVS_CMD_DEL_DEST IP_VS_SO_SET_DELDEST
+#define LVS_CMD_EDIT_DEST IP_VS_SO_SET_EDITDEST
#endif
/* prototypes */
*
* Part: layer4.c include file.
*
- * Version: $Id: layer4.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: layer4.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
enum connect_result {
connect_error,
- connect_success,
connect_in_progress,
- connect_timeout
+ connect_timeout,
+ connect_success
};
/* Prototypes defs */
*
* Part: list.c include file.
*
- * Version: $Id: list.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: list.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Main program include file.
*
- * Version: $Id: main.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: main.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
/* Build version */
#define PROG "Keepalived"
-#define VERSION_CODE 0x000606
-#define DATE_CODE 0x030702
+#define VERSION_CODE 0x000608
+#define DATE_CODE 0x0F0702
#define KEEPALIVED_VERSION(version) \
(version >> 16) & 0xFF, \
*
* Part: memory.c include file.
*
- * Version: $Id: memory.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: memory.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Authors: Alexandre Cassen, <acassen@linux-vs.org>
* Jan Holmberg, <jan@artech.net>
*
* Part: cfreader.c include file.
*
- * Version: $Id: parser.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: parser.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: pidfile.c include file.
*
- * Version: $Id: pidfile.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: pidfile.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: scheduler.c include file.
*
- * Version: $Id: scheduler.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: scheduler.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: smtp.c include file.
*
- * Version: $Id: smtp.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: smtp.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
/* globales includes */
#include <netdb.h>
-#include <sys/param.h>
-#include <sys/utsname.h>
/* local includes */
#include "data.h"
#include "vrrp.h"
/* global defs */
-#define SMTP_PORT 25
-#define SMTP_BUFFER_LENGTH 128
-#define SMTP_BUFFER_MAX 256
+#define SMTP_PORT 25
+#define SMTP_BUFFER_LENGTH 128
+#define SMTP_BUFFER_MAX 256
+#define SMTP_MAX_FSM_STATE 10
-/* command stage */
-enum smtp_cmd {
- CONNECTION,
- HELO,
- MAIL,
- RCPT,
- DATA,
- BODY,
- QUIT,
- ERROR
-};
+/* SMTP command stage */
+#define HELO 4
+#define MAIL 5
+#define RCPT 6
+#define DATA 7
+#define BODY 8
+#define QUIT 9
+#define END 10
+#define ERROR 11
/* SMTP thread argument structure */
#define MAX_HEADERS_LENGTH 256
#define MAX_BODY_LENGTH 512
+/* SMTP FSM Macro */
+#define SMTP_FSM_SEND(S, T) \
+do { \
+ if ((*(SMTP_FSM[S].send))) \
+ (*(SMTP_FSM[S].send)) (T); \
+} while (0)
+
+#define SMTP_FSM_READ(S, T, N) \
+do { \
+ if ((*(SMTP_FSM[S].read))) \
+ (*(SMTP_FSM[S].read)) (T, N); \
+} while (0)
+
+/* SMTP thread arguments */
typedef struct _smtp_thread_arg {
- enum smtp_cmd stage;
+ int fd;
+ int stage;
int email_it;
char *subject;
char *body;
long buflen;
} smtp_thread_arg;
-/* Smtp command string processing */
+/* SMTP command string processing */
#define SMTP_HELO_CMD "HELO %s\r\n"
#define SMTP_MAIL_CMD "MAIL FROM:<%s>\r\n"
#define SMTP_RCPT_CMD "RCPT TO:<%s>\r\n"
#define SMTP_DATA_CMD "DATA\r\n"
-#define SMTP_HEADERS_CMD "From: %s\r\nSubject: %s\r\nX-Mailer: Keepalived\r\n\r\n"
+#define SMTP_HEADERS_CMD "From: %s\r\nSubject: %s\r\n" \
+ "X-Mailer: Keepalived\r\n\r\n"
#define SMTP_BODY_CMD "\r\n\r\n%s\r\n\r\n"
#define SMTP_SEND_CMD "\r\n.\r\n"
#define SMTP_QUIT_CMD "QUIT\r\n"
*
* Part: timer.c include file.
*
- * Version: $Id: timer.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: timer.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: utils.h include file.
*
- * Version: $Id: utils.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: utils.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
#include <string.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <sys/param.h>
+#include <sys/utsname.h>
+#include <netdb.h>
/* Global debugging logging facilities */
#ifdef _DEBUG_
extern char *inet_ntoa2(uint32_t ip, char *buf);
extern uint8_t inet_stom(char *addr);
extern int inet_ston(const char *addr, uint32_t * dst);
+extern char *get_local_name(void);
#endif
*
* Part: vector.c include file.
*
- * Version: $Id: vector.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vector.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp.c program include file.
*
- * Version: $Id: vrrp.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
/* prototypes */
extern int open_vrrp_socket(const int proto, const int index);
-extern void new_vrrp_socket(vrrp_rt * vrrp);
+extern int new_vrrp_socket(vrrp_rt * vrrp);
extern void close_vrrp_socket(vrrp_rt * vrrp);
extern void vrrp_send_gratuitous_arp(vrrp_rt * vrrp);
extern int vrrp_send_adv(vrrp_rt * vrrp, int prio);
*
* Part: vrrp_if.c include file.
*
- * Version: $Id: vrrp_if.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_if.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_ipaddress.c include file.
*
- * Version: $Id: vrrp_ipaddress.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_ipsecah.c include file.
*
- * Version: $Id: vrrp_ipsecah.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_netlink.c include file.
*
- * Version: $Id: vrrp_netlink.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_netlink.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_notify.c include file.
*
- * Version: $Id: vrrp_notify.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_notify.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_scheduler.c include file.
*
- * Version: $Id: vrrp_scheduler.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_scheduler.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: vrrp_sync.c include file.
*
- * Version: $Id: vrrp_sync.h,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_sync.h,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
+/*
+ * libipvs.h: header file for the library ipvs
+ *
+ * Version: $Id: libipvs.h,v 1.3 2002/07/09 14:41:19 wensong Exp $
+ *
+ * Authors: Wensong Zhang <wensong@linuxvirtualserver.org>
+ *
+ */
+
#ifndef _LIBIPVS_H
#define _LIBIPVS_H
#include <net/ip_vs.h>
+/*
+ * The default IPVS_SVC_PERSISTENT_TIMEOUT is a little larger than average
+ * connection time plus IPVS TCP FIN timeout (2*60 seconds). Because the
+ * connection template won't be released until its controlled connection
+ * entries are expired.
+ * If IPVS_SVC_PERSISTENT_TIMEOUT is too less, the template will expire
+ * soon and will be put in expire again and again, which causes additional
+ * overhead. If it is too large, the same will always visit the same
+ * server, which may make dynamic load imbalance worse.
+ */
+#define IPVS_SVC_PERSISTENT_TIMEOUT (6*60)
+
/* ipvs info variable */
extern struct ip_vs_getinfo ipvs_info;
--- /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
+ persistence_timeout 50
+ protocol TCP
+
+
+ real_server 192.168.200.2 1358 {
+ weight 1
+ inhibit_on_failure ! set weight to 0 instead of removing service
+ HTTP_GET {
+ url {
+ path /testurl3/test.jsp
+ digest 640205b7b0fc66c1ea91c463fac6334d
+ }
+ connect_timeout 3
+ nb_get_retry 3
+ delay_before_retry 3
+ }
+ }
+}
lvs_id LVS_DEVEL
}
-vrrp_sync_group G1 {
- VI_1
- VI_2
-}
-
vrrp_instance VI_1 {
interface eth0
virtual_router_id 50
preempt
- authentication {
- auth_type AH
- auth_pass k@!v361
- }
priority 100
advert_int 1
virtual_ipaddress {
}
}
-vrrp_instance VI_2 {
- interface eth1
- virtual_router_id 51
- authentication {
- auth_type AH
- auth_pass k@!v362
- }
- priority 100
- advert_int 1
- virtual_ipaddress {
- 192.168.201.11
- 192.168.201.12
- 192.168.201.13
- }
-}
-
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
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
- }
- }
-}
-
-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
}
distclean: clean
rm -f Makefile
+
+vrrp.o: vrrp.c ../include/vrrp.h ../include/vrrp_scheduler.h \
+ ../include/vrrp_notify.h ../include/ipvswrapper.h ../include/memory.h \
+ ../include/list.h ../include/data.h
+vrrp_notify.o: vrrp_notify.c ../include/vrrp_notify.h ../include/memory.h
+vrrp_scheduler.o: vrrp_scheduler.c ../include/vrrp_scheduler.h \
+ ../include/vrrp_ipsecah.h ../include/vrrp_if.h ../include/vrrp.h \
+ ../include/vrrp_sync.h ../include/vrrp_notify.h ../include/ipvswrapper.h \
+ ../include/memory.h ../include/list.h ../include/data.h ../include/smtp.h
+vrrp_sync.o: vrrp_sync.c ../include/vrrp_sync.h ../include/vrrp_if.h \
+ ../include/vrrp_notify.h ../include/data.h
+vrrp_netlink.o: vrrp_netlink.c ../include/vrrp_netlink.h ../include/check_api.h \
+ ../include/vrrp_if.h ../include/memory.h ../include/scheduler.h \
+ ../include/utils.h
+vrrp_if.o: vrrp_if.c ../include/vrrp_if.h ../include/vrrp_netlink.h \
+ ../include/scheduler.h ../include/data.h ../include/memory.h \
+ ../include/utils.h
+vrrp_ipaddress.o: vrrp_ipaddress.c ../include/vrrp_ipaddress.h \
+ ../include/vrrp_netlink.h ../include/utils.h
+vrrp_ipsecah.o: vrrp_ipsecah.c ../include/vrrp_ipsecah.h
* master fails, a backup server takes over.
* The original implementation has been made by jerome etienne.
*
- * Version: $Id: vrrp.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
/* build the address */
memset(&from, 0, sizeof (from));
- strncpy(from.sa_data, IF_NAME(vrrp->ifp), IF_NAMESIZ);
+ strncpy(from.sa_data, IF_NAME(vrrp->ifp), sizeof(from.sa_data));
//print_buffer(buflen, buffer);
interface *ifp;
int fd;
int ret;
- int retry_num = 0;
/* Retreive interface */
ifp = if_get_by_ifindex(index);
/* -> Need to handle multicast convergance after takeover.
* We retry until multicast is available on the interface.
- * After VRRP_MCAST_RETRY we assume interface doesn't support
- * multicast then exist with error.
- * -> This can sound a little nasty since it degrade a little
- * the global scheduling timers.
*/
-moretry:
ret =
setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &req_add,
sizeof (struct ip_mreqn));
if (ret < 0) {
syslog(LOG_INFO, "cant do IP_ADD_MEMBERSHIP errno=%s (%d)",
strerror(errno), errno);
- if (errno == 19) {
- retry_num++;
- if (retry_num > VRRP_MCAST_RETRY) {
- syslog(LOG_INFO,
- "cant do IP_ADD_MEMBERSHIP after %d retry errno=%s",
- VRRP_MCAST_RETRY, strerror(errno));
- return -1;
- }
- sleep(1); /* FIXME: Beurk... Very nasty... !!! */
- goto moretry;
- }
+ close(fd);
return -1;
}
struct ip_mreqn req_add;
int ret = 0;
+ /* If fd is -1 then we add a membership trouble */
+ if (vrrp->fd < 0)
+ return;
+
/* Leaving the VRRP multicast group */
memset(&req_add, 0, sizeof (req_add));
req_add.imr_multiaddr.s_addr = htonl(INADDR_VRRP_GROUP);
close(vrrp->fd);
}
-void
+int
new_vrrp_socket(vrrp_rt * vrrp)
{
int old_fd = vrrp->fd;
if (vrrp_ptr->fd == old_fd)
vrrp_ptr->fd = vrrp->fd;
}
+
+ return vrrp->fd;
}
/* handle terminate state */
*
* Part: Interfaces manipulation.
*
- * Version: $Id: vrrp_if.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_if.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: NETLINK IPv4 address manipulation.
*
- * Version: $Id: vrrp_ipaddress.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_ipaddress.c,v 0.6.8 2002/07/16 02:41:25 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.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_ipsecah.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: NETLINK kernel command channel.
*
- * Version: $Id: vrrp_netlink.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_netlink.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: VRRP state transition notification scripts handling.
*
- * Version: $Id: vrrp_notify.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_notify.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
*
* Part: Sheduling framework for vrrp code.
*
- * Version: $Id: vrrp_scheduler.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_scheduler.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
void (*read) (vrrp_rt *, char *, int);
void (*read_to) (vrrp_rt *);
} VRRP_FSM[VRRP_MAX_FSM_STATE + 1] = {
-/* Stream Read Handlers | Stream Read_to handlers */
-/*------------------------------+------------------------------*/
+/* Stream Read Handlers | Stream Read_to handlers *
+ *------------------------------+------------------------------*/
{NULL, NULL},
{vrrp_backup, vrrp_goto_master}, /* BACKUP */
{vrrp_leave_master, vrrp_master}, /* MASTER */
return;
/* refresh the multicast fd */
- new_vrrp_socket(vrrp);
+ if (new_vrrp_socket(vrrp) < 0)
+ return;
/*
* We force the IPSEC AH seq_number sync
*
* Part: VRRP synchronization framework.
*
- * Version: $Id: vrrp_sync.c,v 0.6.5 2002/07/01 23:41:28 acassen Exp $
+ * Version: $Id: vrrp_sync.c,v 0.6.8 2002/07/16 02:41:25 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*