vrrp: dont try to leave mcast group in unicast mode

Only perform mcast drop membership in multicast mode.
vrrp: Release and refresh properly fd hash index

Rehashing into the same loop as releasing is not really the best idea...
Reworked a little previous patch to properly release hash entries related
to the same instance and then hash it back on new fd.
vrrp: use configuration mcast group for leave message

Just forgot to use configured mcast group (v6,v4) in previous related
patch while leaving VRRP group.
Merge pull request #67 from rohara/devel

Fix various memory allocation bugs and resource leaks.
vrrp: reverted vmac patch included in last merge

Hey, current VMAC code is working and tested... arithmetic is right and
structures needed ! You can optimize this just in one way by removing
netlink_link_setmode and setting mac address and private mode directly
in netlink_link_add_vmac in one shot. But design here is directly coming
from iproute2 code so I decided to keep this design.
vrrp: dont try to load ip_vs module when not needed

Add some logic around to not load ip_vs module when VRRP conf
dont need it (eg: lvs_sync_daemon_interface").
keepalived-1.2.11
parser: fix realloc issue

Fix reallocation issue introduced in last merge
keepalived-1.2.12
vrrp: Use the standard unsigned int types

This fixes building with musl libc, which does not expose the internal
__uint* defines.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Merge pull request #72 from ncopa/master

vrrp: Use the standard unsigned int types
Fix template issue in IPv6 host header.
ipvs_syncd_cmd uses memset() to zero the daemonrule buffer before
populating it and sending it up. daemonrule is malloc()ed by
ipvs_start(). ipvs_start() can bail early if it can't communicate with
ipvs. Neither place which call ipvs_start() check the return value,
allowing them to walk straight into a NULL pointer deref.
Without inhibit_on_failure on a real_server, when the server is marked
down existing TCP connections to it are simply blackholed. Hence
inhibit_on_failure: by setting the weight to zero no new connections
are sent to that server, but because the server isn't completely
removed from the table existing connections are allowed to continue.

The same problem exists with sorry_server. When a real_server comes
back up the sorry_server is removed from the pool and existing
connections are blackholed. Instead of continued service, which may
usually be a fast response indicating overload, the client must engage
in a lengthy wait for the connection to time out. It would be better
in many cases to allow the sorry_server connections to complete
naturally.

Luckily the code is structured well enough that all is required to get
this behaviour is to set the inhibit member of the sorry_server
structure, which is mostly just a change to the config file parser.
unify logging of RS and VS

This fixes the bug of displaying a FWM service as [x.x.x.x]:0,
where x.x.x.x is the first RS of that service
unify connection options among checkers

All the remote checkers (TCP, HTTP/SSL, SMTP) now have the same set of connection options:
 * connect_ip (new to TCP, HTTP)
 * connect_port
 * bindto
 * bind_port  (new)
 * connect_timeout (new to SMTP)

All of them are optional with reasonable defaults.
The patch is designed for simplicity in adding a new option.

Since the connect_ip could be inequal to the RS address and, worse, the same for all RSes,
the endpoint is now logged as [RS]:rport, not the [connect_ip]:connect_port.
fwmark connection option
make SO_MARK a compile-time option
documentation for generic connection opts
vrrp: Fix sync of interface status flag when using VMAC interface

There is a chance that the VMAC interface status flags (up/down) could be
different from the base interface flags.
This patch will only change the VMAC interface status flags when the base
interface is changed.

Signed-off-by: Jonas Johansson <jonasj76@gmail.com>