diff options
Diffstat (limited to 'net/openbgpd/files/patch-bgpd_carp.c')
-rw-r--r-- | net/openbgpd/files/patch-bgpd_carp.c | 80 |
1 files changed, 32 insertions, 48 deletions
diff --git a/net/openbgpd/files/patch-bgpd_carp.c b/net/openbgpd/files/patch-bgpd_carp.c index fee9e485761..0edf5e07216 100644 --- a/net/openbgpd/files/patch-bgpd_carp.c +++ b/net/openbgpd/files/patch-bgpd_carp.c @@ -1,58 +1,42 @@ ---- bgpd/carp.c 2007-04-23 16:52:28.000000000 +0200 -+++ bgpd/carp.c 2008-03-18 13:27:29.000000000 +0100 -@@ -102,28 +102,7 @@ +Index: bgpd/carp.c +=================================================================== +RCS file: /home/cvs/private/hrs/openbgpd/bgpd/carp.c,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -p -r1.1.1.1 -r1.2 +--- bgpd/carp.c 30 Jun 2009 05:46:15 -0000 1.1.1.1 ++++ bgpd/carp.c 30 Jun 2009 06:40:07 -0000 1.2 +@@ -102,6 +102,9 @@ carp_demote_shutdown(void) int carp_demote_get(char *group) { -- int s; -- struct ifgroupreq ifgr; -- -- if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { -- log_warn("carp_demote_get: socket"); -- return (-1); -- } -- -- bzero(&ifgr, sizeof(ifgr)); -- strlcpy(ifgr.ifgr_name, group, sizeof(ifgr.ifgr_name)); -- -- if (ioctl(s, SIOCGIFGATTR, (caddr_t)&ifgr) == -1) { -- if (errno == ENOENT) -- log_warnx("group \"%s\" does not exist", group); -- else -- log_warn("carp_demote_get: ioctl"); -- close(s); - return (-1); -- } -- -- close(s); -- return ((int)ifgr.ifgr_attrib.ifg_carp_demoted); ++#if defined(__FreeBSD__) /* FreeBSD does not have support for CARP */ ++ return (-1); ++#else + int s; + struct ifgroupreq ifgr; + +@@ -124,6 +127,7 @@ carp_demote_get(char *group) + + close(s); + return ((int)ifgr.ifgr_attrib.ifg_carp_demoted); ++#endif /* defined(__FreeBSD__) */ } int -@@ -156,26 +135,5 @@ +@@ -156,6 +160,9 @@ carp_demote_set(char *group, int demote) int carp_demote_ioctl(char *group, int demote) { -- int s, res; -- struct ifgroupreq ifgr; -- -- if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { -- log_warn("carp_demote_get: socket"); - return (-1); -- } -- -- bzero(&ifgr, sizeof(ifgr)); -- strlcpy(ifgr.ifgr_name, group, sizeof(ifgr.ifgr_name)); -- ifgr.ifgr_attrib.ifg_carp_demoted = demote; -- -- if ((res = ioctl(s, SIOCSIFGATTR, (caddr_t)&ifgr)) == -1) -- log_warn("unable to %s the demote state " -- "of group '%s'", (demote > 0) ? "increment" : "decrement", -- group); -- else -- log_info("%s the demote state of group '%s'", -- (demote > 0) ? "incremented" : "decremented", group); -- -- close(s); -- return (res); ++#if defined(__FreeBSD__) /* FreeBSD does not have support for CARP */ ++ return (-1); ++#else + int s, res; + struct ifgroupreq ifgr; + +@@ -178,4 +185,5 @@ carp_demote_ioctl(char *group, int demot + + close(s); + return (res); ++#endif /* defined(__FreeBSD__) */ } |