mirror of https://github.com/sipwise/heartbeat.git
Fails when compiling against Debian/jessie with: | ucast.c: In function 'HB_make_send_sock': | ucast.c:466:6: error: conflicting types for 'i' | int i = 1; | ^ As noted in #713662 "in the current /usr/include/asm-generic/socket.h both macros are defined", patch also taken from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713662mr3.5.1
parent
973eef3ff5
commit
c45620178c
@ -0,0 +1,42 @@
|
||||
Description: Fix FTBFS
|
||||
Fix FTBFS because of duplicate variable 'i' for both a struct and an
|
||||
int variable.
|
||||
Author: Andres Rodriguez <andreserl@ubuntu.com>
|
||||
Bug-Ubuntu: https://launchpad.net/bugs/1188428
|
||||
Bug-Debian: http://bugs.debian.org/713662
|
||||
Forwarded: no
|
||||
|
||||
--- a/lib/plugins/HBcomm/ucast.c
|
||||
+++ b/lib/plugins/HBcomm/ucast.c
|
||||
@@ -460,7 +460,7 @@
|
||||
struct ip_private *ei;
|
||||
int tos;
|
||||
#if defined(SO_BINDTODEVICE)
|
||||
- struct ifreq i;
|
||||
+ struct ifreq ifc;
|
||||
#endif
|
||||
#if defined(SO_REUSEPORT)
|
||||
int i = 1;
|
||||
@@ -497,18 +497,18 @@
|
||||
*
|
||||
* This is so we can have redundant NICs, and heartbeat on both
|
||||
*/
|
||||
- strcpy(i.ifr_name, ei->interface);
|
||||
+ strcpy(ifc.ifr_name, ei->interface);
|
||||
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
|
||||
- &i, sizeof(i)) == -1) {
|
||||
+ &ifc, sizeof(ifc)) == -1) {
|
||||
PILCallLog(LOG, PIL_CRIT,
|
||||
"ucast: error setting option SO_BINDTODEVICE(w) on %s: %s",
|
||||
- i.ifr_name, strerror(errno));
|
||||
+ ifc.ifr_name, strerror(errno));
|
||||
close(sockfd);
|
||||
return -1;
|
||||
}
|
||||
PILCallLog(LOG, PIL_INFO, "ucast: bound send socket to device: %s",
|
||||
- i.ifr_name);
|
||||
+ ifc.ifr_name);
|
||||
}
|
||||
#endif
|
||||
#if defined(SO_REUSEPORT)
|
||||
Loading…
Reference in new issue