[-]
[+]
|
Changed |
keepalived.changes
|
|
[-]
[+]
|
Changed |
keepalived.spec
^
|
|
|
Deleted |
keepalived-1.2.3.tar.bz2
^
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/ChangeLog
^
|
@@ -1,3 +1,67 @@
+2012-07-27 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-1.2.4 released.
+ * Please look at git repo for credits.
+ * remove CR from manpage
+ * check: fix pid display in syslog messages
+ * vrrp: better documentation of the limitation on password
+ length
+ * cosmetics to be pleasant with GCC4
+ * Update autoconf script to properly detect VRRP VMAC
+ support
+ * security: Fix exploitable issue in sighandler !
+ * Add datarootdir to Makefile.in files.
+ * Fix logging to console.
+ * Remove newlines from log_message calls.
+
+2012-07-13 Alexandre Cassen <acassen@linux-vs.org>
+ * keepalived-1.2.3 released.
+ * Please look at git repo for credits.
+ * VRRP : allow group to use priority with 'global_tracking'
+ group keyword
+ * VRRP : Adjust TOS values. The TOS value used by other
+ vendors is ip precedence 6, so change that. Use socket
+ priority option to force packets into band 0 of pfifo_fast.
+ * VRRP : Fix sync-group thrashing.The sync group implementation
+ was not very robust. If one synced instance lost communication
+ without going to fault state then all synced intances would
+ transition to master. Following this all instances would
+ transition back to backup because they heard higher priority
+ advertisements. This thrashing would continue indefinitely.
+ To fix this the sync-group code was made to prefer backup state.
+ That is, the sync-groups don't sync to master state unless
+ every instance wants to be master.
+ * VRRP : Fix dst lladdr in IPv6 Unsollicited NA.
+ * VRRP : fix pid display in syslog messages.
+ * Fix configure script to correctly identify kernel version.
+ * check : handle unspecified sockaddr_storage when comparing
+ * VRRP : ensure VRRP script interval and GARP delay is not 0.
+ * check: ensure non 0 default values for timeouts.
+ * VRRP : Fix priority not changing on reload.
+ * check : Fix IPv4 address comparison routine.
+ * Don't use bind() with AF_UNSPEC.
+ * check : enable the use of fwmark with IPv6 virtual servers.
+ * Fix modprobe arguments.
+ * Fix double ntohs() in SMTP checker.
+ * Pretty-print IP:port as [%s]:%d.
+ * check : keep retry in case of early TCP failures in checks.
+ * when specifying an IPv6 range, range is hexadecimal value.
+ * Only define kernel types for ip_vs.h header to avoid problems
+ when loading other headers.
+ * When respawning VRRP or check process, use LOG_ALERT.
+ * Do not set reload flag in the main process.
+ * Set correct rights on PID file.
+ * fix 'gratuitous' typos.
+ * ipvs: don't include linux/types.h or asm/types.h.
+ * configure: check for nl_socket_modify_cb for libnl.
+ * configure: don't check for IPVS support with kernel 2.6.x.
+ * VRRP : On shutdown, release sockets later to be able to send
+ shutdown packet.
+ * fix documentation on linkbeat_use_polling keyword.
+ * Fix a typo for healthchecker.
+ * fix syslog message if bogous vrrp packet (wrong auth type)
+ received.
+ * manpage update.
+
2011-01-09 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.2.2 released.
* IPv6 : extended autoconf script to support libnl detection.
@@ -218,7 +282,7 @@
linkwatch has been around for long time so set it as
default strategy. Alternatively you can choose to use
MII BSMR polling strategy by adding new keyword
- 'vrrp_linkbeat_use_polling' in your configuration file.
+ 'linkbeat_use_polling' in your configuration file.
* Vincent Bernat <bernat <at> luffy.cx> fixed ip_vs.h includes.
* Removed vrrp_running and check_running test since it is
already performed by keepalived_running.
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/VERSION
^
|
@@ -1 +1 @@
-1.2.2
+1.2.4
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/configure
^
|
@@ -1,11 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65.
+# Generated by GNU Autoconf 2.68.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -89,6 +89,7 @@
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -214,11 +215,18 @@
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
fi
if test x$as_have_required = xno; then :
@@ -316,7 +324,7 @@
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -356,19 +364,19 @@
fi # as_fn_arith
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
- as_status=$?; test $as_status -eq 0 && as_status=1
- if test "$3"; then
- as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $1" >&2
+ $as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -530,7 +538,7 @@
exec 6>&1
# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -599,6 +607,7 @@
VERSION_DATE
VERSION
DFLAGS
+VRRP_VMAC
IPVS_SYNCD
KERN
EGREP
@@ -735,8 +744,9 @@
fi
case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
@@ -781,7 +791,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -807,7 +817,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1011,7 +1021,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1027,7 +1037,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1057,8 +1067,8 @@
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
;;
*=*)
@@ -1066,7 +1076,7 @@
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
@@ -1076,7 +1086,7 @@
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
@@ -1084,13 +1094,13 @@
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error "missing argument to $ac_option"
+ as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
- fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1113,7 +1123,7 @@
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1127,8 +1137,8 @@
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1143,9 +1153,9 @@
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error "working directory cannot be determined"
+ as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error "pwd does not report name of working directory"
+ as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
@@ -1184,11 +1194,11 @@
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1228,7 +1238,7 @@
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
+ -q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
@@ -1370,9 +1380,9 @@
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.65
+generated by GNU Autoconf 2.68
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1416,7 +1426,7 @@
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
@@ -1442,7 +1452,7 @@
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } >/dev/null && {
+ test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
@@ -1453,7 +1463,7 @@
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
@@ -1495,7 +1505,7 @@
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_run
@@ -1508,10 +1518,10 @@
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
@@ -1547,7 +1557,7 @@
else
ac_header_preproc=no
fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
@@ -1574,7 +1584,7 @@
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
@@ -1583,7 +1593,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_mongrel
@@ -1596,7 +1606,7 @@
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1614,19 +1624,22 @@
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
-# ac_fn_c_check_decl LINENO SYMBOL VAR
-# ------------------------------------
-# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1635,8 +1648,12 @@
int
main ()
{
-#ifndef $2
- (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
#endif
;
@@ -1653,7 +1670,7 @@
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_decl
@@ -1698,7 +1715,7 @@
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
@@ -1712,7 +1729,7 @@
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
@@ -1753,7 +1770,7 @@
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
@@ -1765,7 +1782,7 @@
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1820,7 +1837,7 @@
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
cat >config.log <<_ACEOF
@@ -1828,7 +1845,7 @@
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -1938,11 +1955,9 @@
{
echo
- cat <<\_ASBOX
-## ---------------- ##
+ $as_echo "## ---------------- ##
## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
@@ -1976,11 +1991,9 @@
)
echo
- cat <<\_ASBOX
-## ----------------- ##
+ $as_echo "## ----------------- ##
## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
@@ -1993,11 +2006,9 @@
echo
if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
+ $as_echo "## ------------------- ##
## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
@@ -2011,11 +2022,9 @@
fi
if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
+ $as_echo "## ----------- ##
## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
echo
cat confdefs.h
echo
@@ -2070,7 +2079,12 @@
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- ac_site_file1=$CONFIG_SITE
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
@@ -2085,7 +2099,11 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
fi
done
@@ -2161,7 +2179,7 @@
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -2188,7 +2206,7 @@
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2228,7 +2246,7 @@
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
@@ -2281,7 +2299,7 @@
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2321,7 +2339,7 @@
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2380,7 +2398,7 @@
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -2424,7 +2442,7 @@
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
@@ -2478,8 +2496,8 @@
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -2593,9 +2611,8 @@
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ as_fn_set_status 77
-as_fn_error "C compiler cannot create executables
-See \`config.log' for more details." "$LINENO" 5; }; }
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -2637,8 +2654,8 @@
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -2695,9 +2712,9 @@
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
+as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
@@ -2708,7 +2725,7 @@
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2748,8 +2765,8 @@
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@@ -2759,7 +2776,7 @@
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2796,7 +2813,7 @@
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
@@ -2874,7 +2891,7 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
@@ -2971,16 +2988,22 @@
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- for ac_t in install-sh install.sh shtool; do
- if test -f "$ac_dir/$ac_t"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/$ac_t -c"
- break 2
- fi
- done
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
done
if test -z "$ac_aux_dir"; then
- as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
@@ -3009,7 +3032,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3090,7 +3113,7 @@
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
@@ -3130,7 +3153,7 @@
set dummy strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
@@ -3233,7 +3256,7 @@
CPP=
fi
if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then :
+ if ${ac_cv_prog_CPP+:} false; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
@@ -3263,7 +3286,7 @@
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -3279,11 +3302,11 @@
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
break
fi
@@ -3322,7 +3345,7 @@
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -3338,18 +3361,18 @@
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
@@ -3361,7 +3384,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
@@ -3410,7 +3433,7 @@
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
- as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
@@ -3424,7 +3447,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -3476,7 +3499,7 @@
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
- as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
@@ -3491,7 +3514,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3603,7 +3626,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then :
+if ${ac_cv_header_sys_wait_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3649,8 +3672,7 @@
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -3664,8 +3686,7 @@
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -3678,14 +3699,13 @@
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
else
- as_fn_error "
+ as_fn_error $? "
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!" "$LINENO" 5
fi
@@ -3694,7 +3714,7 @@
ac_fn_c_check_decl "$LINENO" "ETHERTYPE_IPV6" "ac_cv_have_decl_ETHERTYPE_IPV6" "#include <net/ethernet.h>
"
-if test "x$ac_cv_have_decl_ETHERTYPE_IPV6" = x""yes; then :
+if test "x$ac_cv_have_decl_ETHERTYPE_IPV6" = xyes; then :
else
CFLAGS="$CFLAGS -DETHERTYPE_IPV6=0x86dd"
@@ -3703,7 +3723,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Init in -lcrypto" >&5
$as_echo_n "checking for MD5_Init in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_MD5_Init+set}" = set; then :
+if ${ac_cv_lib_crypto_MD5_Init+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -3737,7 +3757,7 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Init" >&5
$as_echo "$ac_cv_lib_crypto_MD5_Init" >&6; }
-if test "x$ac_cv_lib_crypto_MD5_Init" = x""yes; then :
+if test "x$ac_cv_lib_crypto_MD5_Init" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBCRYPTO 1
_ACEOF
@@ -3745,12 +3765,12 @@
LIBS="-lcrypto $LIBS"
else
- as_fn_error "OpenSSL libraries are required" "$LINENO" 5
+ as_fn_error $? "OpenSSL libraries are required" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5
$as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; }
-if test "${ac_cv_lib_ssl_SSL_CTX_new+set}" = set; then :
+if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -3784,7 +3804,7 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5
$as_echo "$ac_cv_lib_ssl_SSL_CTX_new" >&6; }
-if test "x$ac_cv_lib_ssl_SSL_CTX_new" = x""yes; then :
+if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSSL 1
_ACEOF
@@ -3792,12 +3812,12 @@
LIBS="-lssl $LIBS"
else
- as_fn_error "OpenSSL libraries are required" "$LINENO" 5
+ as_fn_error $? "OpenSSL libraries are required" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for poptGetContext in -lpopt" >&5
$as_echo_n "checking for poptGetContext in -lpopt... " >&6; }
-if test "${ac_cv_lib_popt_poptGetContext+set}" = set; then :
+if ${ac_cv_lib_popt_poptGetContext+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -3831,7 +3851,7 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptGetContext" >&5
$as_echo "$ac_cv_lib_popt_poptGetContext" >&6; }
-if test "x$ac_cv_lib_popt_poptGetContext" = x""yes; then :
+if test "x$ac_cv_lib_popt_poptGetContext" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPOPT 1
_ACEOF
@@ -3839,12 +3859,12 @@
LIBS="-lpopt $LIBS"
else
- as_fn_error "Popt libraries is required" "$LINENO" 5
+ as_fn_error $? "Popt libraries is required" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_handle_alloc in -lnl" >&5
-$as_echo_n "checking for nl_handle_alloc in -lnl... " >&6; }
-if test "${ac_cv_lib_nl_nl_handle_alloc+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_socket_modify_cb in -lnl" >&5
+$as_echo_n "checking for nl_socket_modify_cb in -lnl... " >&6; }
+if ${ac_cv_lib_nl_nl_socket_modify_cb+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -3858,27 +3878,27 @@
#ifdef __cplusplus
extern "C"
#endif
-char nl_handle_alloc ();
+char nl_socket_modify_cb ();
int
main ()
{
-return nl_handle_alloc ();
+return nl_socket_modify_cb ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_nl_nl_handle_alloc=yes
+ ac_cv_lib_nl_nl_socket_modify_cb=yes
else
- ac_cv_lib_nl_nl_handle_alloc=no
+ ac_cv_lib_nl_nl_socket_modify_cb=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nl_nl_handle_alloc" >&5
-$as_echo "$ac_cv_lib_nl_nl_handle_alloc" >&6; }
-if test "x$ac_cv_lib_nl_nl_handle_alloc" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nl_nl_socket_modify_cb" >&5
+$as_echo "$ac_cv_lib_nl_nl_socket_modify_cb" >&6; }
+if test "x$ac_cv_lib_nl_nl_socket_modify_cb" = xyes; then :
USE_NL="LIBIPVS_USE_NL"
LIBS="$LIBS -lnl"
@@ -3956,9 +3976,9 @@
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_MAJOR.$LINUX_MINOR.$LINUX_PATCH" >&5
$as_echo "$LINUX_MAJOR.$LINUX_MINOR.$LINUX_PATCH" >&6; }
- if test "$LINUX_MINOR" = "6"; then
+ if test "$LINUX_MAJOR" = "2" && test "$LINUX_MINOR" = "6"; then
KERN="_KRNL_2_6_"
- elif test "$LINUX_MINOR" = "4"; then
+ elif test "$LINUX_MAJOR" = "2" && test "$LINUX_MINOR" = "4"; then
KERN="_KRNL_2_4_"
else
KERN="_KRNL_2_6_"
@@ -3973,22 +3993,26 @@
IPVS_SUPPORT="_WITHOUT_LVS_"
if test "$enable_lvs" != "no"; then
- ac_fn_c_check_header_mongrel "$LINENO" "net/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
-if test "x$ac_cv_header_net_ip_vs_h" = x""yes; then :
+ if test "$KERN" = "_KRNL_2_6_"; then
+ IPVS_SUPPORT="_WITH_LVS_"
+ else
+ ac_fn_c_check_header_mongrel "$LINENO" "net/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_ip_vs_h" = xyes; then :
IPVS_SUPPORT="_WITH_LVS_"
else
- IPVS_SUPPORT="_WITHOUT_LVS_"
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: keepalived will be built without LVS support." >&5
+ IPVS_SUPPORT="_WITHOUT_LVS_"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: keepalived will be built without LVS support." >&5
$as_echo "$as_me: WARNING: keepalived will be built without LVS support." >&2;}
fi
+ fi
fi
if test "$IPVS_SUPPORT" = "_WITHOUT_LVS_" -a "$enable_vrrp" = "no"; then
- as_fn_error "keepalived MUST be compiled at least with LVS or VRRP framework" "$LINENO" 5
+ as_fn_error $? "keepalived MUST be compiled at least with LVS or VRRP framework" "$LINENO" 5
fi
IPVS_SYNCD="_WITHOUT_IPVS_SYNCD_"
@@ -4023,6 +4047,47 @@
VRRP_SUPPORT="_WITH_VRRP_"
fi
+CPPFLAGS="$CPPFLAGS -I$kernelinc"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel macvlan support" >&5
+$as_echo_n "checking for kernel macvlan support... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <bits/sockaddr.h>
+ #include <linux/if_link.h>
+ int macvlan;
+
+int
+main ()
+{
+
+ macvlan = IFLA_MACVLAN_MODE;
+ macvlan = MACVLAN_MODE_PRIVATE;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ MACVLAN_SUPPORT=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext;
+
+ if test "$MACVLAN_SUPPORT" = "yes"; then
+ VRRP_VMAC="_HAVE_VRRP_VMAC_"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ VRRP_VMAC="_WITHOUT_VRRP_VMAC_"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+
+
+
+
if test "${enable_debug}" = "yes"; then
DFLAGS="-D_DEBUG_"
@@ -4040,7 +4105,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then :
+if ${ac_cv_c_const+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4119,7 +4184,7 @@
fi
ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = x""yes; then :
+if test "x$ac_cv_type_pid_t" = xyes; then :
else
@@ -4131,7 +4196,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
+if ${ac_cv_header_time+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4168,7 +4233,7 @@
if test $ac_cv_c_compiler_gnu = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
$as_echo_n "checking whether $CC needs -traditional... " >&6; }
-if test "${ac_cv_prog_gcc_traditional+set}" = set; then :
+if ${ac_cv_prog_gcc_traditional+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_pattern="Autoconf.*'x'"
@@ -4209,7 +4274,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
$as_echo_n "checking for working memcmp... " >&6; }
-if test "${ac_cv_func_memcmp_working+set}" = set; then :
+if ${ac_cv_func_memcmp_working+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
@@ -4271,7 +4336,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
$as_echo_n "checking return type of signal handlers... " >&6; }
-if test "${ac_cv_type_signal+set}" = set; then :
+if ${ac_cv_type_signal+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4306,8 +4371,7 @@
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -4394,10 +4458,21 @@
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
+ if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -4449,6 +4524,7 @@
ac_libobjs=
ac_ltlibobjs=
+U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -4464,7 +4540,7 @@
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -4565,6 +4641,7 @@
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4610,19 +4687,19 @@
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
- as_status=$?; test $as_status -eq 0 && as_status=1
- if test "$3"; then
- as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $1" >&2
+ $as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -4818,7 +4895,7 @@
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -4872,7 +4949,7 @@
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -4925,10 +5002,10 @@
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.65,
+configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -4944,11 +5021,16 @@
while test $# != 0
do
case $1 in
- --*=*)
+ --*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
*)
ac_option=$1
ac_optarg=$2
@@ -4970,6 +5052,7 @@
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
@@ -4980,7 +5063,7 @@
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error "unrecognized option: \`$1'
+ -*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
@@ -5031,7 +5114,7 @@
case $ac_config_target in
"$OUTPUT_TARGET") CONFIG_FILES="$CONFIG_FILES $OUTPUT_TARGET" ;;
- *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -5052,9 +5135,10 @@
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- tmp=
+ tmp= ac_tmp=
trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
@@ -5062,12 +5146,13 @@
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
+ test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
@@ -5084,12 +5169,12 @@
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\r'
+ ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
@@ -5098,18 +5183,18 @@
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -5117,7 +5202,7 @@
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
@@ -5165,7 +5250,7 @@
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
@@ -5197,21 +5282,29 @@
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
- || as_fn_error "could not setup config files machinery" "$LINENO" 5
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
s/^[^=]*=[ ]*$//
}'
fi
@@ -5229,7 +5322,7 @@
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -5248,7 +5341,7 @@
for ac_f
do
case $ac_f in
- -) ac_f="$tmp/stdin";;
+ -) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
@@ -5257,7 +5350,7 @@
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -5283,8 +5376,8 @@
esac
case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin" \
- || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -5414,23 +5507,24 @@
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
+which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
+which seems to be undefined. Please make sure it is defined" >&2;}
- rm -f "$tmp/stdin"
+ rm -f "$ac_tmp/stdin"
case $ac_file in
- -) cat "$tmp/out" && rm -f "$tmp/out";;
- *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
@@ -5445,7 +5539,7 @@
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
- as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
@@ -5466,7 +5560,7 @@
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit $?
+ $ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
@@ -5507,6 +5601,11 @@
if test "${VRRP_SUPPORT}" = "_WITH_VRRP_"; then
echo "Use VRRP Framework : Yes"
+ if test "${VRRP_VMAC}" = "_HAVE_VRRP_VMAC_"; then
+ echo "Use VRRP VMAC : Yes"
+ else
+ echo "Use VRRP VMAC : No"
+ fi
else
echo "Use VRRP Framework : No"
fi
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/configure.in
^
|
@@ -51,7 +51,7 @@
AC_CHECK_LIB(crypto, MD5_Init,,AC_MSG_ERROR([OpenSSL libraries are required]))
AC_CHECK_LIB(ssl, SSL_CTX_new,,AC_MSG_ERROR([OpenSSL libraries are required]))
AC_CHECK_LIB(popt, poptGetContext,,AC_MSG_ERROR([Popt libraries is required]))
-AC_CHECK_LIB(nl, nl_handle_alloc,
+AC_CHECK_LIB(nl, nl_socket_modify_cb,
[
USE_NL="LIBIPVS_USE_NL"
LIBS="$LIBS -lnl"
@@ -107,9 +107,9 @@
AC_MSG_RESULT([2.6])
else
AC_MSG_RESULT([$LINUX_MAJOR.$LINUX_MINOR.$LINUX_PATCH])
- if test "$LINUX_MINOR" = "6"; then
+ if test "$LINUX_MAJOR" = "2" && test "$LINUX_MINOR" = "6"; then
KERN="_KRNL_2_6_"
- elif test "$LINUX_MINOR" = "4"; then
+ elif test "$LINUX_MAJOR" = "2" && test "$LINUX_MINOR" = "4"; then
KERN="_KRNL_2_4_"
else
KERN="_KRNL_2_6_"
@@ -124,12 +124,16 @@
dnl ----[ Checks for LVS and VRRP support ]----
IPVS_SUPPORT="_WITHOUT_LVS_"
if test "$enable_lvs" != "no"; then
- AC_CHECK_HEADER([net/ip_vs.h],
- [IPVS_SUPPORT="_WITH_LVS_"],
- [
- IPVS_SUPPORT="_WITHOUT_LVS_"
- AC_MSG_WARN([keepalived will be built without LVS support.])
- ])
+ if test "$KERN" = "_KRNL_2_6_"; then
+ IPVS_SUPPORT="_WITH_LVS_"
+ else
+ AC_CHECK_HEADER([net/ip_vs.h],
+ [IPVS_SUPPORT="_WITH_LVS_"],
+ [
+ IPVS_SUPPORT="_WITHOUT_LVS_"
+ AC_MSG_WARN([keepalived will be built without LVS support.])
+ ])
+ fi
fi
if test "$IPVS_SUPPORT" = "_WITHOUT_LVS_" -a "$enable_vrrp" = "no"; then
@@ -167,11 +171,38 @@
VRRP_SUPPORT="_WITH_VRRP_"
fi
+dnl ----[ Checks for kernel VMAC support ]----
+CPPFLAGS="$CPPFLAGS -I$kernelinc"
+AC_MSG_CHECKING([for kernel macvlan support])
+AC_TRY_COMPILE([
+ #include <bits/sockaddr.h>
+ #include <linux/if_link.h>
+ int macvlan;
+ ], [
+ macvlan = IFLA_MACVLAN_MODE;
+ macvlan = MACVLAN_MODE_PRIVATE;
+ ], [
+ MACVLAN_SUPPORT=yes
+ ], []);
+
+ if test "$MACVLAN_SUPPORT" = "yes"; then
+ VRRP_VMAC="_HAVE_VRRP_VMAC_"
+ AC_MSG_RESULT([yes])
+ else
+ VRRP_VMAC="_WITHOUT_VRRP_VMAC_"
+ AC_MSG_RESULT([no])
+ fi
+
+AC_SUBST(VRRP_VMAC)
+
+
+dnl ----[ Debug or not ? ]----
if test "${enable_debug}" = "yes"; then
DFLAGS="-D_DEBUG_"
AC_SUBST(DFLAGS)
fi
+dnl ----[ Profiling or not ? ]----
if test "${enable_profile}" = "yes"; then
CFLAGS="$CFLAGS -pg"
fi
@@ -243,6 +274,11 @@
if test "${VRRP_SUPPORT}" = "_WITH_VRRP_"; then
echo "Use VRRP Framework : Yes"
+ if test "${VRRP_VMAC}" = "_HAVE_VRRP_VMAC_"; then
+ echo "Use VRRP VMAC : Yes"
+ else
+ echo "Use VRRP VMAC : No"
+ fi
else
echo "Use VRRP Framework : No"
fi
|
[-]
[+]
|
Added |
keepalived-1.2.4.tar.bz2/doc/NOTE_vrrp_vmac.txt
^
|
@@ -0,0 +1,82 @@
+
+
+ Note on using VRRP with Virtual MAC address
+ =============================================
+ Alexandre Cassen
+ July 11th 2012
+
+
+To reduce takeover impact, some networking environment would require using
+VRRP with VMAC address. To reach that goal Keepalived VRRP framework implements
+VMAC support by the invocation of 'use_vmac' keyword in configuration file.
+
+Internally, Keepalived code will bring up virtual interfaces, each interface
+dedicated to a specific virtual_router. Keepalived uses Liunx kernel macvlan
+driver to defines thoses interfaces. It is then mandatory to use kernel
+compiled with macvlan support.
+
+In addition we can mention that VRRP VMAC will work only with kernel including
+the following patch :
+
+http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=729e72a10930ef765c11a5a35031ba47f18221c4
+
+By default MACVLAN interface are in VEPA mode which filters out received
+packets whose MAC source address matches that of the MACVLAN interface. Setting
+MACVLAN interface in private mode will not filter based on source MAC address.
+
+You also need to tweak your physical interfaces to play around with well knwon
+ARP issue. I would recommand using the following configurations :
+
+1) Global configuration
+
+ net.ipv4.conf.all.arp_ignore = 1
+ net.ipv4.conf.all.arp_announce = 1
+ net.ipv4.conf.all.arp_filter = 0
+
+2) Physical interface configuration
+
+For the physical ethernet interface running VRRP instance use:
+
+net.ipv4.conf.eth0.arp_filter = 1
+
+3) VMAC interface
+
+consider the following VRRP configuration :
+
+vrrp_instance instance1 {
+ state BACKUP
+ interface eth0
+ virtual_router_id 250
+ use_vmac
+ priority 150
+ advert_int 1
+ virtual_ipaddress {
+ 10.0.0.254
+ }
+}
+
+The 'use_vmac' keyword will drive keepalived code to create a macvlan interface
+named 'vrrp.250' (default internal paradigm is vrrp.{virtual_router_id}, you can
+override this naming by giving an argument to 'use_vmac' keyword, eg: use_vmac
+vrrp250).
+
+you then need to configure interface with :
+net.ipv4.conf.vrrp.250.arp_filter = 0
+net.ipv4.conf.vrrp.250.accept_local = 1 (this is needed for the address owner case)
+
+you can create notify_master script to automate this configuration step for you :
+
+vrrp_instance instance1 {
+ state BACKUP
+ interface eth0
+ virtual_router_id 250
+ use_vmac
+ priority 150
+ advert_int 1
+ virtual_ipaddress {
+ 10.0.0.254
+ }
+ notify_master "/usr/local/bin/vmac_tweak.sh vrrp.250"
+}
+
+
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/doc/keepalived.conf.SYNOPSIS
^
|
@@ -34,7 +34,7 @@
router_id <STRING> # String identifying router
}
-vrrp_linkbeat_use_polling # Use media link failure detection polling fashion
+linkbeat_use_polling # Use media link failure detection polling fashion
1.2. Static addresses
@@ -144,6 +144,7 @@
The configuration block looks like :
vrrp_instance <STRING> { # VRRP instance declaration
+ use_vmac # Use VRRP Virtual MAC
native_ipv6 # Force instance to use IPv6
# when using mixed IPv4&IPv6 conf
state MASTER|BACKUP # Start-up default state
@@ -170,7 +171,7 @@
advert_int <INTEGER> # VRRP Advert interval (use default)
authentication { # Authentication block
auth_type PASS|AH # Simple Passwd or IPSEC AH
- auth_pass <STRING> # Password string
+ auth_pass <STRING> # Password string (up to 8 characters)
}
virtual_ipaddress { # VRRP IP addres block
<IP ADDRESS>/<MASK> brd <IP ADDRESS> dev <STRING> scope <SCOPE> label <LABEL>
@@ -313,7 +314,7 @@
real_server <IP ADDRESS> <PORT> { # RS declaration
weight <INTEGER> # weight to use (default: 1)
- inhibit_on_failure # Set weight to 0 on healtchecker
+ inhibit_on_failure # Set weight to 0 on healthchecker
# failure
notify_up <STRING>|<QUOTED-STRING> # Script to launch when
# healthchecker consider service
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/doc/man/man5/keepalived.conf.5
^
|
@@ -1,478 +1,463 @@
-.TH KEEPALIVED.CONF 5 "Jan 2004" V1.0
-.UC 4
-.SH NAME
-/etc/keepalived/keepalived.conf - configuration file for keepalived
-.br
-.SH DESCRIPTION
-.B keepalived.conf
-is the configuration file which describes all the keepalived keywords.
-keywords are placed in hierachies of blocks (and subblocks),
-each layer being delimited by '{' and '}' pairs.
-.PP
-Comments start with '#' or '!' to the end of the line and can start
-anywhere in a line.
-.SH TOP HIERACHY
-.PP
-.B GLOBAL CONFIGURATION
-.PP
-.B VRRPD CONFIGURATION
-.PP
-.B LVS CONFIGURATION
-.PP
-.SH GLOBAL CONFIGURATION
-contains subblocks of
-.B Global definitions
-and
-.B Static routes
-.PP
-.SH Global definitions
-.PP
- global_defs # Block id
- {
- notification_email # To:
- {
- admin@example1.com
- ...
- }
- # From: from address that will be in header
- notification_email_from admin@example.com
- smtp_server 127.0.0.1 # IP
- smtp_connect_timeout 30 # integer, seconds
- router_id my_hostname # string identifying the machine,
- # (doesn't have to be hostname).
- }
-
-
-.SH Static routes/addresses
-.PP
-keepalived can configure static addresses and routes
-with
-.I ip
-(ie if addresses are not already on the machine). These addresses are
-.B NOT
-moved by vrrpd, they stay on the machine.
-If you already have IPs and routes on your machines and
-your machines can ping each other, you don't need this section.
-.PP
-The whole string is fed to
-.I ip addr add.
-You can truncate the string anywhere you like and let
-.I ip addr add
-use defaults for the rest of the string. If you just
-feed the string "192.168.1.1", the IP will be 192.168.1.1/32,
-which you probably don't want.
-This is different to
-.I ifconfig
-which will configure the IP with the standard class, here
-192.168.1.1/24.
-The minimum string then would be the IP/netmask, eg 192.168.1.1/24
-.PP
- static_ipaddress
- {
- 192.168.1.1/24 brd + dev eth0 scope global
- ...
- }
-.PP
-The whole string is fed to
-.I ip route add.
-You can truncate the string allowing
-.I ip route add
-to use defaults.
-.PP
- static_routes
- {
- src $SRC_IP to $DST_IP dev $SRC_DEVICE
- ...
- src $SRC_IP to $DST_IP via $GW dev $SRC_DEVICE
- }
-.PP
-.SH VRRPD CONFIGURATION
-contains subblocks of
-.B VRRP synchronization group(s)
-and
-.B VRRP instance(s)
-.PP
-.SH VRRP synchronization group(s)
-.PP
- #string, name of group of IPs that failover together
- vrrp_sync_group VG_1 {
- group {
- inside_network # name of vrrp_instance (below)
- outside_network # One for each moveable IP.
- ...
- }
-
- # notify scripts and alerts are optional
- #
- # filenames of scripts to run on transitions
- # can be unquoted (if just filename)
- # or quoted (if has parameters)
- # to MASTER transition
- notify_master /path/to_master.sh
- # to BACKUP transition
- notify_backup /path/to_backup.sh
- # FAULT transition
- notify_fault "/path/fault.sh VG_1"
-
- # for ANY state transition.
- # "notify" script is called AFTER the
- # notify_* script(s) and is executed
- # with 3 arguments provided by keepalived
- # (ie don't include parameters in the notify line).
- # arguments
- # $1 = "GROUP"|"INSTANCE"
- # $2 = name of group or instance
- # $3 = target state of transition
- # ("MASTER"|"BACKUP"|"FAULT")
- notify /path/notify.sh
-
- # Send email notifcation during state transition,
- # using addresses in global_defs above.
- smtp_alert
- }
-
-.SH VRRP instance(s)
-.PP
-describes the moveable IP for each instance of a group in vrrp_sync_group.
-Here are described two IPs (on inside_network and on outside_network),
-on machine "my_hostname", which belong to the group VG_1 and
-which will transition together on any state change.
-.PPa
- #You will need to write another block for outside_network.
- vrrp_instance inside_network {
- # Initial state, MASTER|BACKUP
- # As soon as the other machine(s) come up,
- # an election will be held and the machine
- # with the highest "priority" will become MASTER.
- # So the entry here doesn't matter a whole lot.
- state MASTER
-
- # interface for inside_network, bound by vrrp
- interface eth0
-
- # Ignore VRRP interface faults (default unset)
- dont_track_primary
-
- # optional, monitor these as well.
- # go to FAULT state if any of these go down.
- track_interface {
- eth0
- eth1
- ...
- }
-
- #default IP for binding vrrpd is the primary IP
- #on interface. If you want to hide location of vrrpd,
- #use this IP as src_addr for multicast vrrp packets.
- #(since it's multicast, vrrpd will get the reply
- #packet no matter what src_addr is used).
- #optional
- mcast_src_ip <IPADDR>
-
- # Binding interface for lvs syncd
- lvs_sync_daemon_interface eth1
-
- # delay for gratuitous ARP after transition to MASTER
- garp_master_delay 10 # secs, default 5
-
- # arbitary unique number 0..255
- # used to differentiate multiple instances of vrrpd
- # running on the same NIC (and hence same socket).
- virtual_router_id 51
-
- # for electing MASTER, highest priority wins.
- # to be MASTER, make 50 more than other machines.
- priority 100
-
- # VRRP Advert interval, secs (use default)
- advert_int 1
- authentication { # Authentication block
- # PASS||AH
- # PASS - Simple Passwd (suggested)
- # AH - IPSEC (not recommended))
- auth_type PASS
- # Password for accessing vrrpd.
- # should be the same for all machines.
- auth_pass 1234
-
- #addresses add|del on change to MASTER, to BACKUP.
- #With the same entries on other machines,
- #the opposite transition will be occuring.
- virtual_ipaddress {
- <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE> label <LABEL>
- 192.168.200.17/24 dev eth1
- 192.168.200.18/24 dev eth2 label eth2:1
- }
-
- #VRRP IP excluded from VRRP
- #optional.
- #For cases with large numbers (eg 200) of IPs
- #on the same interface. To decrease the number
- #of packets sent in adverts, you can exclude
- #most IPs from adverts.
- #The IPs are add|del as for virtual_ipaddress.
- virtual_ipaddress_excluded {
- <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE>
- <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE>
- ...
- }
- # routes add|del when changing to MASTER, to BACKUP
- virtual_routes {
- # src <IPADDR> [to] <IPADDR>/<MASK> via|gw <IPADDR> dev <STRING> scope <SCOPE> tab
- src 192.168.100.1 to 192.168.109.0/24 via 192.168.200.254 dev eth1
- 192.168.110.0/24 via 192.168.200.254 dev eth1
- 192.168.111.0/24 dev eth2
- 192.168.112.0/24 via 192.168.100.254
- }
-
- # VRRP will normally preempt a lower priority
- # machine when a higher priority machine comes
- # online. "nopreempt" allows the lower priority
- # machine to maintain the master role, even when
- # a higher priority machine comes back online.
- # NOTE: For this to work, the initial state of this
- # entry must be BACKUP.
- nopreempt
-
- # Seconds after startup until preemption
- # (if not disabled by "nopreempt").
- # Range: 0 (default) to 1,000
- # NOTE: For this to work, the initial state of this
- # entry must be BACKUP.
- preempt_delay 300 # waits 5 minutes
-
- # Debug level, not implemented yet.
- debug
-
- # notify scripts, alert as above
- notify_master <STRING>|<QUOTED-STRING>
- notify_backup <STRING>|<QUOTED-STRING>
- notify_fault <STRING>|<QUOTED-STRING>
- notify <STRING>|<QUOTED-STRING>
- smtp_alert
- }
-
-.SH LVS CONFIGURATION
-contains subblocks of
-.B Virtual server group(s)
-and
-.B Virtual server(s)
-.PP
-The subblocks contain arguments for
-.I ipvsadm(8).
-A knowlege of
-.I ipvsadm(8)
-will be helpful here.
-.PP
-.SH Virtual server group(s)
-.PP
- # optional
- # this groups allows a service on a real_server
- # to belong to multiple virtual services
- # and to be only health checked once.
- # Only for very large LVSs.
- virtual_server_group <STRING> {
- #VIP port
- <IPADDR> <PORT>
- <IPADDR> <PORT>
- ...
- #
- # <IPADDR RANGE> has the form
- # XXX.YYY.ZZZ.WWW-VVV eg 192.168.200.1-10
- # range includes both .1 and .10 address
- <IPADDR RANGE> <PORT># VIP range VPORT
- <IPADDR RANGE> <PORT>
- ...
- fwmark <INT> # fwmark
- fwmark <INT>
- ...
-}
-
-.SH Virtual server(s)
-.PP
-A virtual_server can be a declaration of one of
-.TP
-.B vip vport (IPADDR PORT pair)
-.TP
-.B fwmark <INT>
-.TP
-.B (virtual server) group <STRING>
-
- #setup service
- virtual_server IP port |
- virtual_server fwmark int |
- virtual_server group string
- {
- # delay timer for service polling
- delay_loop <INT>
-
- # LVS scheduler
- lb_algo rr|wrr|lc|wlc|lblc|sh|dh
- # LVS forwarding method
- lb_kind NAT|DR|TUN
- # LVS persistence timeout, sec
- persistence_timeout <INT>
- # LVS granularity mask (-M in ipvsadm)
- persistence_granularity <NETMASK>
- # Only TCP is implemented
- protocol TCP
- # If VS IP address is not set,
- # suspend healthchecker's activity
- ha_suspend
-
- # VirtualHost string for HTTP_GET or SSL_GET
- # eg virtualhost www.firewall.loc
- virtualhost <STRING>
-
- # Assume silently all RSs down and healthchecks
- # failed on start. This helps preventing false
- # positive actions on startup. Alpha mode is
- # disabled by default.
- alpha
-
- # On daemon shutdown, consider quorum and RS
- # down notifiers for execution, where appropriate.
- # Omega mode is disabled by default.
- omega
-
- # Minimum total weight of all live servers in
- # the pool necessary to operate VS with no
- # quality regression. Defaults to 1.
- quorum <INT>
-
- # Tolerate this much weight units compared to the
- # nominal quorum, when considering quorum gain
- # or loss. A flap dampener. Defaults to 0.
- hysteresis <INT>
-
- # Script to launch when quorum is gained.
- quorum_up <STRING>|<QUOTED-STRING>
-
- # Script to launch when quorum is lost.
- quorum_down <STRING>|<QUOTED-STRING>
-
-
- # setup realserver(s)
-
- # RS to add when all realservers are down
- sorry_server <IPADDR> <PORT>
-
- # one entry for each realserver
- real_server <IPADDR> <PORT>
- {
- # relative weight to use, default: 1
- weight <INT>
- # Set weight to 0
- # when healthchecker detects failure
- inhibit_on_failure
-
- # Script to launch when healthchecker
- # considers service as up.
- notify_up <STRING>|<QUOTED-STRING>
- # Script to launch when healthchecker
- # considers service as down.
- notify_down <STRING>|<QUOTED-STRING>
-
- # pick one healthchecker
- # HTTP_GET|SSL_GET|TCP_CHECK|SMTP_CHECK|MISC_CHECK
-
- # HTTP and SSL healthcheckers
- HTTP_GET|SSL_GET
- {
- # A url to test
- # can have multiple entries here
- url {
- #eg path / , or path /mrtg2/
- path <STRING>
- # healthcheck needs status_code
- # or status_code and digest
- # Digest computed with genhash
- # eg digest 9b3a0c85a887a256d6939da88aabd8cd
- digest <STRING>
- # status code returned in the HTTP header
- # eg status_code 200
- status_code <INT>
- }
- #IP, tcp port for service on realserver
- connect_port <PORT>
- bindto <IPADDR>
- # Timeout connection, sec
- connect_timeout <INT>
- # number of get retry
- nb_get_retry <INT>
- # delay before retry
- delay_before_retry <INT>
- } #HTTP_GET|SSL_GET
-
- #TCP healthchecker (bind to IP port)
- TCP_CHECK
- {
- connect_port <PORT>
- bindto <IPADDR>
- connect_timeout <INT>
- } #TCP_CHECK
-
- # SMTP healthchecker
- SMTP_CHECK
- {
- # An optional host interface to check.
- # If no host directives are present, only
- # the ip address of the real server will
- # be checked.
- host {
- # IP address to connect to
- connect_ip <IP ADDRESS>
- # Optional port to connect to if not
- # the default of 25
- connect_port <PORT>
- # Optional interface to use to
- # originate the connection
- bindto <IP ADDRESS>
- }
- # Connection and read/write timeout
- # in seconds
- connect_timeout <INTEGER>
- # Number of times to retry a failed check
- retry <INTEGER>
- # Delay in seconds before retrying
- delay_before_retry <INTEGER>
- # Optional string to use for the smtp HELO request
- helo_name <STRING>|<QUOTED-STRING>
- } #SMTP_CHECK
-
- #MISC healthchecker, run a program
- MISC_CHECK
- {
- # External system script or program
- misc_path <STRING>|<QUOTED-STRING>
- # Script execution timeout
- misc_timeout <INT>
-
- # If set, exit code from healthchecker is used
- # to dynamically adjust the weight as follows:
- # exit status 0: svc check success, weight
- # unchanged.
- # exit status 1: svc check failed.
- # exit status 2-255: svc check success, weight
- # changed to 2 less than exit status.
- # (for example: exit status of 255 would set
- # weight to 253)
- misc_dynamic
- }
- } # realserver defn
- } # virtual service
-
-
-.SH AUTHOR
-.br
-Joseph Mack.
-.br
-Information derived from doc/keepalived.conf.SYNOPSIS,
-doc/samples/keepalived.conf.* and Changelog by Alexandre Cassen
-for keepalived-1.1.4,
-and from HOWTOs by Adam Fletcher and Vince Worthington.
-.SH "SEE ALSO"
-ipvsadm(8), ip --help.
-.\" Local Variables:
-.\" mode: nroff
-.\" End:
+.TH KEEPALIVED.CONF 5 "Jan 2004" V1.0
+.UC 4
+.SH NAME
+/etc/keepalived/keepalived.conf - configuration file for keepalived
+.br
+.SH DESCRIPTION
+.B keepalived.conf
+is the configuration file which describes all the keepalived keywords.
+keywords are placed in hierachies of blocks (and subblocks),
+each layer being delimited by '{' and '}' pairs.
+.PP
+Comments start with '#' or '!' to the end of the line and can start
+anywhere in a line.
+.SH TOP HIERACHY
+.PP
+.B GLOBAL CONFIGURATION
+.PP
+.B VRRPD CONFIGURATION
+.PP
+.B LVS CONFIGURATION
+.PP
+.SH GLOBAL CONFIGURATION
+contains subblocks of
+.B Global definitions
+and
+.B Static routes
+.PP
+.SH Global definitions
+.PP
+ global_defs # Block id
+ {
+ notification_email # To:
+ {
+ admin@example1.com
+ ...
+ }
+ # From: from address that will be in header
+ notification_email_from admin@example.com
+ smtp_server 127.0.0.1 # IP
+ smtp_connect_timeout 30 # integer, seconds
+ router_id my_hostname # string identifying the machine,
+ # (doesn't have to be hostname).
+ }
+
+
+.SH Static routes/addresses
+.PP
+keepalived can configure static addresses and routes. These addresses are
+.B NOT
+moved by vrrpd, they stay on the machine.
+If you already have IPs and routes on your machines and
+your machines can ping each other, you don't need this section.
+.PP
+The syntax is the same as for virtual addresses and virtual routes.
+.PP
+ static_ipaddress
+ {
+ 192.168.1.1/24 dev eth0 scope global
+ ...
+ }
+.PP
+ static_routes
+ {
+ 192.168.2.0/24 via 192.168.1.100 dev eth0
+ ...
+ }
+.PP
+.SH VRRPD CONFIGURATION
+contains subblocks of
+.B VRRP synchronization group(s)
+and
+.B VRRP instance(s)
+.PP
+.SH VRRP synchronization group(s)
+.PP
+ #string, name of group of IPs that failover together
+ vrrp_sync_group VG_1 {
+ group {
+ inside_network # name of vrrp_instance (below)
+ outside_network # One for each moveable IP.
+ ...
+ }
+
+ # notify scripts and alerts are optional
+ #
+ # filenames of scripts to run on transitions
+ # can be unquoted (if just filename)
+ # or quoted (if has parameters)
+ # to MASTER transition
+ notify_master /path/to_master.sh
+ # to BACKUP transition
+ notify_backup /path/to_backup.sh
+ # FAULT transition
+ notify_fault "/path/fault.sh VG_1"
+
+ # for ANY state transition.
+ # "notify" script is called AFTER the
+ # notify_* script(s) and is executed
+ # with 3 arguments provided by keepalived
+ # (ie don't include parameters in the notify line).
+ # arguments
+ # $1 = "GROUP"|"INSTANCE"
+ # $2 = name of group or instance
+ # $3 = target state of transition
+ # ("MASTER"|"BACKUP"|"FAULT")
+ notify /path/notify.sh
+
+ # Send email notifcation during state transition,
+ # using addresses in global_defs above.
+ smtp_alert
+ }
+
+.SH VRRP instance(s)
+.PP
+describes the moveable IP for each instance of a group in vrrp_sync_group.
+Here are described two IPs (on inside_network and on outside_network),
+on machine "my_hostname", which belong to the group VG_1 and
+which will transition together on any state change.
+.PPa
+ #You will need to write another block for outside_network.
+ vrrp_instance inside_network {
+ # Initial state, MASTER|BACKUP
+ # As soon as the other machine(s) come up,
+ # an election will be held and the machine
+ # with the highest "priority" will become MASTER.
+ # So the entry here doesn't matter a whole lot.
+ state MASTER
+
+ # interface for inside_network, bound by vrrp
+ interface eth0
+
+ # Use VRRP Virtual MAC.
+ use_vmac <VMAC_INTERFACE>
+
+ # Ignore VRRP interface faults (default unset)
+ dont_track_primary
+
+ # optional, monitor these as well.
+ # go to FAULT state if any of these go down.
+ track_interface {
+ eth0
+ eth1
+ ...
+ }
+
+ #default IP for binding vrrpd is the primary IP
+ #on interface. If you want to hide location of vrrpd,
+ #use this IP as src_addr for multicast vrrp packets.
+ #(since it's multicast, vrrpd will get the reply
+ #packet no matter what src_addr is used).
+ #optional
+ mcast_src_ip <IPADDR>
+
+ # Binding interface for lvs syncd
+ lvs_sync_daemon_interface eth1
+
+ # delay for gratuitous ARP after transition to MASTER
+ garp_master_delay 10 # secs, default 5
+
+ # arbitary unique number 0..255
+ # used to differentiate multiple instances of vrrpd
+ # running on the same NIC (and hence same socket).
+ virtual_router_id 51
+
+ # for electing MASTER, highest priority wins.
+ # to be MASTER, make 50 more than other machines.
+ priority 100
+
+ # VRRP Advert interval, secs (use default)
+ advert_int 1
+ authentication { # Authentication block
+ # PASS||AH
+ # PASS - Simple Passwd (suggested)
+ # AH - IPSEC (not recommended))
+ auth_type PASS
+ # Password for accessing vrrpd.
+ # should be the same for all machines.
+ # Only the first eight (8) characters are used.
+ auth_pass 1234
+
+ #addresses add|del on change to MASTER, to BACKUP.
+ #With the same entries on other machines,
+ #the opposite transition will be occuring.
+ virtual_ipaddress {
+ <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE> label <LABEL>
+ 192.168.200.17/24 dev eth1
+ 192.168.200.18/24 dev eth2 label eth2:1
+ }
+
+ #VRRP IP excluded from VRRP
+ #optional.
+ #For cases with large numbers (eg 200) of IPs
+ #on the same interface. To decrease the number
+ #of packets sent in adverts, you can exclude
+ #most IPs from adverts.
+ #The IPs are add|del as for virtual_ipaddress.
+ virtual_ipaddress_excluded {
+ <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE>
+ <IPADDR>/<MASK> brd <IPADDR> dev <STRING> scope <SCOPE>
+ ...
+ }
+ # routes add|del when changing to MASTER, to BACKUP
+ virtual_routes {
+ # src <IPADDR> [to] <IPADDR>/<MASK> via|gw <IPADDR> [or <IPADDR>] dev <STRING> scope <SCOPE> tab
+ src 192.168.100.1 to 192.168.109.0/24 via 192.168.200.254 dev eth1
+ 192.168.110.0/24 via 192.168.200.254 dev eth1
+ 192.168.111.0/24 dev eth2
+ 192.168.112.0/24 via 192.168.100.254
+ 192.168.113.0/24 via 192.168.200.254 or 192.168.100.254 dev eth1
+ blackhole 192.168.114.0/24
+ }
+
+ # VRRP will normally preempt a lower priority
+ # machine when a higher priority machine comes
+ # online. "nopreempt" allows the lower priority
+ # machine to maintain the master role, even when
+ # a higher priority machine comes back online.
+ # NOTE: For this to work, the initial state of this
+ # entry must be BACKUP.
+ nopreempt
+
+ # Seconds after startup until preemption
+ # (if not disabled by "nopreempt").
+ # Range: 0 (default) to 1,000
+ # NOTE: For this to work, the initial state of this
+ # entry must be BACKUP.
+ preempt_delay 300 # waits 5 minutes
+
+ # Debug level, not implemented yet.
+ debug
+
+ # notify scripts, alert as above
+ notify_master <STRING>|<QUOTED-STRING>
+ notify_backup <STRING>|<QUOTED-STRING>
+ notify_fault <STRING>|<QUOTED-STRING>
+ notify <STRING>|<QUOTED-STRING>
+ smtp_alert
+ }
+
+.SH LVS CONFIGURATION
+contains subblocks of
+.B Virtual server group(s)
+and
+.B Virtual server(s)
+.PP
+The subblocks contain arguments for
+.I ipvsadm(8).
+A knowlege of
+.I ipvsadm(8)
+will be helpful here.
+.PP
+.SH Virtual server group(s)
+.PP
+ # optional
+ # this groups allows a service on a real_server
+ # to belong to multiple virtual services
+ # and to be only health checked once.
+ # Only for very large LVSs.
+ virtual_server_group <STRING> {
+ #VIP port
+ <IPADDR> <PORT>
+ <IPADDR> <PORT>
+ ...
+ #
+ # <IPADDR RANGE> has the form
+ # XXX.YYY.ZZZ.WWW-VVV eg 192.168.200.1-10
+ # range includes both .1 and .10 address
+ <IPADDR RANGE> <PORT># VIP range VPORT
+ <IPADDR RANGE> <PORT>
+ ...
+ fwmark <INT> # fwmark
+ fwmark <INT>
+ ...
+}
+
+.SH Virtual server(s)
+.PP
+A virtual_server can be a declaration of one of
+.TP
+.B vip vport (IPADDR PORT pair)
+.TP
+.B fwmark <INT>
+.TP
+.B (virtual server) group <STRING>
+
+ #setup service
+ virtual_server IP port |
+ virtual_server fwmark int |
+ virtual_server group string
+ {
+ # delay timer for service polling
+ delay_loop <INT>
+
+ # LVS scheduler
+ lb_algo rr|wrr|lc|wlc|lblc|sh|dh
+ # LVS forwarding method
+ lb_kind NAT|DR|TUN
+ # LVS persistence timeout, sec
+ persistence_timeout <INT>
+ # LVS granularity mask (-M in ipvsadm)
+ persistence_granularity <NETMASK>
+ # Only TCP is implemented
+ protocol TCP
+ # If VS IP address is not set,
+ # suspend healthchecker's activity
+ ha_suspend
+
+ # VirtualHost string for HTTP_GET or SSL_GET
+ # eg virtualhost www.firewall.loc
+ virtualhost <STRING>
+
+ # Assume silently all RSs down and healthchecks
+ # failed on start. This helps preventing false
+ # positive actions on startup. Alpha mode is
+ # disabled by default.
+ alpha
+
+ # On daemon shutdown, consider quorum and RS
+ # down notifiers for execution, where appropriate.
+ # Omega mode is disabled by default.
+ omega
+
+ # Minimum total weight of all live servers in
+ # the pool necessary to operate VS with no
+ # quality regression. Defaults to 1.
+ quorum <INT>
+
+ # Tolerate this much weight units compared to the
+ # nominal quorum, when considering quorum gain
+ # or loss. A flap dampener. Defaults to 0.
+ hysteresis <INT>
+
+ # Script to launch when quorum is gained.
+ quorum_up <STRING>|<QUOTED-STRING>
+
+ # Script to launch when quorum is lost.
+ quorum_down <STRING>|<QUOTED-STRING>
+
+
+ # setup realserver(s)
+
+ # RS to add when all realservers are down
+ sorry_server <IPADDR> <PORT>
+
+ # one entry for each realserver
+ real_server <IPADDR> <PORT>
+ {
+ # relative weight to use, default: 1
+ weight <INT>
+ # Set weight to 0
+ # when healthchecker detects failure
+ inhibit_on_failure
+
+ # Script to launch when healthchecker
+ # considers service as up.
+ notify_up <STRING>|<QUOTED-STRING>
+ # Script to launch when healthchecker
+ # considers service as down.
+ notify_down <STRING>|<QUOTED-STRING>
+
+ # pick one healthchecker
+ # HTTP_GET|SSL_GET|TCP_CHECK|SMTP_CHECK|MISC_CHECK
+
+ # HTTP and SSL healthcheckers
+ HTTP_GET|SSL_GET
+ {
+ # A url to test
+ # can have multiple entries here
+ url {
+ #eg path / , or path /mrtg2/
+ path <STRING>
+ # healthcheck needs status_code
+ # or status_code and digest
+ # Digest computed with genhash
+ # eg digest 9b3a0c85a887a256d6939da88aabd8cd
+ digest <STRING>
+ # status code returned in the HTTP header
+ # eg status_code 200
+ status_code <INT>
+ }
+ #IP, tcp port for service on realserver
+ connect_port <PORT>
+ bindto <IPADDR>
+ # Timeout connection, sec
+ connect_timeout <INT>
+ # number of get retry
+ nb_get_retry <INT>
+ # delay before retry
+ delay_before_retry <INT>
+ } #HTTP_GET|SSL_GET
+
+ #TCP healthchecker (bind to IP port)
+ TCP_CHECK
+ {
+ connect_port <PORT>
+ bindto <IPADDR>
+ connect_timeout <INT>
+ } #TCP_CHECK
+
+ # SMTP healthchecker
+ SMTP_CHECK
+ {
+ # An optional host interface to check.
+ # If no host directives are present, only
+ # the ip address of the real server will
+ # be checked.
+ host {
+ # IP address to connect to
+ connect_ip <IP ADDRESS>
+ # Optional port to connect to if not
+ # the default of 25
+ connect_port <PORT>
+ # Optional interface to use to
+ # originate the connection
+ bindto <IP ADDRESS>
+ }
+ # Connection and read/write timeout
+ # in seconds
+ connect_timeout <INTEGER>
+ # Number of times to retry a failed check
+ retry <INTEGER>
+ # Delay in seconds before retrying
+ delay_before_retry <INTEGER>
+ # Optional string to use for the smtp HELO request
+ helo_name <STRING>|<QUOTED-STRING>
+ } #SMTP_CHECK
+
+ #MISC healthchecker, run a program
+ MISC_CHECK
+ {
+ # External system script or program
+ misc_path <STRING>|<QUOTED-STRING>
+ # Script execution timeout
+ misc_timeout <INT>
+
+ # If set, exit code from healthchecker is used
+ # to dynamically adjust the weight as follows:
+ # exit status 0: svc check success, weight
+ # unchanged.
+ # exit status 1: svc check failed.
+ # exit status 2-255: svc check success, weight
+ # changed to 2 less than exit status.
+ # (for example: exit status of 255 would set
+ # weight to 253)
+ misc_dynamic
+ }
+ } # realserver defn
+ } # virtual service
+
+
+.SH AUTHOR
+.br
+Joseph Mack.
+.br
+Information derived from doc/keepalived.conf.SYNOPSIS,
+doc/samples/keepalived.conf.* and Changelog by Alexandre Cassen
+for keepalived-1.1.4,
+and from HOWTOs by Adam Fletcher and Vince Worthington.
+.SH "SEE ALSO"
+ipvsadm(8), ip --help.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/genhash/Makefile.in
^
|
@@ -9,6 +9,7 @@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
+datarootdir = @datarootdir@
CC = @CC@
STRIP = @STRIP@
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/genhash/http.c
^
|
@@ -190,7 +190,7 @@
if (r == -1 || r == 0) { /* -1:error , 0:EOF */
if (r == -1) {
/* We have encourred a real read error */
- DBG("Read error with server [%s:%d]: %s\n",
+ DBG("Read error with server [%s]:%d: %s\n",
inet_ntop2(req->addr_ip), ntohs(req->addr_port),
strerror(errno));
return epilog(thread);
@@ -276,7 +276,7 @@
FREE(str_request);
if (!ret) {
- fprintf(stderr, "Cannot send get request to [%s:%d].\n",
+ fprintf(stderr, "Cannot send get request to [%s]:%d.\n",
inet_ntop2(req->addr_ip)
, ntohs(req->addr_port));
return epilog(thread);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/genhash/layer4.c
^
|
@@ -85,7 +85,7 @@
/* Handle connection timeout */
if (thread->type == THREAD_WRITE_TIMEOUT) {
- DBG("TCP connection timeout to [%s:%d].\n",
+ DBG("TCP connection timeout to [%s]:%d.\n",
inet_ntop2(addr_ip), ntohs(addr_port));
close(thread->u.fd);
return connect_timeout;
@@ -99,7 +99,7 @@
/* Connection failed !!! */
if (ret) {
- DBG("TCP connection failed to [%s:%d].\n",
+ DBG("TCP connection failed to [%s]:%d.\n",
inet_ntop2(addr_ip), ntohs(addr_port));
close(thread->u.fd);
return connect_error;
@@ -111,7 +111,7 @@
* Recompute the write timeout (or pending connection).
*/
if (status != 0) {
- DBG("TCP connection to [%s:%d] still IN_PROGRESS.\n",
+ DBG("TCP connection to [%s]:%d still IN_PROGRESS.\n",
inet_ntop2(addr_ip), ntohs(addr_port));
timer_min = timer_sub_now(thread->sands);
@@ -160,14 +160,14 @@
tcp_check_thread);
switch (sock_obj->status) {
case connect_error:
- DBG("Error connecting server [%s:%d].\n",
+ DBG("Error connecting server [%s]:%d.\n",
inet_ntop2(req->addr_ip), ntohs(req->addr_port));
thread_add_terminate_event(thread->master);
return -1;
break;
case connect_timeout:
- DBG("Timeout connecting server [%s:%d].\n",
+ DBG("Timeout connecting server [%s]:%d.\n",
inet_ntop2(req->addr_ip), ntohs(req->addr_port));
thread_add_terminate_event(thread->master);
return -1;
@@ -185,7 +185,7 @@
thread_add_event(thread->master,
http_request_thread, sock_obj, 0);
} else {
- DBG("Connection trouble to: [%s:%d].\n",
+ DBG("Connection trouble to: [%s]:%d.\n",
inet_ntop2(req->addr_ip),
ntohs(req->addr_port));
if (req->ssl)
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/genhash/ssl.c
^
|
@@ -47,7 +47,7 @@
SSL_load_error_strings();
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
/* Initialize SSL context for SSL v2/3 */
- req->meth = SSLv23_method();
+ req->meth = (SSL_METHOD *) SSLv23_method();
req->ctx = SSL_CTX_new(req->meth);
#if (OPENSSL_VERSION_NUMBER < 0x00905100L)
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/Makefile.in
^
|
@@ -14,6 +14,7 @@
exec_prefix = @exec_prefix@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
+datarootdir = @datarootdir@
mandir = @mandir@
init_dir = $(sysconfdir)/rc.d/init.d
conf_dir = $(sysconfdir)/keepalived
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_api.c
^
|
@@ -52,7 +52,7 @@
dump_checker(void *data)
{
checker_t *checker = data;
- log_message(LOG_INFO, " %s:%d"
+ log_message(LOG_INFO, " [%s]:%d"
, inet_sockaddrtos(&checker->rs->addr)
, ntohs(inet_sockaddrport(&checker->rs->addr)));
(*checker->dump_func) (checker);
@@ -149,7 +149,7 @@
for (e = LIST_HEAD(checkers_queue); e; ELEMENT_NEXT(e)) {
checker = ELEMENT_DATA(e);
- log_message(LOG_INFO, "Activating healtchecker for service [%s]:%d"
+ log_message(LOG_INFO, "Activating healthchecker for service [%s]:%d"
, inet_sockaddrtos(&checker->rs->addr)
, ntohs(inet_sockaddrport(&checker->rs->addr)));
CHECKER_ENABLE(checker);
@@ -194,11 +194,11 @@
if (inaddr_equal(family, addr, address) &&
CHECKER_HA_SUSPEND(checker)) {
if (!CHECKER_ENABLED(checker) && enable)
- log_message(LOG_INFO, "Activating healtchecker for service [%s]:%d"
+ log_message(LOG_INFO, "Activating healthchecker for service [%s]:%d"
, inet_sockaddrtos(&checker->rs->addr)
, ntohs(inet_sockaddrport(&checker->rs->addr)));
if (CHECKER_ENABLED(checker) && !enable)
- log_message(LOG_INFO, "Suspending healtchecker for service [%s]:%d"
+ log_message(LOG_INFO, "Suspending healthchecker for service [%s]:%d"
, inet_sockaddrtos(&checker->rs->addr)
, ntohs(inet_sockaddrport(&checker->rs->addr)));
checker->enabled = enable;
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_daemon.c
^
|
@@ -138,8 +138,6 @@
void
sighup_check(void *v, int sig)
{
- log_message(LOG_INFO, "Reloading Healthchecker child process(%d) on signal",
- getpid());
thread_add_event(master, reload_check_thread, NULL, 0);
}
@@ -147,7 +145,6 @@
void
sigend_check(void *v, int sig)
{
- log_message(LOG_INFO, "Terminating Healthchecker child process on signal");
if (master)
thread_add_terminate_event(master);
}
@@ -219,7 +216,7 @@
}
/* We catch a SIGCHLD, handle it */
- log_message(LOG_INFO, "Healthcheck child process(%d) died: Respawning", pid);
+ log_message(LOG_ALERT, "Healthcheck child process(%d) died: Respawning", pid);
start_check_child();
return 0;
}
@@ -251,7 +248,7 @@
}
/* Opening local CHECK syslog channel */
- openlog(PROG_CHECK, LOG_PID | (debug & 1) ? LOG_CONS : 0,
+ openlog(PROG_CHECK, LOG_PID | ((debug & 1) ? LOG_CONS : 0),
(log_facility==LOG_DAEMON) ? LOG_LOCAL2 : log_facility);
/* Child process part, write pidfile */
@@ -267,6 +264,9 @@
/* change to / dir */
ret = chdir("/");
+ if (ret < 0) {
+ log_message(LOG_INFO, "Healthcheck child process: error chdir");
+ }
/* Set mask */
umask(0);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_data.c
^
|
@@ -214,7 +214,7 @@
}
if (vs->s_svr) {
- log_message(LOG_INFO, " sorry server = %s:%d"
+ log_message(LOG_INFO, " sorry server = [%s]:%d"
, inet_sockaddrtos(&vs->s_svr->addr)
, ntohs(inet_sockaddrport(&vs->s_svr->addr)));
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_http.c
^
|
@@ -97,6 +97,8 @@
(!strcmp(proto, "HTTP_GET")) ? PROTO_HTTP : PROTO_SSL;
http_get_chk->url = alloc_list(free_url, dump_url);
http_get_chk->nb_get_retry = 1;
+ http_get_chk->connection_to = 5 * TIMER_HZ;
+ http_get_chk->delay_before_retry = 3 * TIMER_HZ;
return http_get_chk;
}
@@ -133,6 +135,8 @@
{
http_checker_t *http_get_chk = CHECKER_GET();
http_get_chk->connection_to = CHECKER_VALUE_INT(strvec) * TIMER_HZ;
+ if (http_get_chk->connection_to < TIMER_HZ)
+ http_get_chk->connection_to = TIMER_HZ;
}
void
@@ -793,7 +797,7 @@
thread->u.fd,
http_get_check->connection_to);
} else {
- DBG(LOG_INFO, "Connection trouble to: [%s]:%d."
+ DBG("Connection trouble to: [%s]:%d."
, inet_sockaddrtos(&http_get_check->dst)
, ntohs(inet_sockaddrport(&http_get_check->dst)));
#ifdef _DEBUG_
@@ -871,19 +875,23 @@
/* Create the socket */
if ((fd = socket(http_get_check->dst.ss_family, SOCK_STREAM, IPPROTO_TCP)) == -1) {
- DBG("WEB connection fail to create socket.");
+ log_message(LOG_INFO, "WEB connection fail to create socket. Rescheduling.");
+ thread_add_timer(thread->master, http_connect_thread, checker,
+ checker->vs->delay_loop);
+
return 0;
}
status = tcp_bind_connect(fd, &http_get_check->dst, &http_get_check->bindto);
- if (status == connect_error) {
+
+ /* handle tcp connection status & register check worker thread */
+ if(tcp_connection_state(fd, status, thread, http_check_thread,
+ http_get_check->connection_to)) {
+ close(fd);
+ log_message(LOG_INFO, "WEB socket bind failed. Rescheduling");
thread_add_timer(thread->master, http_connect_thread, checker,
- checker->vs->delay_loop);
- return 0;
+ checker->vs->delay_loop);
}
- /* handle tcp connection status & register check worker thread */
- tcp_connection_state(fd, status, thread, http_check_thread,
- http_get_check->connection_to);
return 0;
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_misc.c
^
|
@@ -153,7 +153,14 @@
open("/dev/null", O_RDWR);
ret = dup(0);
+ if (ret < 0) {
+ log_message(LOG_INFO, "dup(0) error");
+ }
+
ret = dup(0);
+ if (ret < 0) {
+ log_message(LOG_INFO, "dup(0) error");
+ }
status = system_call(misck_checker->path);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_parser.c
^
|
@@ -78,6 +78,8 @@
{
virtual_server *vs = LIST_TAIL_DATA(check_data->vs);
vs->delay_loop = atoi(VECTOR_SLOT(strvec, 1)) * TIMER_HZ;
+ if (vs->delay_loop < TIMER_HZ)
+ vs->delay_loop = TIMER_HZ;
}
static void
lbalgo_handler(vector strvec)
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_smtp.c
^
|
@@ -70,7 +70,7 @@
{
smtp_host_t *smtp_host = data;
log_message(LOG_INFO, " Checked ip = %s", inet_sockaddrtos(&smtp_host->dst));
- log_message(LOG_INFO, " port = %d", ntohs(ntohs(inet_sockaddrport(&smtp_host->dst))));
+ log_message(LOG_INFO, " port = %d", ntohs(inet_sockaddrport(&smtp_host->dst)));
if (smtp_host->bindto.ss_family)
log_message(LOG_INFO, " bindto = %s", inet_sockaddrtos(&smtp_host->bindto));
}
@@ -214,6 +214,8 @@
{
smtp_checker_t *smtp_checker = CHECKER_GET();
smtp_checker->timeout = CHECKER_VALUE_INT(strvec) * TIMER_HZ;
+ if (smtp_checker->timeout < TIMER_HZ)
+ smtp_checker->timeout = TIMER_HZ;
}
/* "retry" keyword */
@@ -382,7 +384,7 @@
/* Handle read timeout */
if (thread->type == THREAD_READ_TIMEOUT) {
- smtp_final(thread, 1, "Read timeout from server [%s:%d]"
+ smtp_final(thread, 1, "Read timeout from server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
return 0;
@@ -390,7 +392,7 @@
/* wrap the buffer, if full, by clearing it */
if (SMTP_BUFF_MAX - smtp_checker->buff_ctr <= 0) {
- log_message(LOG_INFO, "SMTP_CHECK Buffer overflow reading from server [%s:%d]. "
+ log_message(LOG_INFO, "SMTP_CHECK Buffer overflow reading from server [%s]:%d. "
"Increase SMTP_BUFF_MAX in smtp_check.h"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
@@ -421,7 +423,7 @@
if (smtp_checker->buff[x] == '\n') {
smtp_checker->buff[SMTP_BUFF_MAX - 1] = '\0';
- DBG("SMTP_CHECK [%s:%d] < %s"
+ DBG("SMTP_CHECK [%s]:%d < %s"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst))
, smtp_checker->buff);
@@ -437,7 +439,7 @@
* some sort of error, notify smtp_final()
*/
if (r <= 0) {
- smtp_final(thread, 1, "Read failure from server [%s:%d]"
+ smtp_final(thread, 1, "Read failure from server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
return 0;
@@ -497,7 +499,7 @@
/* Handle read timeout */
if (thread->type == THREAD_WRITE_TIMEOUT) {
- smtp_final(thread, 1, "Write timeout to server [%s:%d]"
+ smtp_final(thread, 1, "Write timeout to server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
return 0;
@@ -520,7 +522,7 @@
/* restore descriptor flags */
fcntl(thread->u.fd, F_SETFL, f);
- DBG("SMTP_CHECK [%s:%d] > %s"
+ DBG("SMTP_CHECK [%s]:%d > %s"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst))
, smtp_checker->buff);
@@ -530,7 +532,7 @@
* some sort of error, notify smtp_final()
*/
if (w <= 0) {
- smtp_final(thread, 1, "Write failure to server [%s:%d]"
+ smtp_final(thread, 1, "Write failure to server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
return 0;
@@ -618,7 +620,7 @@
case SMTP_HAVE_BANNER:
/* Check for "220 some.mailserver.com" in the greeting */
if (smtp_get_status(thread) != 220) {
- smtp_final(thread, 1, "Bad greeting banner from server [%s:%d]"
+ smtp_final(thread, 1, "Bad greeting banner from server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
@@ -647,7 +649,7 @@
case SMTP_RECV_HELO:
/* Check for "250 Please to meet you..." */
if (smtp_get_status(thread) != 250) {
- smtp_final(thread, 1, "Bad HELO response from server [%s:%d]"
+ smtp_final(thread, 1, "Bad HELO response from server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
@@ -694,21 +696,21 @@
status = tcp_socket_state(thread->u.fd, thread, smtp_check_thread);
switch (status) {
case connect_error:
- smtp_final(thread, 1, "Error connecting to server [%s:%d]"
+ smtp_final(thread, 1, "Error connecting to server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
return 0;
break;
case connect_timeout:
- smtp_final(thread, 1, "Connection timeout to server [%s:%d]"
+ smtp_final(thread, 1, "Connection timeout to server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
return 0;
break;
case connect_success:
- DBG("SMTP_CHECK Remote SMTP server [%s:%d] connected"
+ DBG("SMTP_CHECK Remote SMTP server [%s]:%d connected"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
@@ -720,7 +722,7 @@
}
/* we shouldn't be here */
- smtp_final(thread, 1, "Unknown connection error to server [%s:%d]"
+ smtp_final(thread, 1, "Unknown connection error to server [%s]:%d"
, inet_sockaddrtos(&smtp_host->dst)
, ntohs(inet_sockaddrport(&smtp_host->dst)));
return 0;
@@ -790,7 +792,7 @@
*/
if ((smtp_checker->host_ptr = list_element(smtp_checker->host, smtp_checker->host_ctr)) == NULL) {
if (!svr_checker_up(checker->id, checker->rs)) {
- log_message(LOG_INFO, "Remote SMTP server [%s:%d] succeed on service."
+ log_message(LOG_INFO, "Remote SMTP server [%s]:%d succeed on service."
, inet_sockaddrtos(&checker->rs->addr)
, ntohs(inet_sockaddrport(&checker->rs->addr)));
@@ -811,20 +813,21 @@
/* Create the socket, failling here should be an oddity */
if ((sd = socket(smtp_host->dst.ss_family, SOCK_STREAM, IPPROTO_TCP)) == -1) {
- DBG("SMTP_CHECK connection failed to create socket.");
+ log_message(LOG_INFO, "SMTP_CHECK connection failed to create socket. Rescheduling.");
thread_add_timer(thread->master, smtp_connect_thread, checker,
checker->vs->delay_loop);
return 0;
}
status = tcp_bind_connect(sd, &smtp_host->dst, &smtp_host->bindto);
- if (status == connect_error) {
- thread_add_timer(thread->master, smtp_connect_thread, checker,
- checker->vs->delay_loop);
- return 0;
- }
/* handle tcp connection status & register callback the next setp in the process */
- tcp_connection_state(sd, status, thread, smtp_check_thread, smtp_checker->timeout);
+ if(tcp_connection_state(sd, status, thread, smtp_check_thread, smtp_checker->timeout)) {
+ close(sd);
+ log_message(LOG_INFO, "SMTP_CHECK socket bind failed. Rescheduling.");
+ thread_add_timer(thread->master, smtp_connect_thread, checker,
+ checker->vs->delay_loop);
+ }
+
return 0;
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_ssl.c
^
|
@@ -76,7 +76,7 @@
ssl = check_data->ssl;
/* Initialize SSL context for SSL v2/3 */
- ssl->meth = SSLv23_method();
+ ssl->meth = (SSL_METHOD *) SSLv23_method();
ssl->ctx = SSL_CTX_new(ssl->meth);
/* return for autogen context */
@@ -141,7 +141,7 @@
log_message(LOG_INFO, " SSL keyfile:%s", ssl->keyfile);
log_message(LOG_INFO, " SSL password:%s", ssl->password);
log_message(LOG_INFO, " SSL cafile:%s", ssl->cafile);
- log_message(LOG_INFO, "Terminate...\n");
+ log_message(LOG_INFO, "Terminate...");
clear_ssl(ssl);
return 0;
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/check_tcp.c
^
|
@@ -169,19 +169,23 @@
}
if ((fd = socket(tcp_check->dst.ss_family, SOCK_STREAM, IPPROTO_TCP)) == -1) {
- DBG("TCP connect fail to create socket.");
+ log_message(LOG_INFO, "TCP connect fail to create socket. Rescheduling.");
+ thread_add_timer(thread->master, tcp_connect_thread, checker,
+ checker->vs->delay_loop);
+
return 0;
}
status = tcp_bind_connect(fd, &tcp_check->dst, &tcp_check->bindto);
- if (status == connect_error) {
- thread_add_timer(thread->master, tcp_connect_thread, checker,
- checker->vs->delay_loop);
- return 0;
- }
/* handle tcp connection status & register check worker thread */
- tcp_connection_state(fd, status, thread, tcp_check_thread,
- tcp_check->connection_to);
+ if(tcp_connection_state(fd, status, thread, tcp_check_thread,
+ tcp_check->connection_to)) {
+ close(fd);
+ log_message(LOG_INFO, "TCP socket bind failed. Rescheduling.");
+ thread_add_timer(thread->master, tcp_connect_thread, checker,
+ checker->vs->delay_loop);
+ }
+
return 0;
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/ipvswrapper.c
^
|
@@ -455,9 +455,9 @@
/* set IPVS group rules */
static void
-ipvs_group_cmd(int cmd, list vs_group, real_server * rs, char * vsgname)
+ipvs_group_cmd(int cmd, list vs_group, real_server * rs, virtual_server * vs)
{
- virtual_server_group *vsg = ipvs_get_group_by_name(vsgname, vs_group);
+ virtual_server_group *vsg = ipvs_get_group_by_name(vs->vsgname, vs_group);
virtual_server_group_entry *vsg_entry;
list l;
element e;
@@ -493,6 +493,12 @@
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
vsg_entry = ELEMENT_DATA(e);
srule->af = AF_INET;
+ /* Need to get address family from first real server */
+ if (vs->rs && !LIST_ISEMPTY(vs->rs) &&
+ (((real_server *)ELEMENT_DATA(LIST_HEAD(vs->rs)))->addr.ss_family == AF_INET6)) {
+ srule->af = AF_INET6;
+ srule->netmask = 128;
+ }
srule->fwmark = vsg_entry->vfwmark;
/* Talk to the IPVS channel */
@@ -584,10 +590,16 @@
/* Set vs rule and send to kernel */
if (vs->vsgname) {
- ipvs_group_cmd(cmd, vs_group, rs, vs->vsgname);
+ ipvs_group_cmd(cmd, vs_group, rs, vs);
} else {
if (vs->vfwmark) {
srule->af = AF_INET;
+ /* Need to get address family from first real server */
+ if (vs->rs && !LIST_ISEMPTY(vs->rs) &&
+ (((real_server *)ELEMENT_DATA(LIST_HEAD(vs->rs)))->addr.ss_family == AF_INET6)) {
+ srule->af = AF_INET6;
+ srule->netmask = 128;
+ }
srule->fwmark = vs->vfwmark;
} else {
srule->af = vs->addr.ss_family;
@@ -728,7 +740,7 @@
static int
modprobe_ipvs(void)
{
- char *argv[] = { "/sbin/modprobe", "-s", "-k", "--", "ip_vs", NULL };
+ char *argv[] = { "/sbin/modprobe", "-s", "--", "ip_vs", NULL };
int child;
int status;
int rc;
@@ -739,6 +751,10 @@
}
rc = waitpid(child, &status, 0);
+ if (rc < 0) {
+ log_message(LOG_INFO, "IPVS: waitpid error (%s)"
+ , strerror(errno));
+ }
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
return 1;
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/check/ipwrapper.c
^
|
@@ -122,11 +122,9 @@
element e;
list l = check_data->vs;
virtual_server *vs;
- real_server *rs;
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
vs = ELEMENT_DATA(e);
- rs = ELEMENT_DATA(LIST_HEAD(vs->rs));
if (!clear_service_vs(check_data->vs_group, vs))
return 0;
}
@@ -497,7 +495,7 @@
for (e = LIST_HEAD(old); e; ELEMENT_NEXT(e)) {
vsge = ELEMENT_DATA(e);
if (!vsge_exist(vsge, new)) {
- log_message(LOG_INFO, "VS [%s:%d:%d:%d] in group %s no longer exist\n"
+ log_message(LOG_INFO, "VS [[%s]:%d:%d:%d] in group %s no longer exist"
, inet_sockaddrtos(&vsge->addr)
, ntohs(inet_sockaddrport(&vsge->addr))
, vsge->range
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/core/daemon.c
^
|
@@ -55,8 +55,12 @@
}
/* Change directory to root. */
- if (!nochdir)
+ if (!nochdir) {
ret = chdir("/");
+ if (ret < 0) {
+ log_message(LOG_INFO, "xdaemon: chdir error");
+ }
+ }
/* File descriptor close. */
if (!noclose) {
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/core/layer4.c
^
|
@@ -43,7 +43,7 @@
fcntl(fd, F_SETFL, val | O_NONBLOCK);
/* Bind socket */
- if (bind_addr) {
+ if (bind_addr && ((struct sockaddr *) bind_addr)->sa_family != AF_UNSPEC) {
addrlen = sizeof(*bind_addr);
if (bind(fd, (struct sockaddr *) bind_addr, addrlen) != 0)
return connect_error;
@@ -119,7 +119,7 @@
return connect_success;
}
-void
+int
tcp_connection_state(int fd, enum connect_result status, thread_t * thread,
int (*func) (thread_t *), long timeout)
{
@@ -128,20 +128,16 @@
checker = THREAD_ARG(thread);
switch (status) {
- case connect_error:
- close(fd);
- break;
-
case connect_success:
thread_add_write(thread->master, func, checker, fd, timeout);
- break;
+ return 0;
/* Checking non-blocking connect, we wait until socket is writable */
case connect_in_progress:
thread_add_write(thread->master, func, checker, fd, timeout);
- break;
+ return 0;
default:
- break;
+ return 1;
}
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/core/main.c
^
|
@@ -87,9 +87,6 @@
void
sighup(void *v, int sig)
{
- /* Set the reloading flag */
- SET_RELOAD;
-
/* Signal child process */
if (vrrp_child > 0)
kill(vrrp_child, SIGHUP);
@@ -104,7 +101,6 @@
int status;
/* register the terminate thread */
- log_message(LOG_INFO, "Terminating on signal");
thread_add_terminate_event(master);
if (vrrp_child > 0) {
@@ -317,7 +313,7 @@
*/
parse_cmdline(argc, argv);
- openlog(PROG, LOG_PID | (debug & 1) ? LOG_CONS : 0, log_facility);
+ openlog(PROG, LOG_PID | ((debug & 1) ? LOG_CONS : 0), log_facility);
log_message(LOG_INFO, "Starting " VERSION_STRING);
/* Check if keepalived is already running */
@@ -326,6 +322,9 @@
goto end;
}
+ if (debug & 1)
+ enable_console_log();
+
/* daemonize process */
if (!(debug & 2))
xdaemon(0, 0, 0);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/core/pidfile.c
^
|
@@ -20,6 +20,9 @@
* Copyright (C) 2001-2011 Alexandre Cassen, <acassen@linux-vs.org>
*/
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include "logger.h"
#include "pidfile.h"
extern char *main_pidfile;
@@ -30,7 +33,9 @@
int
pidfile_write(char *pid_file, int pid)
{
- FILE *pidfile = fopen(pid_file, "w");
+ FILE *pidfile = NULL;
+ int pidfd = creat(pid_file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ if (pidfd != -1) pidfile = fdopen(pidfd, "w");
if (!pidfile) {
log_message(LOG_INFO, "pidfile_write : Can not open %s pidfile",
@@ -62,6 +67,9 @@
return 0;
ret = fscanf(pidfile, "%d", &pid);
+ if (ret == EOF && ferror(pidfile) != 0) {
+ log_message(LOG_INFO, "Error opening pid file %s", pid_file);
+ }
fclose(pidfile);
/* If no process is attached to pidfile, remove it */
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/core/smtp.c
^
|
@@ -95,7 +95,7 @@
{
smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
- log_message(LOG_INFO, "SMTP connection ERROR to [%s:%d]."
+ log_message(LOG_INFO, "SMTP connection ERROR to [%s]:%d."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
free_smtp_all(smtp_arg);
return 0;
@@ -105,7 +105,7 @@
{
smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
- log_message(LOG_INFO, "Timeout connecting SMTP server [%s:%d]."
+ log_message(LOG_INFO, "Timeout connecting SMTP server [%s]:%d."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
free_smtp_all(smtp_arg);
return 0;
@@ -115,7 +115,7 @@
{
int status;
- DBG("SMTP connection to [%s:%d] now IN_PROGRESS.",
+ DBG("SMTP connection to [%s]:%d now IN_PROGRESS.",
inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
/*
@@ -134,7 +134,7 @@
{
smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
- log_message(LOG_INFO, "Remote SMTP server [%s:%d] connected."
+ log_message(LOG_INFO, "Remote SMTP server [%s]:%d connected."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
smtp_arg->stage = connect_success;
@@ -156,7 +156,7 @@
smtp_arg = THREAD_ARG(thread);
if (thread->type == THREAD_READ_TIMEOUT) {
- log_message(LOG_INFO, "Timeout reading data to remote SMTP server [%s:%d]."
+ log_message(LOG_INFO, "Timeout reading data to remote SMTP server [%s]:%d."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread, 0);
return -1;
@@ -170,7 +170,7 @@
if (rcv_buffer_size == -1) {
if (errno == EAGAIN)
goto end;
- log_message(LOG_INFO, "Error reading data from remote SMTP server [%s:%d]."
+ log_message(LOG_INFO, "Error reading data from remote SMTP server [%s]:%d."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread, 0);
return 0;
@@ -178,7 +178,7 @@
/* received data overflow buffer size ? */
if (smtp_arg->buflen >= SMTP_BUFFER_MAX) {
- log_message(LOG_INFO, "Received buffer from remote SMTP server [%s:%d]"
+ log_message(LOG_INFO, "Received buffer from remote SMTP server [%s]:%d"
" overflow our get read buffer length."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread, 0);
@@ -237,7 +237,7 @@
thread_add_write(thread->master, smtp_send_thread, smtp_arg,
smtp_arg->fd, data->smtp_connection_to);
} else {
- log_message(LOG_INFO, "Can not read data from remote SMTP server [%s:%d]."
+ log_message(LOG_INFO, "Can not read data from remote SMTP server [%s]:%d."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread, 0);
}
@@ -251,7 +251,7 @@
smtp_thread_arg *smtp_arg = THREAD_ARG(thread);
if (thread->type == THREAD_WRITE_TIMEOUT) {
- log_message(LOG_INFO, "Timeout sending data to remote SMTP server [%s:%d]."
+ log_message(LOG_INFO, "Timeout sending data to remote SMTP server [%s]:%d."
, inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread, 0);
return 0;
@@ -271,7 +271,7 @@
thread->u.fd, data->smtp_connection_to);
} else {
log_message(LOG_INFO,
- "Can not send data to remote SMTP server [%s:%d].",
+ "Can not send data to remote SMTP server [%s]:%d.",
inet_sockaddrtos(&data->smtp_server), SMTP_PORT);
SMTP_FSM_READ(QUIT, thread, 0);
}
@@ -287,7 +287,7 @@
if (status == 220) {
smtp_arg->stage++;
} else {
- log_message(LOG_INFO, "Error connecting SMTP server[%s:%d]."
+ log_message(LOG_INFO, "Error connecting SMTP server[%s]:%d."
" SMTP status code = %d", inet_sockaddrtos(&data->smtp_server),
SMTP_PORT, status);
smtp_arg->stage = ERROR;
@@ -320,7 +320,7 @@
smtp_arg->stage++;
} else {
log_message(LOG_INFO,
- "Error processing HELO cmd on SMTP server [%s:%d]."
+ "Error processing HELO cmd on SMTP server [%s]:%d."
" SMTP status code = %d", inet_sockaddrtos(&data->smtp_server),
SMTP_PORT, status);
smtp_arg->stage = ERROR;
@@ -353,7 +353,7 @@
smtp_arg->stage++;
} else {
log_message(LOG_INFO,
- "Error processing MAIL cmd on SMTP server [%s:%d]."
+ "Error processing MAIL cmd on SMTP server [%s]:%d."
" SMTP status code = %d", inet_sockaddrtos(&data->smtp_server),
SMTP_PORT, status);
smtp_arg->stage = ERROR;
@@ -398,7 +398,7 @@
smtp_arg->stage++;
} else {
log_message(LOG_INFO,
- "Error processing RCPT cmd on SMTP server [%s:%d]."
+ "Error processing RCPT cmd on SMTP server [%s]:%d."
" SMTP status code = %d", inet_sockaddrtos(&data->smtp_server),
SMTP_PORT, status);
smtp_arg->stage = ERROR;
@@ -426,7 +426,7 @@
smtp_arg->stage++;
} else {
log_message(LOG_INFO,
- "Error processing DATA cmd on SMTP server [%s:%d]."
+ "Error processing DATA cmd on SMTP server [%s]:%d."
" SMTP status code = %d", inet_sockaddrtos(&data->smtp_server),
SMTP_PORT, status);
smtp_arg->stage = ERROR;
@@ -484,7 +484,7 @@
smtp_arg->stage++;
} else {
log_message(LOG_INFO,
- "Error processing DOT cmd on SMTP server [%s:%d]."
+ "Error processing DOT cmd on SMTP server [%s]:%d."
" SMTP status code = %d", inet_sockaddrtos(&data->smtp_server),
SMTP_PORT, status);
smtp_arg->stage = ERROR;
@@ -551,7 +551,7 @@
/* format subject if rserver is specified */
if (rs) {
- snprintf(smtp_arg->subject, MAX_HEADERS_LENGTH, "[%s] Realserver %s:%d - %s"
+ snprintf(smtp_arg->subject, MAX_HEADERS_LENGTH, "[%s] Realserver [%s]:%d - %s"
, data->router_id, inet_sockaddrtos(&rs->addr)
, ntohs(inet_sockaddrport(&rs->addr))
, subject);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/include/check_data.h
^
|
@@ -163,10 +163,11 @@
struct sockaddr_in *a1 = (struct sockaddr_in *) s1;
struct sockaddr_in *a2 = (struct sockaddr_in *) s2;
- if ((a1->sin_addr.s_addr == a1->sin_addr.s_addr) &&
+ if ((a1->sin_addr.s_addr == a2->sin_addr.s_addr) &&
(a1->sin_port == a2->sin_port))
return 1;
- }
+ } else if (s1->ss_family == AF_UNSPEC)
+ return 1;
return 0;
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/include/layer4.h
^
|
@@ -52,7 +52,7 @@
extern enum connect_result
tcp_socket_state(int, thread_t *, int (*func) (thread_t *));
-extern void
+extern int
tcp_connection_state(int, enum connect_result
, thread_t *, int (*func) (thread_t *)
, long);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/include/vrrp.h
^
|
@@ -74,6 +74,9 @@
vector iname; /* Set of VRRP instances in this group */
list index_list; /* List of VRRP instances */
int state; /* current stable state */
+ int global_tracking; /* Use floating priority and scripts
+ * All VRRP must share same tracking conf
+ */
/* State transition notification */
int notify_exec;
@@ -91,6 +94,8 @@
vrrp_sgroup *sync; /* Sync group we belong to */
interface *ifp; /* Interface we belong to */
int dont_track_primary; /* If set ignores ifp faults */
+ int vmac; /* If set try to set VRRP VMAC */
+ char vmac_ifname[IFNAMSIZ]; /* Name of VRRP VMAC interface */
list track_ifp; /* Interface state we monitor */
list track_script; /* Script state we monitor */
uint32_t mcast_saddr; /* Src IP address to use in VRRP IP header */
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/include/vrrp_if.h
^
|
@@ -123,5 +123,6 @@
extern int if_setsockopt_mcast_loop(sa_family_t, int *);
extern int if_setsockopt_mcast_hops(sa_family_t, int *);
extern int if_setsockopt_mcast_if(sa_family_t, int *, interface *);
+extern int if_setsockopt_priority(int *);
#endif
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/include/vrrp_netlink.h
^
|
@@ -45,6 +45,7 @@
/* Define types */
#define NETLINK_TIMER (30 * TIMER_HZ)
+#define NLMSG_TAIL(nmsg) ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
/* Global vars exported */
extern struct nl_handle nl_kernel; /* Kernel reflection channel */
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/include/vrrp_sync.h
^
|
@@ -46,6 +46,7 @@
extern void vrrp_sync_set_group(vrrp_sgroup *);
extern int vrrp_sync_group_up(vrrp_sgroup *);
extern int vrrp_sync_leave_fault(vrrp_rt *);
+extern int vrrp_sync_goto_master(vrrp_rt *);
extern void vrrp_sync_backup(vrrp_rt *);
extern void vrrp_sync_master(vrrp_rt *);
extern void vrrp_sync_master_election(vrrp_rt *);
|
[-]
[+]
|
Added |
keepalived-1.2.4.tar.bz2/keepalived/include/vrrp_vmac.h
^
|
@@ -0,0 +1,42 @@
+/*
+ * 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: vrrp_vmac.c include file.
+ *
+ * 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.
+ *
+ * Copyright (C) 2001-2011 Alexandre Cassen, <acassen@linux-vs.org>
+ */
+
+#ifndef _VRRP_VMAC_H
+#define _VRRP_VMAC_H
+
+/* global includes */
+#include <stdio.h>
+#include <stdlib.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <syslog.h>
+#include <net/ethernet.h>
+
+/* local includes */
+#include "vrrp.h"
+#include "vrrp_if.h"
+
+/* prototypes */
+extern int netlink_link_add_vmac(vrrp_rt *);
+extern int netlink_link_del_vmac(vrrp_rt *);
+
+#endif
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/libipvs-2.6/Makefile
^
|
@@ -1,7 +1,7 @@
# Makefile for libipvs
CC = gcc
-CFLAGS = -g -O2 -I/usr/src/linux/include -DLIBIPVS_USE_NL -Wall -Wunused
+CFLAGS = -g -O2 -I/usr/src/linux/include -I/usr/src/linux/include -DLIBIPVS_USE_NL -Wall -Wunused
export OBJS += libipvs.a
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/libipvs-2.6/ip_vs.h
^
|
@@ -6,9 +6,6 @@
#ifndef _IP_VS_H
#define _IP_VS_H
-#include <asm/types.h> /* For __uXX types */
-#include <linux/types.h> /* For __beXX types in userland */
-
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -20,6 +17,13 @@
#include <netlink/genl/ctrl.h>
#endif
+/* Userland compatibility with kernel */
+#define __u32 u_int32_t
+#define __be32 u_int32_t
+#define __u16 u_int16_t
+#define __be16 u_int16_t
+#define __u64 u_int64_t
+
#define IP_VS_VERSION_CODE 0x010201
#define NVERSION(version) \
(version >> 16) & 0xFF, \
@@ -529,4 +533,10 @@
/* End of Generic Netlink interface definitions */
+#undef __u32
+#undef __be32
+#undef __u16
+#undef __be16
+#undef __u64
+
#endif /* _IP_VS_H */
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/Makefile.in
^
|
@@ -8,13 +8,13 @@
INCLUDES = -I../include -I../../lib
CFLAGS = @CFLAGS@ @CPPFLAGS@ $(INCLUDES) \
-Wall -Wunused -Wstrict-prototypes
-DEFS = -D@KERN@ -D@IPVS_SUPPORT@ -D@IPVS_SYNCD@ @DFLAGS@
+DEFS = -D@KERN@ -D@IPVS_SUPPORT@ -D@IPVS_SYNCD@ -D@VRRP_VMAC@ @DFLAGS@
COMPILE = $(CC) $(CFLAGS) $(DEFS)
OBJS = vrrp_daemon.o vrrp_data.o vrrp_parser.o \
vrrp.o vrrp_notify.o vrrp_scheduler.o vrrp_sync.o vrrp_index.o \
vrrp_netlink.o vrrp_arp.o vrrp_if.o vrrp_track.o vrrp_ipaddress.o \
- vrrp_iproute.o vrrp_ipsecah.o vrrp_ndisc.o
+ vrrp_iproute.o vrrp_ipsecah.o vrrp_ndisc.o vrrp_vmac.o
HEADERS = $(OBJS:.o=.h)
.c.o:
@@ -44,7 +44,7 @@
vrrp.o: vrrp.c ../include/vrrp.h ../include/vrrp_scheduler.h \
../include/vrrp_notify.h ../include/ipvswrapper.h ../../lib/memory.h \
../../lib/list.h ../include/vrrp_data.h ../include/vrrp_sync.h ../include/vrrp_index.h \
- ../include/vrrp_arp.h ../../lib/utils.h
+ ../include/vrrp_arp.h ../../lib/utils.h ../include/vrrp_vmac.h
vrrp_notify.o: vrrp_notify.c ../include/vrrp_notify.h ../../lib/memory.h \
../../lib/notify.h
vrrp_scheduler.o: vrrp_scheduler.c ../include/vrrp_scheduler.h \
@@ -72,3 +72,5 @@
vrrp_ipsecah.o: vrrp_ipsecah.c ../include/vrrp_ipsecah.h
vrrp_ndisc.o: vrrp_ndisc.c ../include/vrrp_ndisc.h ../include/vrrp_ipaddress.h \
../../lib/utils.h ../../lib/memory.h
+vrrp_vmac.o: vrrp_vmac.c ../include/vrrp_vmac.h ../include/vrrp_netlink.h \
+ ../include/vrrp_data.h ../../lib/logger.h ../../lib/memory.h ../../lib/utils.h
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp.c
^
|
@@ -35,6 +35,7 @@
#include "vrrp_data.h"
#include "vrrp_sync.h"
#include "vrrp_index.h"
+#include "vrrp_vmac.h"
#include "memory.h"
#include "list.h"
#include "logger.h"
@@ -233,8 +234,8 @@
ihl = ip->ihl << 2;
if (vrrp->auth_type == VRRP_AUTH_AH) {
- ah = (ipsec_ah *) (buffer + sizeof (struct iphdr));
- hd = (vrrp_pkt *) (buffer + ihl + vrrp_ipsecah_len());
+ ah = (ipsec_ah *) (buffer + ihl);
+ hd = (vrrp_pkt *) (ah + vrrp_ipsecah_len());
} else {
hd = (vrrp_pkt *) (buffer + ihl);
}
@@ -330,7 +331,7 @@
*/
if (vrrp->auth_type != hd->auth_type) {
log_message(LOG_INFO, "receive a %d auth, expecting %d!",
- vrrp->auth_type, hd->auth_type);
+ hd->auth_type, vrrp->auth_type);
return VRRP_PACKET_KO;
}
@@ -369,7 +370,8 @@
ip->ihl = 5;
ip->version = 4;
- ip->tos = 0;
+ /* set tos to internet network control */
+ ip->tos = 0xc0;
ip->tot_len = ip->ihl * 4 + vrrp_hd_len(vrrp);
ip->tot_len = htons(ip->tot_len);
ip->id = htons(++vrrp->ip_id);
@@ -740,6 +742,8 @@
* Send an advertisement. To force a new master
* election.
*/
+ if (vrrp->sync && !vrrp_sync_goto_master(vrrp))
+ return;
vrrp_send_adv(vrrp, vrrp->effective_priority);
vrrp->state = VRRP_STATE_MAST;
@@ -998,6 +1002,7 @@
if_setsockopt_hdrincl(&fd);
if_setsockopt_bindtodevice(&fd, ifp);
if_setsockopt_mcast_loop(family, &fd);
+ if_setsockopt_priority(&fd);
if (fd < 0)
return -1;
} else if (family == AF_INET6) {
@@ -1005,6 +1010,7 @@
if_setsockopt_mcast_hops(family, &fd);
if_setsockopt_mcast_if(family, &fd, ifp);
if_setsockopt_mcast_loop(family, &fd);
+ if_setsockopt_priority(&fd);
if (fd < 0)
return -1;
} else {
@@ -1086,10 +1092,14 @@
for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
vrrp = ELEMENT_DATA(e);
- /* remove VIPs */
+ /* Remove VIPs/VROUTEs */
if (vrrp->state == VRRP_STATE_MAST)
vrrp_restore_interface(vrrp, 1);
+ /* Remove VMAC */
+ if (vrrp->vmac)
+ netlink_link_del_vmac(vrrp);
+
/* Run stop script */
if (vrrp->script_stop)
notify_exec(vrrp->script_stop);
@@ -1196,7 +1206,8 @@
vrrp->state = old_vrrp->state;
vrrp->init_state = old_vrrp->state;
vrrp->wantstate = old_vrrp->state;
- vrrp->effective_priority = old_vrrp->effective_priority;
+ if (!old_vrrp->sync)
+ vrrp->effective_priority = old_vrrp->effective_priority;
memcpy(vrrp->ipsecah_counter, old_vrrp->ipsecah_counter, sizeof(seq_counter));
#ifdef _HAVE_IPVS_SYNCD_
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_arp.c
^
|
@@ -50,7 +50,7 @@
len = sendto(garp_fd, garp_buffer, sizeof(m_arphdr) + ETHER_HDR_LEN
, 0, (struct sockaddr *)&sll, sizeof(sll));
if (len < 0)
- log_message(LOG_INFO, "Error sending gratutious ARP on %s for %s",
+ log_message(LOG_INFO, "Error sending gratuitous ARP on %s for %s",
IF_NAME(ipaddress->ifp), inet_ntop2(ipaddress->u.sin.sin_addr.s_addr));
return len;
}
@@ -100,9 +100,9 @@
garp_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_RARP));
if (garp_fd > 0)
- log_message(LOG_INFO, "Registering gratutious ARP shared channel");
+ log_message(LOG_INFO, "Registering gratuitous ARP shared channel");
else
- log_message(LOG_INFO, "Error while registering gratutious ARP shared channel");
+ log_message(LOG_INFO, "Error while registering gratuitous ARP shared channel");
}
void gratuitous_arp_close(void)
{
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_daemon.c
^
|
@@ -52,7 +52,6 @@
{
/* Destroy master thread */
signal_handler_destroy();
- free_vrrp_sockpool(vrrp_data);
thread_destroy_master(master);
/* Clear static entries */
@@ -70,6 +69,7 @@
/* Clean data */
free_global_data(data);
+ free_vrrp_sockpool(vrrp_data);
free_vrrp_data(vrrp_data);
free_vrrp_buffer();
@@ -153,8 +153,6 @@
void
sighup_vrrp(void *v, int sig)
{
- log_message(LOG_INFO, "Reloading VRRP child process(%d) on signal",
- getpid());
thread_add_event(master, reload_vrrp_thread, NULL, 0);
}
@@ -162,7 +160,6 @@
void
sigend_vrrp(void *v, int sig)
{
- log_message(LOG_INFO, "Terminating VRRP child process on signal");
if (master)
thread_add_terminate_event(master);
}
@@ -240,7 +237,7 @@
}
/* We catch a SIGCHLD, handle it */
- log_message(LOG_INFO, "VRRP child process(%d) died: Respawning", pid);
+ log_message(LOG_ALERT, "VRRP child process(%d) died: Respawning", pid);
start_vrrp_child();
return 0;
}
@@ -272,7 +269,7 @@
}
/* Opening local VRRP syslog channel */
- openlog(PROG_VRRP, LOG_PID | (debug & 1) ? LOG_CONS : 0,
+ openlog(PROG_VRRP, LOG_PID | ((debug & 1) ? LOG_CONS : 0),
(log_facility==LOG_DAEMON) ? LOG_LOCAL1 : log_facility);
/* Child process part, write pidfile */
@@ -289,6 +286,9 @@
/* change to / dir */
ret = chdir("/");
+ if (ret < 0) {
+ log_message(LOG_INFO, "VRRP child process: error chdir");
+ }
/* Set mask */
umask(0);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_data.c
^
|
@@ -80,6 +80,8 @@
str = VECTOR_SLOT(vgroup->iname, i);
log_message(LOG_INFO, " monitor = %s", str);
}
+ if (vgroup->global_tracking)
+ log_message(LOG_INFO, " Same tracking for all VRRP instances");
if (vgroup->script_backup)
log_message(LOG_INFO, " Backup state transition script = %s",
vgroup->script_backup);
@@ -282,6 +284,7 @@
new->gname = (char *) MALLOC(size + 1);
new->state = VRRP_STATE_INIT;
memcpy(new->gname, gname, size);
+ new->global_tracking = 0;
list_add(vrrp_data->vrrp_sync_group, new);
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_if.c
^
|
@@ -95,6 +95,7 @@
if (!strcmp(ifp->ifname, ifname))
return ifp;
}
+
log_message(LOG_ERR, "No such interface, %s", ifname);
return NULL;
}
@@ -261,9 +262,9 @@
}
void
-dump_if(void *if_data)
+dump_if(void *data)
{
- interface *ifp = if_data;
+ interface *ifp = data;
char addr_str[41];
log_message(LOG_INFO, "------< NIC >------");
@@ -617,6 +618,24 @@
close(*sd);
*sd = -1;
}
+
+ return *sd;
+}
+
+int if_setsockopt_priority(int *sd) {
+ int ret;
+ int priority = 6;
+
+ if (*sd < 0)
+ return -1;
+
+ /* Set SO_PRIORITY for VRRP traffic */
+ ret = setsockopt(*sd, SOL_SOCKET, SO_PRIORITY, &priority, sizeof(priority));
+ if (ret < 0) {
+ log_message(LOG_INFO, "cant set SO_PRIORITY IP option. errno=%d (%m)", errno);
+ close(*sd);
+ *sd = -1;
+ }
return *sd;
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_ndisc.c
^
|
@@ -127,8 +127,13 @@
char *lladdr = (char *) IF_HWADDR(ipaddress->ifp);
int len;
- /* Ethernet header */
- memset(eth->ether_dhost, 0xFF, ETH_ALEN);
+ /* Ethernet header:
+ * Destination ethernet address MUST use specific address Mapping
+ * as specified in rfc2464.7 Address Mapping for
+ */
+ memset(eth->ether_dhost, 0, ETH_ALEN);
+ eth->ether_dhost[0] = eth->ether_dhost[1] = 0x33;
+ eth->ether_dhost[5] = 1;
memcpy(eth->ether_shost, lladdr, ETH_ALEN);
eth->ether_type = htons(ETHERTYPE_IPV6);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_netlink.c
^
|
@@ -454,6 +454,11 @@
if (ifi->ifi_type == ARPHRD_LOOPBACK)
return 0;
+ /* Skip it if already exist */
+ ifp = if_get_by_ifname(name);
+ if (ifp)
+ return 0;
+
/* Fill the interface structure */
ifp = (interface *) MALLOC(sizeof (interface));
memcpy(ifp->ifname, name, strlen(name));
@@ -677,10 +682,8 @@
int
kernel_netlink(thread_t * thread)
{
- int status = 0;
-
if (thread->type != THREAD_READ_TIMEOUT)
- status = netlink_parse_info(netlink_broadcast_filter, &nl_kernel, NULL);
+ netlink_parse_info(netlink_broadcast_filter, &nl_kernel, NULL);
thread_add_read(master, kernel_netlink, NULL, nl_kernel.fd,
NETLINK_TIMER);
return 0;
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_parser.c
^
|
@@ -27,6 +27,7 @@
#include "vrrp_sync.h"
#include "vrrp_index.h"
#include "vrrp_if.h"
+#include "vrrp_vmac.h"
#include "vrrp.h"
#include "global_data.h"
#include "global_parser.h"
@@ -95,11 +96,39 @@
vgroup->smtp_alert = 1;
}
static void
+vrrp_gglobal_tracking_handler(vector strvec)
+{
+ vrrp_sgroup *vgroup = LIST_TAIL_DATA(vrrp_data->vrrp_sync_group);
+ vgroup->global_tracking = 1;
+}
+static void
vrrp_handler(vector strvec)
{
alloc_vrrp(VECTOR_SLOT(strvec, 1));
}
static void
+vrrp_vmac_handler(vector strvec)
+{
+ vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
+ vrrp->vmac = 1;
+ if (!vrrp->mcast_saddr)
+ vrrp->mcast_saddr = IF_ADDR(vrrp->ifp);
+ if (VECTOR_SIZE(strvec) == 2) {
+ strncpy(vrrp->vmac_ifname, VECTOR_SLOT(strvec, 1),
+ IFNAMSIZ - 1);
+ } else if (vrrp->vrid) {
+ snprintf(vrrp->vmac_ifname, IFNAMSIZ, "vrrp.%d", vrrp->vrid);
+ }
+
+ if (strlen(vrrp->vmac_ifname)) {
+ log_message(LOG_INFO, "vmac_ifname=%s for vrrp_instace %s"
+ , vrrp->vmac_ifname
+ , vrrp->iname);
+ }
+ if (vrrp->ifp && !(vrrp->vmac & 2))
+ netlink_link_add_vmac(vrrp);
+}
+static void
vrrp_native_ipv6_handler(vector strvec)
{
vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
@@ -130,6 +159,8 @@
vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
char *name = VECTOR_SLOT(strvec, 1);
vrrp->ifp = if_get_by_ifname(name);
+ if (vrrp->vmac && !(vrrp->vmac & 2))
+ netlink_link_add_vmac(vrrp);
}
static void
vrrp_track_int_handler(vector strvec)
@@ -160,11 +191,19 @@
vrrp->vrid = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_VID(vrrp->vrid)) {
- log_message(LOG_INFO, "VRRP Error : VRID not valid !\n");
+ log_message(LOG_INFO, "VRRP Error : VRID not valid !");
log_message(LOG_INFO,
- " must be between 1 & 255. reconfigure !\n");
- } else
+ " must be between 1 & 255. reconfigure !");
+ } else {
alloc_vrrp_bucket(vrrp);
+ if (vrrp->vmac && strlen(vrrp->vmac_ifname) == 0) {
+ snprintf(vrrp->vmac_ifname, IFNAMSIZ, "vrrp.%d"
+ , vrrp->vrid);
+ log_message(LOG_INFO, "vmac_ifname=%s for vrrp_instace %s"
+ , vrrp->vmac_ifname
+ , vrrp->iname);
+ }
+ }
}
static void
vrrp_prio_handler(vector strvec)
@@ -173,9 +212,9 @@
vrrp->effective_priority = vrrp->base_priority = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_PRIORITY(vrrp->base_priority)) {
- log_message(LOG_INFO, "VRRP Error : Priority not valid !\n");
+ log_message(LOG_INFO, "VRRP Error : Priority not valid !");
log_message(LOG_INFO,
- " must be between 1 & 255. reconfigure !\n");
+ " must be between 1 & 255. reconfigure !");
log_message(LOG_INFO,
" Using default value : %d\n", VRRP_PRIO_DFL);
vrrp->effective_priority = vrrp->base_priority = VRRP_PRIO_DFL;
@@ -188,10 +227,10 @@
vrrp->adver_int = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_ADVERT_INT(vrrp->adver_int)) {
- log_message(LOG_INFO, "VRRP Error : Advert interval not valid !\n");
+ log_message(LOG_INFO, "VRRP Error : Advert interval not valid !");
log_message(LOG_INFO,
- " must be between less than 1sec.\n");
- log_message(LOG_INFO, " Using default value : 1sec\n");
+ " must be between less than 1sec.");
+ log_message(LOG_INFO, " Using default value : 1sec");
vrrp->adver_int = 1;
}
vrrp->adver_int *= TIMER_HZ;
@@ -203,8 +242,8 @@
vrrp->debug = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_DEBUG_INT(vrrp->debug)) {
- log_message(LOG_INFO, "VRRP Error : Debug interval not valid !\n");
- log_message(LOG_INFO, " must be between 0-4\n");
+ log_message(LOG_INFO, "VRRP Error : Debug interval not valid !");
+ log_message(LOG_INFO, " must be between 0-4");
vrrp->debug = 0;
}
}
@@ -227,8 +266,8 @@
vrrp->preempt_delay = atoi(VECTOR_SLOT(strvec, 1));
if (VRRP_IS_BAD_PREEMPT_DELAY(vrrp->preempt_delay)) {
- log_message(LOG_INFO, "VRRP Error : Preempt_delay not valid !\n");
- log_message(LOG_INFO, " must be between 0-%d\n",
+ log_message(LOG_INFO, "VRRP Error : Preempt_delay not valid !");
+ log_message(LOG_INFO, " must be between 0-%d",
TIMER_MAX_SEC);
vrrp->preempt_delay = 0;
}
@@ -287,6 +326,8 @@
{
vrrp_rt *vrrp = LIST_TAIL_DATA(vrrp_data->vrrp);
vrrp->garp_delay = atoi(VECTOR_SLOT(strvec, 1)) * TIMER_HZ;
+ if (vrrp->garp_delay < TIMER_HZ)
+ vrrp->garp_delay = TIMER_HZ;
}
static void
vrrp_auth_type_handler(vector strvec)
@@ -307,8 +348,11 @@
int max_size = sizeof (vrrp->auth_data);
int str_len = strlen(str);
- if (str_len > max_size)
+ if (str_len > max_size) {
str_len = max_size;
+ log_message(LOG_INFO,
+ "Truncating auth_pass to %d characters", max_size);
+ }
memset(vrrp->auth_data, 0, max_size);
memcpy(vrrp->auth_data, str, str_len);
@@ -378,6 +422,8 @@
{
vrrp_script *vscript = LIST_TAIL_DATA(vrrp_data->vrrp_script);
vscript->interval = atoi(VECTOR_SLOT(strvec, 1)) * TIMER_HZ;
+ if (vscript->interval < TIMER_HZ)
+ vscript->interval = TIMER_HZ;
}
static void
vrrp_vscript_weight_handler(vector strvec)
@@ -420,7 +466,9 @@
install_keyword("notify_fault", &vrrp_gnotify_fault_handler);
install_keyword("notify", &vrrp_gnotify_handler);
install_keyword("smtp_alert", &vrrp_gsmtp_handler);
+ install_keyword("global_tracking", &vrrp_gglobal_tracking_handler);
install_keyword_root("vrrp_instance", &vrrp_handler);
+ install_keyword("use_vmac", &vrrp_vmac_handler);
install_keyword("native_ipv6", &vrrp_native_ipv6_handler);
install_keyword("state", &vrrp_state_handler);
install_keyword("interface", &vrrp_int_handler);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_scheduler.c
^
|
@@ -189,7 +189,7 @@
/* In case of VRRP SYNC, we have to carefully check that we are
* not running floating priorities on any VRRP instance.
*/
- if (vrrp->sync) {
+ if (vrrp->sync && !vrrp->sync->global_tracking) {
element e;
tracked_sc *sc;
tracked_if *tip;
@@ -702,11 +702,11 @@
prio_offset = 0;
/* Now we will sum the weights of all interfaces which are tracked. */
- if (!vrrp->sync && !LIST_ISEMPTY(vrrp->track_ifp))
+ if ((!vrrp->sync || vrrp->sync->global_tracking) && !LIST_ISEMPTY(vrrp->track_ifp))
prio_offset += vrrp_tracked_weight(vrrp->track_ifp);
/* Now we will sum the weights of all scripts which are tracked. */
- if (!vrrp->sync && !LIST_ISEMPTY(vrrp->track_script))
+ if ((!vrrp->sync || vrrp->sync->global_tracking) && !LIST_ISEMPTY(vrrp->track_script))
prio_offset += vrrp_script_weight(vrrp->track_script);
if (vrrp->base_priority == VRRP_PRIO_OWNER) {
@@ -948,7 +948,14 @@
closeall(0);
open("/dev/null", O_RDWR);
ret = dup(0);
+ if (ret < 0) {
+ log_message(LOG_INFO, "dup(0) error");
+ }
+
ret = dup(0);
+ if (ret < 0) {
+ log_message(LOG_INFO, "dup(0) error");
+ }
status = system_call(vscript->script);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_sync.c
^
|
@@ -135,6 +135,32 @@
return 0;
}
+/* Check transition to master state */
+int
+vrrp_sync_goto_master(vrrp_rt * vrrp)
+{
+ vrrp_rt *isync;
+ vrrp_sgroup *vgroup = vrrp->sync;
+ list l = vgroup->index_list;
+ element e;
+
+ if (GROUP_STATE(vgroup) == VRRP_STATE_MAST)
+ return 1;
+ if (GROUP_STATE(vgroup) == VRRP_STATE_GOTO_MASTER)
+ return 1;
+
+ /* Only sync to master if everyone wants to
+ * i.e. prefer backup state to avoid thrashing */
+ for (e = LIST_HEAD(l); e; ELEMENT_NEXT(e)) {
+ isync = ELEMENT_DATA(e);
+ if (isync != vrrp && (isync->wantstate != VRRP_STATE_GOTO_MASTER &&
+ isync->wantstate != VRRP_STATE_MAST)) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
void
vrrp_sync_master_election(vrrp_rt * vrrp)
{
@@ -203,6 +229,8 @@
if (GROUP_STATE(vgroup) == VRRP_STATE_MAST)
return;
+ if (!vrrp_sync_goto_master(vrrp))
+ return;
log_message(LOG_INFO, "VRRP_Group(%s) Syncing instances to MASTER state",
GROUP_NAME(vgroup));
|
[-]
[+]
|
Added |
keepalived-1.2.4.tar.bz2/keepalived/vrrp/vrrp_vmac.c
^
|
@@ -0,0 +1,224 @@
+/*
+ * 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: NETLINK VMAC address manipulation.
+ *
+ * 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.
+ *
+ * Copyright (C) 2001-2011 Alexandre Cassen, <acassen@linux-vs.org>
+ */
+
+/* local include */
+#include "vrrp_vmac.h"
+#include "vrrp_netlink.h"
+#include "vrrp_data.h"
+#include "logger.h"
+#include "memory.h"
+#include "utils.h"
+
+/* private matter */
+static const char *ll_kind = "macvlan";
+
+#ifdef _HAVE_VRRP_VMAC_
+/* Link layer handling */
+static int
+netlink_link_setlladdr(vrrp_rt *vrrp)
+{
+ int status = 1;
+ u_char ll_addr[ETH_ALEN] = {0x00, 0x00, 0x5e, 0x00, 0x01, vrrp->vrid};
+ struct {
+ struct nlmsghdr n;
+ struct ifinfomsg ifi;
+ char buf[256];
+ } req;
+
+ memset(&req, 0, sizeof (req));
+
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof (struct ifinfomsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST;
+ req.n.nlmsg_type = RTM_NEWLINK;
+ req.ifi.ifi_family = AF_INET;
+ req.ifi.ifi_index = IF_INDEX(vrrp->ifp);
+
+ addattr_l(&req.n, sizeof(req), IFLA_ADDRESS, ll_addr, ETH_ALEN);
+
+ if (netlink_talk(&nl_cmd, &req.n) < 0)
+ status = -1;
+ else
+ memcpy(vrrp->ifp->hw_addr, ll_addr, ETH_ALEN);
+
+ return status;
+}
+
+static int
+netlink_link_setmode(vrrp_rt *vrrp)
+{
+ int status = 1;
+ struct {
+ struct nlmsghdr n;
+ struct ifinfomsg ifi;
+ char buf[256];
+ } req;
+ struct rtattr *linkinfo;
+ struct rtattr *data;
+
+ memset(&req, 0, sizeof (req));
+
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof (struct ifinfomsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST;
+ req.n.nlmsg_type = RTM_NEWLINK;
+ req.ifi.ifi_family = AF_INET;
+ req.ifi.ifi_index = IF_INDEX(vrrp->ifp);
+
+ linkinfo = NLMSG_TAIL(&req.n);
+ addattr_l(&req.n, sizeof(req), IFLA_LINKINFO, NULL, 0);
+ addattr_l(&req.n, sizeof(req), IFLA_INFO_KIND, (void *) ll_kind,
+ strlen(ll_kind));
+
+ data = NLMSG_TAIL(&req.n);
+ addattr_l(&req.n, sizeof(req), IFLA_INFO_DATA, NULL, 0);
+
+ /*
+ * In private mode, macvlan will receive frames with same MAC addr
+ * as configured on the interface.
+ */
+ addattr32(&req.n, sizeof(req), IFLA_MACVLAN_MODE,
+ MACVLAN_MODE_PRIVATE);
+ data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data;
+
+ linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo;
+
+ if (netlink_talk(&nl_cmd, &req.n) < 0)
+ status = -1;
+
+ return status;
+}
+
+static int
+netlink_link_up(vrrp_rt *vrrp)
+{
+ int status = 1;
+ struct {
+ struct nlmsghdr n;
+ struct ifinfomsg ifi;
+ char buf[256];
+ } req;
+
+ memset(&req, 0, sizeof (req));
+
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof (struct ifinfomsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST;
+ req.n.nlmsg_type = RTM_NEWLINK;
+ req.ifi.ifi_family = AF_UNSPEC;
+ req.ifi.ifi_index = IF_INDEX(vrrp->ifp);
+ req.ifi.ifi_change |= IFF_UP;
+ req.ifi.ifi_flags |= IFF_UP;
+
+ if (netlink_talk(&nl_cmd, &req.n) < 0)
+ status = -1;
+
+ return status;
+}
+#endif
+
+int
+netlink_link_add_vmac(vrrp_rt *vrrp)
+{
+#ifdef _HAVE_VRRP_VMAC_
+ struct rtattr *linkinfo;
+ interface *ifp;
+ char ifname[IFNAMSIZ];
+ struct {
+ struct nlmsghdr n;
+ struct ifinfomsg ifi;
+ char buf[256];
+ } req;
+
+ if (!vrrp->ifp)
+ return -1;
+
+ memset(&req, 0, sizeof (req));
+ memset(ifname, 0, IFNAMSIZ);
+ strncpy(ifname, vrrp->vmac_ifname, IFNAMSIZ - 1);
+
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof (struct ifinfomsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;
+ req.n.nlmsg_type = RTM_NEWLINK;
+ req.ifi.ifi_family = AF_INET;
+
+ /* macvlan settings */
+ linkinfo = NLMSG_TAIL(&req.n);
+ addattr_l(&req.n, sizeof(req), IFLA_LINKINFO, NULL, 0);
+ addattr_l(&req.n, sizeof(req), IFLA_INFO_KIND, (void *)ll_kind, strlen(ll_kind));
+ linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo;
+ addattr_l(&req.n, sizeof(req), IFLA_LINK, &IF_INDEX(vrrp->ifp), sizeof(uint32_t));
+ addattr_l(&req.n, sizeof(req), IFLA_IFNAME, ifname, strlen(ifname));
+
+ if (netlink_talk(&nl_cmd, &req.n) < 0)
+ return -1;
+
+ /*
+ * Update interface queue and vrrp instance interface binding.
+ * bring it UP !
+ */
+ netlink_interface_lookup();
+ ifp = if_get_by_ifname(ifname);
+ if (!ifp)
+ return -1;
+ vrrp->ifp = ifp;
+ vrrp->vmac |= 2;
+ netlink_link_setlladdr(vrrp);
+ netlink_link_up(vrrp);
+
+ /*
+ * By default MACVLAN interface are in VEPA mode which filters
+ * out received packets whose MAC source address matches that
+ * of the MACVLAN interface. Setting MACVLAN interface in private
+ * mode will not filter based on source MAC address.
+ */
+ netlink_link_setmode(vrrp);
+#endif
+ return 1;
+}
+
+int
+netlink_link_del_vmac(vrrp_rt *vrrp)
+{
+ int status = 1;
+
+#ifdef _HAVE_VRRP_VMAC_
+ struct {
+ struct nlmsghdr n;
+ struct ifinfomsg ifi;
+ char buf[256];
+ } req;
+
+ if (!vrrp->ifp)
+ return -1;
+
+ memset(&req, 0, sizeof (req));
+
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof (struct ifinfomsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST;
+ req.n.nlmsg_type = RTM_DELLINK;
+ req.ifi.ifi_family = AF_INET;
+ req.ifi.ifi_index = IF_INDEX(vrrp->ifp);
+
+ if (netlink_talk(&nl_cmd, &req.n) < 0)
+ status = -1;
+#endif
+
+ return status;
+}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/lib/logger.c
^
|
@@ -36,13 +36,15 @@
log_message(const int facility, const char *format, ...)
{
va_list args;
+ char buf[256];
- va_start(args,format);
+ va_start(args, format);
+ vsnprintf(buf, sizeof(buf), format, args);
+ va_end(args);
if (log_console) {
- vfprintf(stderr, format, args);
- fprintf(stderr,"\n");
+ fprintf(stderr, "%s\n", buf);
}
- vsyslog(facility, format, args);
+ syslog(facility, "%s", buf);
}
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/lib/notify.c
^
|
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <syslog.h>
#include <fcntl.h>
+#include <errno.h>
#include "notify.h"
#include "signals.h"
#include "logger.h"
@@ -79,8 +80,16 @@
closeall(0);
open("/dev/null", O_RDWR);
+
ret = dup(0);
+ if (ret < 0) {
+ log_message(LOG_INFO, "dup(0) error");
+ }
+
ret = dup(0);
+ if (ret < 0) {
+ log_message(LOG_INFO, "dup(0) error");
+ }
system_call(cmd);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/lib/parser.c
^
|
@@ -199,10 +199,10 @@
int i;
for(i = 0; i < globbuf.gl_pathc; i++){
- log_message(LOG_INFO, "Opening file '%s'.\n",globbuf.gl_pathv[i]);
+ log_message(LOG_INFO, "Opening file '%s'.", globbuf.gl_pathv[i]);
stream = fopen(globbuf.gl_pathv[i], "r");
if (!stream) {
- log_message(LOG_INFO, "Configuration file '%s' open problem (%s)...\n"
+ log_message(LOG_INFO, "Configuration file '%s' open problem (%s)..."
, globbuf.gl_pathv[i], strerror(errno));
return;
}
@@ -211,14 +211,26 @@
char prev_path[MAXBUF];
path = getcwd(prev_path, MAXBUF);
+ if (!path) {
+ log_message(LOG_INFO, "getcwd(%s) error (%s)"
+ , prev_path, strerror(errno));
+ }
char *confpath = strdup(globbuf.gl_pathv[i]);
dirname(confpath);
ret = chdir(confpath);
+ if (ret < 0) {
+ log_message(LOG_INFO, "chdir(%s) error (%s)"
+ , confpath, strerror(errno));
+ }
process_stream(current_keywords);
fclose(stream);
ret = chdir(prev_path);
+ if (ret < 0) {
+ log_message(LOG_INFO, "chdir(%s) error (%s)"
+ , prev_path, strerror(errno));
+ }
}
globfree(&globbuf);
@@ -251,10 +263,19 @@
char *prev_conf_file = current_conf_file;
char prev_path[MAXBUF];
path = getcwd(prev_path, MAXBUF);
+ if (!path) {
+ log_message(LOG_INFO, "getcwd(%s) error (%s)\n"
+ , prev_path, strerror(errno));
+ }
+
read_conf_file(conf_file);
current_stream = prev_stream;
current_conf_file = prev_conf_file;
ret = chdir(prev_path);
+ if (ret < 0) {
+ log_message(LOG_INFO, "chdir(%s) error (%s)\n"
+ , prev_path, strerror(errno));
+ }
return 1;
}
free_strvec(strvec);
|
[-]
[+]
|
Changed |
keepalived-1.2.4.tar.bz2/lib/utils.c
^
|
@@ -147,16 +147,15 @@
uint8_t
inet_stor(char *addr)
{
- uint8_t range = 0;
char *cp = addr;
if (!strstr(addr, "-"))
- return range;
+ return 0;
while (*cp != '-' && *cp != '\0')
cp++;
if (*cp == '-')
- return atoi(++cp);
- return range;
+ return strtoul(++cp, NULL, (strchr(addr, ':')) ? 16 : 10);
+ return 0;
}
/* IP string to sockaddr_storage */
|