summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-06-13 17:37:58 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-06-13 17:37:58 +0200
commit645bb0b10e8144a2b40201e4da6e200d5663b886 (patch)
treec527bd7bcc578e2835b1e6e156118c76ff1cb660
parentMerge pull request #687 (nexthop refactoring) (diff)
parentMerge pull request #681 (ASAN warnings) (diff)
downloadfrr-645bb0b10e8144a2b40201e4da6e200d5663b886.tar.xz
frr-645bb0b10e8144a2b40201e4da6e200d5663b886.zip
Merge branch 'stable/3.0'
Dropped: redhat/README.rpm_build.md redhat/daemons redhat/frr.init redhat/frr.logrotate redhat/frr.spec.in Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rwxr-xr-xconfigure.ac3
-rw-r--r--doc/Building_FRR_on_OpenBSD6.md46
-rw-r--r--isisd/isis_adjacency.c17
-rw-r--r--ldpd/lde.c5
-rw-r--r--ldpd/ldpe.c5
-rw-r--r--ospf6d/ospf6_intra.c9
-rw-r--r--ospfd/ospf_spf.c52
-rw-r--r--ripngd/ripngd.c3
-rw-r--r--zebra/zebra_mpls_openbsd.c32
-rw-r--r--zebra/zserv.c9
10 files changed, 111 insertions, 70 deletions
diff --git a/configure.ac b/configure.ac
index dbc281e47..65ba26d5f 100755
--- a/configure.ac
+++ b/configure.ac
@@ -917,8 +917,7 @@ dnl other functions
dnl ---------------
AC_CHECK_FUNCS([ \
strlcat strlcpy \
- getgrouplist \
- pledge])
+ getgrouplist])
AC_CHECK_HEADER([asm-generic/unistd.h],
[AC_CHECK_DECL(__NR_setns,
diff --git a/doc/Building_FRR_on_OpenBSD6.md b/doc/Building_FRR_on_OpenBSD6.md
index c1b583664..1c07b41ad 100644
--- a/doc/Building_FRR_on_OpenBSD6.md
+++ b/doc/Building_FRR_on_OpenBSD6.md
@@ -10,7 +10,7 @@ Configure PKG_PATH
Add packages:
- pkg_add git autoconf-2.69p2 automake-1.15p0 libtool
+ pkg_add git autoconf-2.69p2 automake-1.15p0 libtool bison
pkg_add gmake gawk dejagnu openssl json-c p5-XML-LibXML py-test
Select Python2.7 as default (required for pytest)
@@ -36,6 +36,8 @@ an example)
git clone https://github.com/frrouting/frr.git frr
cd frr
+ export AUTOCONF_VERSION="2.69"
+ export AUTOMAKE_VERSION="1.15"
./bootstrap.sh
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
@@ -58,29 +60,29 @@ an example)
--with-pkg-extra-version=-MyOwnFRRVersion
gmake
gmake check
- sudo gmake install
+ doas gmake install
### Create empty FRR configuration files
- sudo mkdir /var/frr
- sudo chown _frr:_frr /var/frr
- sudo chmod 755 /var/frr
- sudo mkdir /etc/frr
- sudo touch /etc/frr/zebra.conf
- sudo touch /etc/frr/bgpd.conf
- sudo touch /etc/frr/ospfd.conf
- sudo touch /etc/frr/ospf6d.conf
- sudo touch /etc/frr/isisd.conf
- sudo touch /etc/frr/ripd.conf
- sudo touch /etc/frr/ripngd.conf
- sudo touch /etc/frr/pimd.conf
- sudo touch /etc/frr/ldpd.conf
- sudo touch /etc/frr/nhrpd.conf
- sudo chown -R _frr:_frr /etc/frr
- sudo touch /etc/frr/vtysh.conf
- sudo chown -R _frr:_frrvty /etc/frr/vtysh.conf
- sudo chmod 750 /etc/frr
- sudo chmod 640 /etc/frr/*.conf
+ doas mkdir /var/frr
+ doas chown _frr:_frr /var/frr
+ doas chmod 755 /var/frr
+ doas mkdir /etc/frr
+ doas touch /etc/frr/zebra.conf
+ doas touch /etc/frr/bgpd.conf
+ doas touch /etc/frr/ospfd.conf
+ doas touch /etc/frr/ospf6d.conf
+ doas touch /etc/frr/isisd.conf
+ doas touch /etc/frr/ripd.conf
+ doas touch /etc/frr/ripngd.conf
+ doas touch /etc/frr/pimd.conf
+ doas touch /etc/frr/ldpd.conf
+ doas touch /etc/frr/nhrpd.conf
+ doas chown -R _frr:_frr /etc/frr
+ doas touch /etc/frr/vtysh.conf
+ doas chown -R _frr:_frrvty /etc/frr/vtysh.conf
+ doas chmod 750 /etc/frr
+ doas chmod 640 /etc/frr/*.conf
### Enable IP & IPv6 forwarding
@@ -96,7 +98,7 @@ Add the following lines to the end of `/etc/rc.conf`:
To enable MPLS forwarding on a given interface, use the following command:
- sudo ifconfig em0 mpls
+ doas ifconfig em0 mpls
Alternatively, to make MPLS forwarding persistent across reboots, add the "mpls"
keyword in the hostname.* files of the desired interfaces. Example:
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c
index 1869346f8..c6f70c6ca 100644
--- a/isisd/isis_adjacency.c
+++ b/isisd/isis_adjacency.c
@@ -181,6 +181,7 @@ isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state new_state
int old_state;
int level;
struct isis_circuit *circuit;
+ bool del;
old_state = adj->adj_state;
adj->adj_state = new_state;
@@ -215,6 +216,7 @@ isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state new_state
if (circuit->circ_type == CIRCUIT_T_BROADCAST)
{
+ del = false;
for (level = IS_LEVEL_1; level <= IS_LEVEL_2; level++)
{
if ((adj->level & level) == 0)
@@ -238,7 +240,7 @@ isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state new_state
list_delete_all_node (circuit->lsp_queue);
}
isis_event_adjacency_state_change (adj, new_state);
- isis_delete_adj (adj);
+ del = true;
}
if (circuit->u.bc.lan_neighs[level - 1])
@@ -252,9 +254,15 @@ isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state new_state
if (circuit->u.bc.is_dr[level - 1])
lsp_regenerate_schedule_pseudo (circuit, level);
}
+
+ if (del)
+ isis_delete_adj (adj);
+
+ adj = NULL;
}
else if (circuit->circ_type == CIRCUIT_T_P2P)
{
+ del = false;
for (level = IS_LEVEL_1; level <= IS_LEVEL_2; level++)
{
if ((adj->level & level) == 0)
@@ -287,9 +295,14 @@ isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state new_state
list_delete_all_node (circuit->lsp_queue);
}
isis_event_adjacency_state_change (adj, new_state);
- isis_delete_adj (adj);
+ del = true;
}
}
+
+ if (del)
+ isis_delete_adj (adj);
+
+ adj = NULL;
}
return;
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 8d2a9dd9d..4b1ad63d6 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -165,11 +165,6 @@ lde_init(struct ldpd_init *init)
lde_privs.group = init->group;
zprivs_init(&lde_privs);
-#ifdef HAVE_PLEDGE
- if (pledge("stdio recvfd unix", NULL) == -1)
- fatal("pledge");
-#endif
-
/* start the LIB garbage collector */
lde_gc_start_timer();
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c
index ce2441ca2..451d637bc 100644
--- a/ldpd/ldpe.c
+++ b/ldpd/ldpe.c
@@ -151,11 +151,6 @@ ldpe_init(struct ldpd_init *init)
TAILQ_INIT(&ctl_conns);
control_listen();
-#ifdef HAVE_PLEDGE
- if (pledge("stdio cpath inet mcast recvfd", NULL) == -1)
- fatal("pledge");
-#endif
-
LIST_INIT(&global.addr_list);
RB_INIT(&global.adj_tree);
TAILQ_INIT(&global.pending_conns);
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 5d415a68c..6acd45b7c 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -1620,6 +1620,7 @@ ospf6_intra_brouter_calculation (struct ospf6_area *oa)
zlog_info ("brouter %s disappears via area %s",
brouter_name, oa->name);
ospf6_route_remove (brouter, oa->ospf6->brouter_table);
+ brouter = NULL;
}
else if (CHECK_FLAG (brouter->flag, OSPF6_ROUTE_ADD) ||
CHECK_FLAG (brouter->flag, OSPF6_ROUTE_CHANGE))
@@ -1643,8 +1644,12 @@ ospf6_intra_brouter_calculation (struct ospf6_area *oa)
/* But re-originate summaries */
ospf6_abr_originate_summary (brouter);
}
- UNSET_FLAG (brouter->flag, OSPF6_ROUTE_ADD);
- UNSET_FLAG (brouter->flag, OSPF6_ROUTE_CHANGE);
+
+ if (brouter)
+ {
+ UNSET_FLAG (brouter->flag, OSPF6_ROUTE_ADD);
+ UNSET_FLAG (brouter->flag, OSPF6_ROUTE_CHANGE);
+ }
}
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_ID (oa->area_id))
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index e0fa23f35..173c4e91d 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -63,33 +63,6 @@ ospf_spf_set_reason (ospf_spf_reason_t reason)
spf_reason_flags |= 1 << reason;
}
-static void
-ospf_get_spf_reason_str (char *buf)
-{
- if (!buf)
- return;
-
- buf[0] = '\0';
- if (spf_reason_flags)
- {
- if (spf_reason_flags & SPF_FLAG_ROUTER_LSA_INSTALL)
- strcat (buf, "R, ");
- if (spf_reason_flags & SPF_FLAG_NETWORK_LSA_INSTALL)
- strcat (buf, "N, ");
- if (spf_reason_flags & SPF_FLAG_SUMMARY_LSA_INSTALL)
- strcat (buf, "S, ");
- if (spf_reason_flags & SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL)
- strcat (buf, "AS, ");
- if (spf_reason_flags & SPF_FLAG_ABR_STATUS_CHANGE)
- strcat (buf, "ABR, ");
- if (spf_reason_flags & SPF_FLAG_ASBR_STATUS_CHANGE)
- strcat (buf, "ASBR, ");
- if (spf_reason_flags & SPF_FLAG_MAXAGE)
- strcat (buf, "M, ");
- buf[strlen(buf)-2] = '\0'; /* skip the last ", " */
- }
-}
-
static void ospf_vertex_free (void *);
/* List of allocated vertices, to simplify cleanup of SPF.
* Not thread-safe obviously. If it ever needs to be, it'd have to be
@@ -1384,7 +1357,30 @@ ospf_spf_calculate_timer (struct thread *thread)
total_spf_time = monotime_since(&spf_start_time, &ospf->ts_spf_duration);
- ospf_get_spf_reason_str (rbuf);
+ rbuf[0] = '\0';
+ if (spf_reason_flags)
+ {
+ if (spf_reason_flags & SPF_FLAG_ROUTER_LSA_INSTALL)
+ strncat (rbuf, "R, ", sizeof(rbuf) - strlen(rbuf) - 1);
+ if (spf_reason_flags & SPF_FLAG_NETWORK_LSA_INSTALL)
+ strncat (rbuf, "N, ", sizeof(rbuf) - strlen(rbuf) - 1);
+ if (spf_reason_flags & SPF_FLAG_SUMMARY_LSA_INSTALL)
+ strncat (rbuf, "S, ", sizeof(rbuf) - strlen(rbuf) - 1);
+ if (spf_reason_flags & SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL)
+ strncat (rbuf, "AS, ", sizeof(rbuf) - strlen(rbuf) - 1);
+ if (spf_reason_flags & SPF_FLAG_ABR_STATUS_CHANGE)
+ strncat (rbuf, "ABR, ", sizeof(rbuf) - strlen(rbuf) - 1);
+ if (spf_reason_flags & SPF_FLAG_ASBR_STATUS_CHANGE)
+ strncat (rbuf, "ASBR, ", sizeof(rbuf) - strlen(rbuf) - 1);
+ if (spf_reason_flags & SPF_FLAG_MAXAGE)
+ strncat (rbuf, "M, ", sizeof(rbuf) - strlen(rbuf) - 1);
+
+ size_t rbuflen = strlen(rbuf);
+ if (rbuflen >= 2)
+ rbuf[rbuflen - 2] = '\0'; /* skip the last ", " */
+ else
+ rbuf[0] = '\0';
+ }
if (IS_DEBUG_OSPF_EVENT)
{
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index f373598be..11d1ed01f 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2969,6 +2969,9 @@ ripng_clean()
XFREE (MTYPE_ROUTE_TABLE, ripng->route);
XFREE (MTYPE_ROUTE_TABLE, ripng->aggregate);
+ stream_free (ripng->ibuf);
+ stream_free (ripng->obuf);
+
XFREE (MTYPE_RIPNG, ripng);
ripng = NULL;
} /* if (ripng) */
diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c
index bca73898c..45e4435ee 100644
--- a/zebra/zebra_mpls_openbsd.c
+++ b/zebra/zebra_mpls_openbsd.c
@@ -238,7 +238,7 @@ kernel_lsp_cmd (int action, zebra_lsp_t *lsp)
{
zebra_nhlfe_t *nhlfe;
struct nexthop *nexthop = NULL;
- int nexthop_num = 0;
+ unsigned int nexthop_num = 0;
for (nhlfe = lsp->nhlfe_list; nhlfe; nhlfe = nhlfe->next)
{
@@ -288,28 +288,52 @@ kernel_lsp_cmd (int action, zebra_lsp_t *lsp)
int
kernel_add_lsp (zebra_lsp_t *lsp)
{
+ int ret;
+
if (!lsp || !lsp->best_nhlfe) // unexpected
return -1;
- return kernel_lsp_cmd (RTM_ADD, lsp);
+ UNSET_FLAG (lsp->flags, LSP_FLAG_CHANGED);
+ ret = kernel_lsp_cmd (RTM_ADD, lsp);
+ if (!ret)
+ SET_FLAG (lsp->flags, LSP_FLAG_INSTALLED);
+
+ return ret;
}
int
kernel_upd_lsp (zebra_lsp_t *lsp)
{
+ int ret;
+
if (!lsp || !lsp->best_nhlfe) // unexpected
return -1;
- return kernel_lsp_cmd (RTM_CHANGE, lsp);
+ UNSET_FLAG (lsp->flags, LSP_FLAG_CHANGED);
+ UNSET_FLAG (lsp->flags, LSP_FLAG_INSTALLED);
+ ret = kernel_lsp_cmd (RTM_CHANGE, lsp);
+ if (!ret)
+ SET_FLAG (lsp->flags, LSP_FLAG_INSTALLED);
+
+ return ret;
}
int
kernel_del_lsp (zebra_lsp_t *lsp)
{
+ int ret;
+
if (!lsp) // unexpected
return -1;
- return kernel_lsp_cmd (RTM_DELETE, lsp);
+ if (! CHECK_FLAG (lsp->flags, LSP_FLAG_INSTALLED))
+ return -1;
+
+ ret = kernel_lsp_cmd (RTM_DELETE, lsp);
+ if (!ret)
+ UNSET_FLAG (lsp->flags, LSP_FLAG_INSTALLED);
+
+ return ret;
}
#define MAX_RTSOCK_BUF 128 * 1024
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 9d05a3b9d..ba42c67be 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -2153,6 +2153,15 @@ zebra_client_close (struct zserv *client)
if (client->t_suicide)
thread_cancel (client->t_suicide);
+ /* Free bitmaps. */
+ for (afi_t afi = AFI_IP; afi < AFI_MAX; afi++)
+ for (int i = 0; i < ZEBRA_ROUTE_MAX; i++)
+ vrf_bitmap_free (client->redist[afi][i]);
+
+ vrf_bitmap_free (client->redist_default);
+ vrf_bitmap_free (client->ifinfo);
+ vrf_bitmap_free (client->ridinfo);
+
/* Free client structure. */
listnode_delete (zebrad.client_list, client);
XFREE (MTYPE_TMP, client);