mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 05:42:21 +00:00
Merge pull request #12234 from opensourcerouting/fix/bgp_regex_pcre
docker: Use PCRE2 for Alpine
This commit is contained in:
commit
edb904e81c
@ -15,8 +15,8 @@ makedepends="ncurses-dev net-snmp-dev gawk texinfo perl
|
|||||||
libcap-dev libcurl libedit libffi libgcc libgomp libisoburn libisofs
|
libcap-dev libcurl libedit libffi libgcc libgomp libisoburn libisofs
|
||||||
libltdl libressl libssh2 libstdc++ libtool libuuid
|
libltdl libressl libssh2 libstdc++ libtool libuuid
|
||||||
linux-headers lzip lzo m4 make mkinitfs mpc1 mpfr4 mtools musl-dev
|
linux-headers lzip lzo m4 make mkinitfs mpc1 mpfr4 mtools musl-dev
|
||||||
ncurses-libs ncurses-terminfo ncurses-terminfo-base patch pax-utils pcre
|
ncurses-libs ncurses-terminfo ncurses-terminfo-base patch pax-utils pcre2
|
||||||
perl pkgconf python3 python3-dev readline readline-dev sqlite-libs
|
perl pkgconf python3 python3-dev readline readline-dev sqlite-libs pcre2-dev
|
||||||
squashfs-tools sudo tar texinfo xorriso xz-libs py-pip rtrlib rtrlib-dev
|
squashfs-tools sudo tar texinfo xorriso xz-libs py-pip rtrlib rtrlib-dev
|
||||||
py3-sphinx elfutils elfutils-dev libyang-dev"
|
py3-sphinx elfutils elfutils-dev libyang-dev"
|
||||||
checkdepends="pytest py-setuptools"
|
checkdepends="pytest py-setuptools"
|
||||||
@ -46,8 +46,9 @@ build() {
|
|||||||
--enable-multipath=64 \
|
--enable-multipath=64 \
|
||||||
--enable-vty-group=frrvty \
|
--enable-vty-group=frrvty \
|
||||||
--enable-user=$_user \
|
--enable-user=$_user \
|
||||||
--enable-group=$_user
|
--enable-group=$_user \
|
||||||
make
|
--enable-pcre2posix
|
||||||
|
make -j $(nproc)
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
|
@ -18,19 +18,24 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _QUAGGA_BGP_REGEX_H
|
#ifndef _FRR_BGP_REGEX_H
|
||||||
#define _QUAGGA_BGP_REGEX_H
|
#define _FRR_BGP_REGEX_H
|
||||||
|
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCREPOSIX
|
#ifdef HAVE_LIBPCRE2_POSIX
|
||||||
|
#ifndef _FRR_PCRE2_POSIX
|
||||||
|
#define _FRR_PCRE2_POSIX
|
||||||
|
#include <pcre2posix.h>
|
||||||
|
#endif /* _FRR_PCRE2_POSIX */
|
||||||
|
#elif defined(HAVE_LIBPCREPOSIX)
|
||||||
#include <pcreposix.h>
|
#include <pcreposix.h>
|
||||||
#else
|
#else
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#endif /* HAVE_LIBPCREPOSIX */
|
#endif /* HAVE_LIBPCRE2_POSIX */
|
||||||
|
|
||||||
extern void bgp_regex_free(regex_t *regex);
|
extern void bgp_regex_free(regex_t *regex);
|
||||||
extern regex_t *bgp_regcomp(const char *str);
|
extern regex_t *bgp_regcomp(const char *str);
|
||||||
extern int bgp_regexec(regex_t *regex, struct aspath *aspath);
|
extern int bgp_regexec(regex_t *regex, struct aspath *aspath);
|
||||||
|
|
||||||
#endif /* _QUAGGA_BGP_REGEX_H */
|
#endif /* _FRR_BGP_REGEX_H */
|
||||||
|
@ -30,11 +30,16 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "frrlua.h"
|
#include "frrlua.h"
|
||||||
#include "frrscript.h"
|
#include "frrscript.h"
|
||||||
#ifdef HAVE_LIBPCREPOSIX
|
#ifdef HAVE_LIBPCRE2_POSIX
|
||||||
|
#ifndef _FRR_PCRE2_POSIX
|
||||||
|
#define _FRR_PCRE2_POSIX
|
||||||
|
#include <pcre2posix.h>
|
||||||
|
#endif /* _FRR_PCRE2_POSIX */
|
||||||
|
#elif defined(HAVE_LIBPCREPOSIX)
|
||||||
#include <pcreposix.h>
|
#include <pcreposix.h>
|
||||||
#else
|
#else
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#endif /* HAVE_LIBPCREPOSIX */
|
#endif /* HAVE_LIBPCRE2_POSIX */
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "sockunion.h"
|
#include "sockunion.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
12
configure.ac
12
configure.ac
@ -712,6 +712,8 @@ AC_ARG_ENABLE([cpu-time],
|
|||||||
AS_HELP_STRING([--disable-cpu-time], [disable cpu usage data gathering]))
|
AS_HELP_STRING([--disable-cpu-time], [disable cpu usage data gathering]))
|
||||||
AC_ARG_ENABLE([pcreposix],
|
AC_ARG_ENABLE([pcreposix],
|
||||||
AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
|
AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
|
||||||
|
AC_ARG_ENABLE([pcre2posix],
|
||||||
|
AS_HELP_STRING([--enable-pcre2posix], [enable using PCRE2 Posix libs for regex functions]))
|
||||||
AC_ARG_ENABLE([fpm],
|
AC_ARG_ENABLE([fpm],
|
||||||
AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
|
AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
|
||||||
AC_ARG_ENABLE([werror],
|
AC_ARG_ENABLE([werror],
|
||||||
@ -1659,6 +1661,16 @@ if test "$enable_pcreposix" = "yes"; then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST([HAVE_LIBPCREPOSIX])
|
AC_SUBST([HAVE_LIBPCREPOSIX])
|
||||||
|
|
||||||
|
dnl ---------------------------
|
||||||
|
dnl check system has PCRE2 regexp
|
||||||
|
dnl ---------------------------
|
||||||
|
if test "$enable_pcre2posix" = "yes"; then
|
||||||
|
AC_CHECK_LIB([pcre2-posix], [regexec], [], [
|
||||||
|
AC_MSG_ERROR([--enable-pcre2posix given but unable to find libpcre2-posix])
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
AC_SUBST([HAVE_LIBPCRE2_POSIX])
|
||||||
|
|
||||||
dnl ##########################################################################
|
dnl ##########################################################################
|
||||||
dnl test "$enable_clippy_only" != "yes"
|
dnl test "$enable_clippy_only" != "yes"
|
||||||
fi
|
fi
|
||||||
|
@ -368,6 +368,13 @@ options from the list below.
|
|||||||
|
|
||||||
Turn on the usage of PCRE Posix libs for regex functionality.
|
Turn on the usage of PCRE Posix libs for regex functionality.
|
||||||
|
|
||||||
|
.. option:: --enable-pcre2posix
|
||||||
|
|
||||||
|
Turn on the usage of PCRE2 Posix libs for regex functionality.
|
||||||
|
|
||||||
|
PCRE2 versions <= 10.31 work a bit differently. We suggest using at least
|
||||||
|
>= 10.36.
|
||||||
|
|
||||||
.. option:: --enable-rpath
|
.. option:: --enable-rpath
|
||||||
|
|
||||||
Set hardcoded rpaths in the executable [default=yes].
|
Set hardcoded rpaths in the executable [default=yes].
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
# Create a basic stage set up to build APKs
|
# Create a basic stage set up to build APKs
|
||||||
FROM alpine:3.15 as alpine-builder
|
FROM alpine:3.16 as alpine-builder
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
--update-cache \
|
--update-cache \
|
||||||
abuild \
|
abuild \
|
||||||
@ -13,7 +13,7 @@ RUN apk add \
|
|||||||
RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n'
|
RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n'
|
||||||
|
|
||||||
# This stage builds a dist tarball from the source
|
# This stage builds a dist tarball from the source
|
||||||
FROM alpine:3.15 as source-builder
|
FROM alpine:3.16 as source-builder
|
||||||
|
|
||||||
RUN mkdir -p /src/alpine
|
RUN mkdir -p /src/alpine
|
||||||
COPY alpine/APKBUILD.in /src/alpine
|
COPY alpine/APKBUILD.in /src/alpine
|
||||||
@ -48,7 +48,7 @@ RUN cd /dist \
|
|||||||
&& abuild -r -P /pkgs/apk
|
&& abuild -r -P /pkgs/apk
|
||||||
|
|
||||||
# This stage installs frr from the apk
|
# This stage installs frr from the apk
|
||||||
FROM alpine:3.15
|
FROM alpine:3.16
|
||||||
RUN mkdir -p /pkgs/apk
|
RUN mkdir -p /pkgs/apk
|
||||||
COPY --from=alpine-apk-builder /pkgs/apk/ /pkgs/apk/
|
COPY --from=alpine-apk-builder /pkgs/apk/ /pkgs/apk/
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
|
@ -23,11 +23,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_LIBPCREPOSIX
|
#ifdef HAVE_LIBPCRE2_POSIX
|
||||||
|
#ifndef _FRR_PCRE2_POSIX
|
||||||
|
#define _FRR_PCRE2_POSIX
|
||||||
|
#include <pcre2posix.h>
|
||||||
|
#endif /* _FRR_PCRE2_POSIX */
|
||||||
|
#elif defined(HAVE_LIBPCREPOSIX)
|
||||||
#include <pcreposix.h>
|
#include <pcreposix.h>
|
||||||
#else
|
#else
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#endif /* HAVE_LIBPCREPOSIX */
|
#endif /* HAVE_LIBPCRE2_POSIX */
|
||||||
|
|
||||||
#include "frrstr.h"
|
#include "frrstr.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
@ -23,11 +23,16 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_LIBPCREPOSIX
|
#ifdef HAVE_LIBPCRE2_POSIX
|
||||||
|
#ifndef _FRR_PCRE2_POSIX
|
||||||
|
#define _FRR_PCRE2_POSIX
|
||||||
|
#include <pcre2posix.h>
|
||||||
|
#endif /* _FRR_PCRE2_POSIX */
|
||||||
|
#elif defined(HAVE_LIBPCREPOSIX)
|
||||||
#include <pcreposix.h>
|
#include <pcreposix.h>
|
||||||
#else
|
#else
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#endif /* HAVE_LIBPCREPOSIX */
|
#endif /* HAVE_LIBPCRE2_POSIX */
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
|
@ -24,11 +24,16 @@
|
|||||||
#include <lib/version.h>
|
#include <lib/version.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_LIBPCREPOSIX
|
#ifdef HAVE_LIBPCRE2_POSIX
|
||||||
|
#ifndef _FRR_PCRE2_POSIX
|
||||||
|
#define _FRR_PCRE2_POSIX
|
||||||
|
#include <pcre2posix.h>
|
||||||
|
#endif /* _FRR_PCRE2_POSIX */
|
||||||
|
#elif defined(HAVE_LIBPCREPOSIX)
|
||||||
#include <pcreposix.h>
|
#include <pcreposix.h>
|
||||||
#else
|
#else
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#endif /* HAVE_LIBPCREPOSIX */
|
#endif /* HAVE_LIBPCRE2_POSIX */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "linklist.h"
|
#include "linklist.h"
|
||||||
|
@ -22,11 +22,16 @@
|
|||||||
#define _ZEBRA_VTY_H
|
#define _ZEBRA_VTY_H
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_LIBPCREPOSIX
|
#ifdef HAVE_LIBPCRE2_POSIX
|
||||||
|
#ifndef _FRR_PCRE2_POSIX
|
||||||
|
#define _FRR_PCRE2_POSIX
|
||||||
|
#include <pcre2posix.h>
|
||||||
|
#endif /* _FRR_PCRE2_POSIX */
|
||||||
|
#elif defined(HAVE_LIBPCREPOSIX)
|
||||||
#include <pcreposix.h>
|
#include <pcreposix.h>
|
||||||
#else
|
#else
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#endif /* HAVE_LIBPCREPOSIX */
|
#endif /* HAVE_LIBPCRE2_POSIX */
|
||||||
|
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user