summaryrefslogtreecommitdiff
path: root/net/openbgpd/files/patch-bgpd_carp.c
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2019-06-03 20:08:36 +0000
committerKurt Jaeger <pi@FreeBSD.org>2019-06-03 20:08:36 +0000
commit713c2289b8d66d3752c1225ca18d740daa50c8fc (patch)
tree26af7b6de4c410d2e2810fec4c81c3ab0b9c5e76 /net/openbgpd/files/patch-bgpd_carp.c
parentUpgrade to 0.0.5 (diff)
net/openbgpd: revert upgrade from 6.5p0 to 5.2.20121209
- openbgpd version 6.5p0 was the "portable" version, which specifically does *not* support kernel routing updates. - Therefore this is only suitable for route servers/collectors, not for production use in routers. This significantly violates POLA :) PR: 213445 Submitted by: Oliver H <oliver@watershed.co.uk>
Diffstat (limited to 'net/openbgpd/files/patch-bgpd_carp.c')
-rw-r--r--net/openbgpd/files/patch-bgpd_carp.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/net/openbgpd/files/patch-bgpd_carp.c b/net/openbgpd/files/patch-bgpd_carp.c
new file mode 100644
index 000000000000..7ed50075cd5c
--- /dev/null
+++ b/net/openbgpd/files/patch-bgpd_carp.c
@@ -0,0 +1,54 @@
+Index: bgpd/carp.c
+===================================================================
+RCS file: /home/cvs/private/hrs/openbgpd/bgpd/carp.c,v
+retrieving revision 1.1.1.6
+retrieving revision 1.4
+diff -u -p -r1.1.1.6 -r1.4
+--- bgpd/carp.c 14 Feb 2010 20:19:57 -0000 1.1.1.6
++++ bgpd/carp.c 22 Oct 2009 15:10:02 -0000 1.4
+@@ -93,9 +93,8 @@ carp_demote_shutdown(void)
+
+ while ((c = TAILQ_FIRST(&carpgroups)) != NULL) {
+ TAILQ_REMOVE(&carpgroups, c, entry);
+- for (; c->changed_by > 0; c->changed_by--)
+- if (c->do_demote)
+- carp_demote_ioctl(c->group, -1);
++ if (c->do_demote && c->changed_by > 0)
++ carp_demote_ioctl(c->group, -c->changed_by);
+
+ free(c->group);
+ free(c);
+@@ -105,6 +104,9 @@ carp_demote_shutdown(void)
+ int
+ carp_demote_get(char *group)
+ {
++#if defined(__FreeBSD__) /* FreeBSD does not have support for CARP */
++ return (-1);
++#else
+ int s;
+ struct ifgroupreq ifgr;
+
+@@ -127,6 +129,7 @@ carp_demote_get(char *group)
+
+ close(s);
+ return ((int)ifgr.ifgr_attrib.ifg_carp_demoted);
++#endif /* defined(__FreeBSD__) */
+ }
+
+ int
+@@ -159,6 +162,9 @@ carp_demote_set(char *group, int demote)
+ int
+ carp_demote_ioctl(char *group, int demote)
+ {
++#if defined(__FreeBSD__) /* FreeBSD does not have support for CARP */
++ return (-1);
++#else
+ int s, res;
+ struct ifgroupreq ifgr;
+
+@@ -181,4 +187,5 @@ carp_demote_ioctl(char *group, int demot
+
+ close(s);
+ return (res);
++#endif /* defined(__FreeBSD__) */
+ }