Package: resource-agents
Version: 1:3.9.2-5+deb7u1
Severity: important
Tags: upstream patch
Dear Maintainer,
The send_arp binary (libnet-version) doesn't work on big endian systems
that use 64bit for datatype u_long. In our case this means that
heartbeat with VIPs doesn't work because the needed ARP broadcast on IP
failover is broken.
Network traces showed that instead of the ip given on commandline 0.0.0.0
was used in all packets.
The problem is caused by incorrect use of u_long as return value of
libnet_name2addr4 (libnet1.1 version returns u_int32_t). This variable
is casted to u_char* and given to libnet_build_arp, which copies the
first 4 bytes to the arp packet. On big endian systems with 64bit wide
long datatype these 4 bytes are 0x00 and the ip is in byte 5 to 8.
Attached patch changes the type of the variable ip to u_int32_t for
libnet1.1-code.
The problem seems to be fixed in latest upstream version. The fix in
upstream can be seen here:
https://github.com/ClusterLabs/resource-agents/commit/1eea8a6cb3b6a58908276b23e66ce282b1733c9e
Greetings,
Martin
-- System Information:
Debian Release: 7.1
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: s390x
Kernel: Linux 3.2.0-4zivit1-s390x (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages resource-agents depends on:
ii cluster-glue 1.0.9+hg2665-1
ii libc6 2.13-38
ii libglib2.0-0 2.33.12+really2.32.4-5
ii libnet1 1.1.4-2.1
ii libplumb2 1.0.9+hg2665-1
ii libplumbgpl2 1.0.9+hg2665-1
ii python 2.7.3-4
resource-agents recommends no packages.
resource-agents suggests no packages.
-- no debconf information
--- a/tools/send_arp.libnet.c 2011-06-29 14:51:48.000000000 +0200
+++ b/tools/send_arp.libnet.c 2013-09-19 09:45:44.691470508 +0200
@@ -49,15 +49,17 @@
#ifdef HAVE_LIBNET_1_0_API
# define LTYPE struct libnet_link_int
+# define IPTYPE u_long
#endif
#ifdef HAVE_LIBNET_1_1_API
# define LTYPE libnet_t
+# define IPTYPE u_int32_t
#endif
#define PIDDIR HA_VARRUNDIR "/" PACKAGE
#define PIDFILE_BASE PIDDIR "/send_arp-"
-static int send_arp(LTYPE* l, u_long ip, u_char *device, u_char mac[6]
+static int send_arp(LTYPE* l, IPTYPE ip, u_char *device, u_char mac[6]
, u_char *broadcast, u_char *netmask, u_short arptype);
static char print_usage[]={
@@ -133,7 +135,7 @@
char* macaddr;
char* broadcast;
char* netmask;
- u_long ip;
+ IPTYPE ip;
u_char src_mac[6];
LTYPE* l;
int repeatcount = 1;
@@ -388,7 +390,7 @@
#ifdef HAVE_LIBNET_1_0_API
int
-send_arp(struct libnet_link_int *l, u_long ip, u_char *device, u_char *macaddr, u_char *broadcast, u_char *netmask, u_short arptype)
+send_arp(struct libnet_link_int *l, IPTYPE ip, u_char *device, u_char *macaddr, u_char *broadcast, u_char *netmask, u_short arptype)
{
int n;
u_char *buf;
@@ -465,7 +467,7 @@
#ifdef HAVE_LIBNET_1_1_API
int
-send_arp(libnet_t* lntag, u_long ip, u_char *device, u_char macaddr[6], u_char *broadcast, u_char *netmask, u_short arptype)
+send_arp(libnet_t* lntag, IPTYPE ip, u_char *device, u_char macaddr[6], u_char *broadcast, u_char *netmask, u_short arptype)
{
int n;
u_char *target_mac;