diff options
| -rw-r--r-- | bgpd/bgp_zebra.c | 1 | ||||
| -rw-r--r-- | doc/developer/building-frr-for-fedora.rst | 2 | ||||
| -rw-r--r-- | docker/debian/Dockerfile | 12 | ||||
| -rw-r--r-- | ldpd/ldpd.c | 2 | ||||
| -rw-r--r-- | lib/command.c | 13 | ||||
| -rw-r--r-- | lib/compiler.h | 17 | ||||
| -rw-r--r-- | lib/vty.c | 1 | ||||
| -rw-r--r-- | tests/lib/cxxcompat.c | 13 |
8 files changed, 49 insertions, 12 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 5e9fc57f59..c0f2dfca17 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -793,6 +793,7 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote, peer->bgp->vrf_id); } if (local->sa.sa_family == AF_INET6) { + memcpy(&nexthop->v6_global, &local->sin6.sin6_addr, IPV6_MAX_BYTELEN); if (IN6_IS_ADDR_LINKLOCAL(&local->sin6.sin6_addr)) { if (peer->conf_if || peer->ifname) ifp = if_lookup_by_name(peer->conf_if diff --git a/doc/developer/building-frr-for-fedora.rst b/doc/developer/building-frr-for-fedora.rst index d11da2d647..0208f1146b 100644 --- a/doc/developer/building-frr-for-fedora.rst +++ b/doc/developer/building-frr-for-fedora.rst @@ -14,7 +14,7 @@ Installing Dependencies sudo dnf install git autoconf automake libtool make \ readline-devel texinfo net-snmp-devel groff pkgconfig json-c-devel \ pam-devel python3-pytest bison flex c-ares-devel python3-devel \ - python3-sphinx perl-core patch + python3-sphinx perl-core patch systemd-devel .. include:: building-libyang.rst diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 4f192ec33e..fde29d4911 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -1,10 +1,14 @@ -FROM debian:stretch +FROM debian:buster MAINTAINER Rob Gil (rob@rem5.com) +ENV DEBIAN_FRONTEND noninteractive +ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn RUN apt-get update RUN apt-get install -y libpcre3-dev apt-transport-https ca-certificates curl wget logrotate \ - libc-ares2 libjson-c3 vim systemd procps -RUN curl -sLO https://ci1.netdef.org/artifact/LIBYANG-YANGRELEASE/shared/build-1/Debian-9-x86_64-Packages/libyang_0.16.46_amd64.deb && dpkg -i libyang_0.16.46_amd64.deb -RUN curl -sLO https://github.com/FRRouting/frr/releases/download/frr-6.0.2/frr_6.0.2-0.deb9u1_amd64.deb && dpkg -i frr_6.0.2-0.deb9u1_amd64.deb + libc-ares2 libjson-c3 vim systemd procps libreadline7 gnupg2 lsb-release apt-utils +RUN curl -s https://deb.frrouting.org/frr/keys.asc | apt-key add - +RUN echo deb https://deb.frrouting.org/frr $(lsb_release -s -c) frr-stable | tee -a /etc/apt/sources.list.d/frr.list +RUN apt-get update +RUN apt-get install -y frr frr-pythontools ADD daemons /etc/frr/daemons ADD docker-start /usr/sbin/docker-start ENTRYPOINT ["/usr/sbin/docker-start"] diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c index 5aaa2ec325..9fccb085dd 100644 --- a/ldpd/ldpd.c +++ b/ldpd/ldpd.c @@ -447,7 +447,7 @@ ldpd_shutdown(void) if (errno == EINTR) continue; /* No more processes were found. */ - if (errno != ECHILD) + if (errno == ECHILD) break; /* Unhandled errno condition. */ diff --git a/lib/command.c b/lib/command.c index e5e0623163..0e16f30a8a 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1053,9 +1053,16 @@ static int cmd_execute_command_real(vector vline, enum cmd_filter_type filter, if (matched_element->daemon) ret = CMD_SUCCESS_DAEMON; else { - /* Clear enqueued configuration changes. */ - vty->num_cfg_changes = 0; - memset(&vty->cfg_changes, 0, sizeof(vty->cfg_changes)); + if (vty->config) { + /* Clear array of enqueued configuration changes. */ + vty->num_cfg_changes = 0; + memset(&vty->cfg_changes, 0, sizeof(vty->cfg_changes)); + + /* Regenerate candidate configuration. */ + if (frr_get_cli_mode() == FRR_CLI_CLASSIC) + nb_config_replace(vty->candidate_config, + running_config, true); + } ret = matched_element->func(matched_element, vty, argc, argv); } diff --git a/lib/compiler.h b/lib/compiler.h index 9ce91e3361..696fb0d040 100644 --- a/lib/compiler.h +++ b/lib/compiler.h @@ -173,6 +173,11 @@ extern "C" { #endif #endif +#ifdef container_of +#undef container_of +#endif + +#if !(defined(__cplusplus) || defined(test__cplusplus)) /* this variant of container_of() retains 'const' on pointers without needing * to be told to do so. The following will all work without warning: * @@ -191,9 +196,6 @@ extern "C" { * struct cont *x = container_of(cp, const struct cont, member); * struct cont *x = container_of(p, const struct cont, member); */ -#ifdef container_of -#undef container_of -#endif #define container_of(ptr, type, member) \ (__builtin_choose_expr( \ __builtin_types_compatible_p(typeof(&((type *)0)->member), \ @@ -209,6 +211,15 @@ extern "C" { offsetof(type, member)); \ }) \ )) +#else +/* current C++ compilers don't have the builtins used above; so this version + * of the macro doesn't do the const check. */ +#define container_of(ptr, type, member) \ + ({ \ + const typeof(((type *)0)->member) *__mptr = (ptr); \ + (type *)((char *)__mptr - offsetof(type, member)); \ + }) +#endif #define container_of_null(ptr, type, member) \ ({ \ @@ -2289,6 +2289,7 @@ static void vty_read_file(struct nb_config *config, FILE *confp) vty->wfd = STDERR_FILENO; vty->type = VTY_FILE; vty->node = CONFIG_NODE; + vty->config = true; if (config) vty->candidate_config = config; else { diff --git a/tests/lib/cxxcompat.c b/tests/lib/cxxcompat.c index 48fa0ec8a9..6624de7386 100644 --- a/tests/lib/cxxcompat.c +++ b/tests/lib/cxxcompat.c @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#define test__cplusplus + #include "lib/zebra.h" #include "lib/agg_table.h" @@ -107,6 +109,17 @@ #include "lib/zassert.h" #include "lib/zclient.h" +PREDECL_RBTREE_UNIQ(footree) +struct foo { + int dummy; + struct footree_item item; +}; +static int foocmp(const struct foo *a, const struct foo *b) +{ + return memcmp(&a->dummy, &b->dummy, sizeof(a->dummy)); +} +DECLARE_RBTREE_UNIQ(footree, struct foo, item, foocmp) + int main(int argc, char **argv) { return 0; |
