mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 15:24:43 +00:00
Merge pull request #2965 from opensourcerouting/buildfoo-20180904
more build fixes & warning-free build
This commit is contained in:
commit
5381b930b3
10
Makefile.am
10
Makefile.am
@ -4,12 +4,16 @@ AUTOMAKE_OPTIONS = subdir-objects 1.12
|
|||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
AM_CFLAGS = \
|
AM_CFLAGS = \
|
||||||
@ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ \
|
$(SAN_FLAGS) \
|
||||||
$(WERROR)
|
$(WERROR) \
|
||||||
|
# end
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
@ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ \
|
|
||||||
-I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \
|
-I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \
|
||||||
-I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/lib
|
-I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/lib
|
||||||
|
AM_LDFLAGS = \
|
||||||
|
-export-dynamic \
|
||||||
|
$(SAN_FLAGS) \
|
||||||
|
# end
|
||||||
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE)
|
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE)
|
||||||
LIBCAP = @LIBCAP@
|
LIBCAP = @LIBCAP@
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "babel_filter.h"
|
#include "babel_filter.h"
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
|
@ -21,6 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -20,6 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -21,6 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -289,7 +289,7 @@ static int _ptm_msg_read(struct stream *msg, int command,
|
|||||||
{
|
{
|
||||||
uint32_t pid;
|
uint32_t pid;
|
||||||
uint8_t ttl __attribute__((unused));
|
uint8_t ttl __attribute__((unused));
|
||||||
uint8_t ifnamelen;
|
size_t ifnamelen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register/Deregister/Update Message format:
|
* Register/Deregister/Update Message format:
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "math.h"
|
|
||||||
|
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
#include "lib_errors.h"
|
#include "lib_errors.h"
|
||||||
|
|
||||||
|
@ -18,9 +18,6 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "lib/zebra.h"
|
#include "lib/zebra.h"
|
||||||
#include "lib/prefix.h"
|
#include "lib/prefix.h"
|
||||||
#include "lib/agg_table.h"
|
#include "lib/agg_table.h"
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "lib/zebra.h"
|
#include "lib/zebra.h"
|
||||||
#include "lib/prefix.h"
|
#include "lib/prefix.h"
|
||||||
#include "lib/agg_table.h"
|
#include "lib/agg_table.h"
|
||||||
|
@ -18,9 +18,6 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "lib/zebra.h"
|
#include "lib/zebra.h"
|
||||||
#include "lib/prefix.h"
|
#include "lib/prefix.h"
|
||||||
#include "lib/table.h"
|
#include "lib/table.h"
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
* Purpose: Handle import of routes from BGP to RFAPI
|
* Purpose: Handle import of routes from BGP to RFAPI
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "lib/zebra.h"
|
#include "lib/zebra.h"
|
||||||
#include "lib/prefix.h"
|
#include "lib/prefix.h"
|
||||||
#include "lib/agg_table.h"
|
#include "lib/agg_table.h"
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
|
|
||||||
/* TBD remove unneeded includes */
|
/* TBD remove unneeded includes */
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "lib/zebra.h"
|
#include "lib/zebra.h"
|
||||||
#include "lib/prefix.h"
|
#include "lib/prefix.h"
|
||||||
#include "lib/agg_table.h"
|
#include "lib/agg_table.h"
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
* Purpose: maintain per-nve ribs and generate change lists
|
* Purpose: maintain per-nve ribs and generate change lists
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "lib/zebra.h"
|
#include "lib/zebra.h"
|
||||||
#include "lib/prefix.h"
|
#include "lib/prefix.h"
|
||||||
#include "lib/agg_table.h"
|
#include "lib/agg_table.h"
|
||||||
|
@ -18,9 +18,6 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "lib/zebra.h"
|
#include "lib/zebra.h"
|
||||||
#include "lib/prefix.h"
|
#include "lib/prefix.h"
|
||||||
#include "lib/agg_table.h"
|
#include "lib/agg_table.h"
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* stub rfp */
|
/* stub rfp */
|
||||||
#include "rfp_internal.h"
|
#include "rfp_internal.h"
|
||||||
#include "bgpd/rfapi/rfapi.h"
|
#include "bgpd/rfapi/rfapi.h"
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* dummy test program */
|
/* dummy test program */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
149
configure.ac
149
configure.ac
@ -189,46 +189,6 @@ CC="${CC% -std=c99}"
|
|||||||
|
|
||||||
AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
|
AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
|
||||||
|
|
||||||
dnl AddressSanitizer support
|
|
||||||
AC_ARG_ENABLE([address-sanitizer], AS_HELP_STRING([--enable-address-sanitizer], \
|
|
||||||
[enabled AddressSanitizer support for detecting a wide variety of \
|
|
||||||
memory allocation and deallocation errors]), \
|
|
||||||
[AC_DEFINE(HAVE_ADDRESS_SANITIZER, 1, [enable AddressSanitizer])
|
|
||||||
ASAN_FLAGS="-fsanitize=address"
|
|
||||||
SAN_CLIPPY_FLAGS="-fno-sanitize=all"
|
|
||||||
AC_SUBST([ASAN_FLAGS])
|
|
||||||
AC_SUBST([SAN_CLIPPY_FLAGS])
|
|
||||||
LIBS="-ldl $LIBS"
|
|
||||||
AC_TRY_COMPILE([],[const int i=0;],[AC_MSG_NOTICE([Address Sanitizer Enabled])],
|
|
||||||
[AC_MSG_ERROR([Address Sanitizer not available])])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl ThreadSanitizer support
|
|
||||||
AC_ARG_ENABLE([thread-sanitizer], AS_HELP_STRING([--enable-thread-sanitizer], \
|
|
||||||
[enabled ThreadSanitizer support for detecting data races]), \
|
|
||||||
[AC_DEFINE(HAVE_THREAD_SANITIZER, 1, [enable ThreadSanitizer])
|
|
||||||
TSAN_FLAGS="-fsanitize=thread"
|
|
||||||
SAN_CLIPPY_FLAGS="-fno-sanitize=all"
|
|
||||||
AC_SUBST([TSAN_FLAGS])
|
|
||||||
AC_SUBST([SAN_CLIPPY_FLAGS])
|
|
||||||
LIBS="-ldl $LIBS"
|
|
||||||
AC_TRY_COMPILE([],[const int i=0;],[AC_MSG_NOTICE([Thread Sanitizer Enabled])],
|
|
||||||
[AC_MSG_ERROR([Thread Sanitizer not available])])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl MemorySanitizer support
|
|
||||||
AC_ARG_ENABLE([memory-sanitizer], AS_HELP_STRING([--enable-memory-sanitizer], \
|
|
||||||
[enabled MemorySanitizer support for detecting uninitialized memory reads]), \
|
|
||||||
[AC_DEFINE(HAVE_THREAD_SANITIZER, 1, [enable MemorySanitizer])
|
|
||||||
MSAN_FLAGS="-fsanitize=memory -fPIE -pie"
|
|
||||||
SAN_CLIPPY_FLAGS="-fno-sanitize=all"
|
|
||||||
AC_SUBST([MSAN_FLAGS])
|
|
||||||
AC_SUBST([SAN_CLIPPY_FLAGS])
|
|
||||||
LIBS="-ldl $LIBS"
|
|
||||||
AC_TRY_COMPILE([],[const int i=0;],[AC_MSG_NOTICE([Memory Sanitizer Enabled])],
|
|
||||||
[AC_MSG_ERROR([Memory Sanitizer not available])])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl if the user has specified any CFLAGS, override our settings
|
dnl if the user has specified any CFLAGS, override our settings
|
||||||
if test "x${enable_gcov}" = "xyes"; then
|
if test "x${enable_gcov}" = "xyes"; then
|
||||||
if test "z$orig_cflags" = "z"; then
|
if test "z$orig_cflags" = "z"; then
|
||||||
@ -287,19 +247,29 @@ if test x"${enable_werror}" = x"yes" ; then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(WERROR)
|
AC_SUBST(WERROR)
|
||||||
|
|
||||||
dnl need link on this one, not compile
|
SAN_FLAGS=""
|
||||||
AC_LANG_PUSH(C)
|
if test "$enable_address_sanitizer" = "yes"; then
|
||||||
ac_ld_flag_save="$LDFLAGS"
|
AC_C_FLAG([-fsanitize=address], [
|
||||||
LDFLAGS="$LDFLAGS -rdynamic"
|
AC_MSG_ERROR([$CC does not support Address Sanitizer.])
|
||||||
AC_MSG_CHECKING([[whether linker supports -rdynamic]])
|
], [
|
||||||
AC_LINK_IFELSE(
|
SAN_FLAGS="$SAN_FLAGS -fsanitize=address"
|
||||||
[AC_LANG_PROGRAM([[]])],
|
|
||||||
[AC_MSG_RESULT([yes])],
|
|
||||||
[
|
|
||||||
LDFLAGS="$ac_ld_flag_save"
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
])
|
])
|
||||||
AC_LANG_POP(C)
|
fi
|
||||||
|
if test "$enable_thread_sanitizer" = "yes"; then
|
||||||
|
AC_C_FLAG([-fsanitize=thread], [
|
||||||
|
AC_MSG_ERROR([$CC does not support Thread Sanitizer.])
|
||||||
|
], [
|
||||||
|
SAN_FLAGS="$SAN_FLAGS -fsanitize=thread"
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
if test "$enable_memory_sanitizer" = "yes"; then
|
||||||
|
AC_C_FLAG([-fsanitize=thread -fPIE -pie], [
|
||||||
|
AC_MSG_ERROR([$CC does not support Thread Sanitizer.])
|
||||||
|
], [
|
||||||
|
SAN_FLAGS="-fsanitize=memory -fPIE -pie"
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
AC_SUBST([SAN_FLAGS])
|
||||||
|
|
||||||
dnl ----------
|
dnl ----------
|
||||||
dnl Essentials
|
dnl Essentials
|
||||||
@ -328,11 +298,6 @@ AC_PROG_LN_S
|
|||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
AC_CHECK_TOOL(AR, ar)
|
AC_CHECK_TOOL(AR, ar)
|
||||||
|
|
||||||
dnl -----------------
|
|
||||||
dnl System extensions
|
|
||||||
dnl -----------------
|
|
||||||
AC_GNU_SOURCE
|
|
||||||
|
|
||||||
dnl -------
|
dnl -------
|
||||||
dnl libtool
|
dnl libtool
|
||||||
dnl -------
|
dnl -------
|
||||||
@ -467,6 +432,12 @@ AC_ARG_ENABLE([gcov],
|
|||||||
AS_HELP_STRING([--enable-gcov], [Add code coverage information]))
|
AS_HELP_STRING([--enable-gcov], [Add code coverage information]))
|
||||||
AC_ARG_ENABLE(bfdd,
|
AC_ARG_ENABLE(bfdd,
|
||||||
AS_HELP_STRING([--disable-bfdd], [do not build bfdd]))
|
AS_HELP_STRING([--disable-bfdd], [do not build bfdd]))
|
||||||
|
AC_ARG_ENABLE([address-sanitizer],
|
||||||
|
AS_HELP_STRING([--enable-address-sanitizer], [enable AddressSanitizer support for detecting a wide variety of memory allocation and deallocation errors]))
|
||||||
|
AC_ARG_ENABLE([thread-sanitizer],
|
||||||
|
AS_HELP_STRING([--enable-thread-sanitizer], [enable ThreadSanitizer support for detecting data races]))
|
||||||
|
AC_ARG_ENABLE([memory-sanitizer],
|
||||||
|
AS_HELP_STRING([--enable-memory-sanitizer], [enable MemorySanitizer support for detecting uninitialized memory reads]))
|
||||||
|
|
||||||
AS_IF([test "${enable_clippy_only}" != "yes"], [
|
AS_IF([test "${enable_clippy_only}" != "yes"], [
|
||||||
AC_CHECK_HEADERS(json-c/json.h)
|
AC_CHECK_HEADERS(json-c/json.h)
|
||||||
@ -630,27 +601,26 @@ AC_SUBST(PYTHON_LIBS)
|
|||||||
# Logic for protobuf support.
|
# Logic for protobuf support.
|
||||||
#
|
#
|
||||||
if test "$enable_protobuf" = "yes"; then
|
if test "$enable_protobuf" = "yes"; then
|
||||||
have_protobuf=yes
|
# Check for protoc & protoc-c
|
||||||
|
|
||||||
# Check for protoc-c
|
# protoc is not required, it's only for a "be nice" helper target
|
||||||
AC_CHECK_PROG([PROTOC_C], [protoc-c], [protoc-c], [/bin/false])
|
AC_CHECK_PROGS([PROTOC], [protoc], [/bin/false])
|
||||||
if test "x$PROTOC_C" = "x/bin/false"; then
|
|
||||||
have_protobuf=no
|
|
||||||
else
|
|
||||||
found_protobuf_c=no
|
|
||||||
PKG_CHECK_MODULES([PROTOBUF_C], libprotobuf-c >= 0.14,
|
|
||||||
[found_protobuf_c=yes],
|
|
||||||
[AC_MSG_RESULT([pkg-config did not find libprotobuf-c])])
|
|
||||||
|
|
||||||
if test "x$found_protobuf_c" = "xyes"; then
|
AC_CHECK_PROGS([PROTOC_C], [protoc-c], [/bin/false])
|
||||||
LDFLAGS="$LDFLAGS $PROTOBUF_C_LIBS"
|
if test "$PROTOC_C" = "/bin/false"; then
|
||||||
CFLAGS="$CFLAGS $PROTOBUF_C_CFLAGS"
|
AC_MSG_FAILURE([protobuf requested but protoc-c not found. Install protobuf-c.])
|
||||||
else
|
|
||||||
AC_CHECK_HEADER([google/protobuf-c/protobuf-c.h], [],
|
|
||||||
[have_protobuf=no; AC_MSG_RESULT([Couldn't find google/protobuf-c.h])])
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c >= 0.14],, [
|
||||||
|
AC_MSG_FAILURE([protobuf requested but libprotobuf-c not found. Install protobuf-c.])
|
||||||
|
])
|
||||||
|
AC_CHECK_HEADER([google/protobuf-c/protobuf-c.h], [], [
|
||||||
|
AC_MSG_FAILURE([protobuf requested but protobuf-c.h not found. Install protobuf-c.])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFINE(HAVE_PROTOBUF,, protobuf)
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL([HAVE_PROTOBUF], [test "x$enable_protobuf" = "xyes"])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Logic for old vpn commans support.
|
# Logic for old vpn commans support.
|
||||||
@ -659,18 +629,6 @@ if test "$enable_oldvpn_commands" = "yes"; then
|
|||||||
AC_DEFINE(KEEP_OLD_VPN_COMMANDS,, [Define for compiling with old vpn commands])
|
AC_DEFINE(KEEP_OLD_VPN_COMMANDS,, [Define for compiling with old vpn commands])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fail if the user explicity enabled protobuf support and we couldn't
|
|
||||||
# find the compiler or libraries.
|
|
||||||
if test "x$have_protobuf" = "xno" && test "x$enable_protobuf" = "xyes"; then
|
|
||||||
AC_MSG_ERROR([Protobuf enabled explicitly but can't find libraries/tools])
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$have_protobuf" = "xyes"; then
|
|
||||||
AC_DEFINE(HAVE_PROTOBUF,, protobuf)
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_PROTOBUF], [test "x$have_protobuf" = "xyes"])
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# End of logic for protobuf support.
|
# End of logic for protobuf support.
|
||||||
#
|
#
|
||||||
@ -857,10 +815,15 @@ int main(int argc, char **argv) {
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([pthread_np.h],,, [
|
||||||
|
#include <pthread.h>
|
||||||
|
])
|
||||||
|
AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
|
||||||
|
|
||||||
dnl Utility macro to avoid retyping includes all the time
|
dnl Utility macro to avoid retyping includes all the time
|
||||||
m4_define([FRR_INCLUDES],
|
m4_define([FRR_INCLUDES],
|
||||||
[#ifdef SUNOS_5
|
[#ifdef SUNOS_5
|
||||||
#define _XPG4_2
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#define __EXTENSIONS__
|
#define __EXTENSIONS__
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -953,6 +916,7 @@ case "$host_os" in
|
|||||||
|
|
||||||
AC_DEFINE(SUNOS_5, 1, [SunOS 5])
|
AC_DEFINE(SUNOS_5, 1, [SunOS 5])
|
||||||
AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
|
AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
|
||||||
|
AC_DEFINE(_POSIX_C_SOURCE, 200809L, [enable POSIX.1-2008 and XPG7/SUSv4])
|
||||||
|
|
||||||
AC_CHECK_LIB(socket, main)
|
AC_CHECK_LIB(socket, main)
|
||||||
AC_CHECK_LIB(nsl, main)
|
AC_CHECK_LIB(nsl, main)
|
||||||
@ -1825,13 +1789,16 @@ dnl order to check no alternative allocator
|
|||||||
dnl has been specified, which might not provide
|
dnl has been specified, which might not provide
|
||||||
dnl mallinfo, e.g. such as Umem on Solaris.
|
dnl mallinfo, e.g. such as Umem on Solaris.
|
||||||
dnl -----------------------------------------
|
dnl -----------------------------------------
|
||||||
AC_CHECK_HEADERS([malloc.h malloc/malloc.h],,, [FRR_INCLUDES])
|
AC_CHECK_HEADERS([malloc.h malloc_np.h malloc/malloc.h],,, [FRR_INCLUDES])
|
||||||
|
|
||||||
AC_CACHE_CHECK([whether mallinfo is available], [frr_cv_mallinfo], [
|
AC_CACHE_CHECK([whether mallinfo is available], [frr_cv_mallinfo], [
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([FRR_INCLUDES [
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([FRR_INCLUDES [
|
||||||
#ifdef HAVE_MALLOC_H
|
#ifdef HAVE_MALLOC_H
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_MALLOC_NP_H
|
||||||
|
#include <malloc_np.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_MALLOC_MALLOC_H
|
#ifdef HAVE_MALLOC_MALLOC_H
|
||||||
#include <malloc/malloc.h>
|
#include <malloc/malloc.h>
|
||||||
#endif
|
#endif
|
||||||
@ -2059,9 +2026,9 @@ FRR version : ${PACKAGE_VERSION}
|
|||||||
host operating system : ${host_os}
|
host operating system : ${host_os}
|
||||||
source code location : ${srcdir}
|
source code location : ${srcdir}
|
||||||
compiler : ${CC}
|
compiler : ${CC}
|
||||||
compiler flags : ${CFLAGS}
|
compiler flags : ${CFLAGS} ${SAN_FLAGS}
|
||||||
make : ${MAKE-make}
|
make : ${MAKE-make}
|
||||||
linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
|
linker flags : ${LDFLAGS} ${SAN_FLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
|
||||||
state file directory : ${frr_statedir}
|
state file directory : ${frr_statedir}
|
||||||
config file directory : `eval echo \`echo ${sysconfdir}\``
|
config file directory : `eval echo \`echo ${sysconfdir}\``
|
||||||
example directory : `eval echo \`echo ${exampledir}\``
|
example directory : `eval echo \`echo ${exampledir}\``
|
||||||
@ -2071,7 +2038,7 @@ group to run as : ${enable_group}
|
|||||||
group for vty sockets : ${enable_vty_group}
|
group for vty sockets : ${enable_vty_group}
|
||||||
config file mask : ${enable_configfile_mask}
|
config file mask : ${enable_configfile_mask}
|
||||||
log file mask : ${enable_logfile_mask}
|
log file mask : ${enable_logfile_mask}
|
||||||
zebra protobuf enabled : ${have_protobuf:-no}
|
zebra protobuf enabled : ${enable_protobuf:-no}
|
||||||
|
|
||||||
The above user and group must have read/write access to the state file
|
The above user and group must have read/write access to the state file
|
||||||
directory and to the config files in the config file directory."
|
directory and to the config files in the config file directory."
|
||||||
|
@ -67,8 +67,8 @@
|
|||||||
* 7- state not changed, usually by receiving not last reply
|
* 7- state not changed, usually by receiving not last reply
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <thread.h>
|
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
|
#include <thread.h>
|
||||||
|
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
#include "table.h"
|
#include "table.h"
|
||||||
|
@ -3,8 +3,7 @@ lib_LTLIBRARIES += fpm/libfrrfpm_pb.la
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
fpm_libfrrfpm_pb_la_LDFLAGS = -version-info 0:0:0
|
fpm_libfrrfpm_pb_la_LDFLAGS = -version-info 0:0:0
|
||||||
fpm_libfrrfpm_pb_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir) -I$(top_builddir)/lib \
|
fpm_libfrrfpm_pb_la_CPPFLAGS = $(AM_CPPFLAGS) $(PROTOBUF_C_CFLAGS)
|
||||||
$(Q_PROTOBUF_C_CLIENT_INCLUDES)
|
|
||||||
fpm_libfrrfpm_pb_la_SOURCES = \
|
fpm_libfrrfpm_pb_la_SOURCES = \
|
||||||
fpm/fpm.h \
|
fpm/fpm.h \
|
||||||
fpm/fpm_pb.h \
|
fpm/fpm_pb.h \
|
||||||
@ -12,11 +11,14 @@ fpm_libfrrfpm_pb_la_SOURCES = \
|
|||||||
# end
|
# end
|
||||||
|
|
||||||
if HAVE_PROTOBUF
|
if HAVE_PROTOBUF
|
||||||
nodist_fpm_libfrrfpm_pb_la_SOURCES = fpm/fpm.pb-c.c
|
nodist_fpm_libfrrfpm_pb_la_SOURCES = \
|
||||||
|
fpm/fpm.pb-c.c \
|
||||||
|
# end
|
||||||
|
endif
|
||||||
|
|
||||||
CLEANFILES += \
|
CLEANFILES += \
|
||||||
fpm/fpm.pb-c.c \
|
fpm/fpm.pb-c.c \
|
||||||
fpm/fpm.pb-c.h \
|
fpm/fpm.pb-c.h \
|
||||||
# end
|
# end
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST += fpm/fpm.proto
|
EXTRA_DIST += fpm/fpm.proto
|
||||||
|
@ -213,7 +213,7 @@ int isis_sock_init(struct isis_circuit *circuit)
|
|||||||
|
|
||||||
int isis_recv_pdu_bcast(struct isis_circuit *circuit, uint8_t *ssnpa)
|
int isis_recv_pdu_bcast(struct isis_circuit *circuit, uint8_t *ssnpa)
|
||||||
{
|
{
|
||||||
int bytesread = 0, bytestoread, offset, one = 1, err = ISIS_OK;
|
int bytesread = 0, bytestoread, offset, one = 1;
|
||||||
uint8_t *buff_ptr;
|
uint8_t *buff_ptr;
|
||||||
struct bpf_hdr *bpf_hdr;
|
struct bpf_hdr *bpf_hdr;
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ int isis_recv_pdu_bcast(struct isis_circuit *circuit, uint8_t *ssnpa)
|
|||||||
memcpy(ssnpa, buff_ptr + bpf_hdr->bh_hdrlen + ETHER_ADDR_LEN,
|
memcpy(ssnpa, buff_ptr + bpf_hdr->bh_hdrlen + ETHER_ADDR_LEN,
|
||||||
ETHER_ADDR_LEN);
|
ETHER_ADDR_LEN);
|
||||||
|
|
||||||
err = isis_handle_pdu(circuit, ssnpa);
|
isis_handle_pdu(circuit, ssnpa);
|
||||||
stream_reset(circuit->rcv_stream);
|
stream_reset(circuit->rcv_stream);
|
||||||
buff_ptr += BPF_WORDALIGN(bpf_hdr->bh_hdrlen +
|
buff_ptr += BPF_WORDALIGN(bpf_hdr->bh_hdrlen +
|
||||||
bpf_hdr->bh_datalen);
|
bpf_hdr->bh_datalen);
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@ -22,6 +22,11 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
%top{
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
}
|
||||||
%{
|
%{
|
||||||
/* ignore flex generated code in static analyzer */
|
/* ignore flex generated code in static analyzer */
|
||||||
#ifndef __clang_analyzer__
|
#ifndef __clang_analyzer__
|
||||||
|
@ -17,6 +17,11 @@
|
|||||||
* with this program; see the file COPYING; if not, write to the Free Software
|
* with this program; see the file COPYING; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
%{
|
|
||||||
/*
|
/*
|
||||||
* clippy (CLI preparator in python) C pseudo-lexer
|
* clippy (CLI preparator in python) C pseudo-lexer
|
||||||
* Copyright (C) 2016-2017 David Lamparter for NetDEF, Inc.
|
* Copyright (C) 2016-2017 David Lamparter for NetDEF, Inc.
|
||||||
@ -34,6 +33,12 @@
|
|||||||
* code documentation in it.
|
* code documentation in it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
%top{
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
%{
|
||||||
/* ignore harmless bugs in old versions of flex */
|
/* ignore harmless bugs in old versions of flex */
|
||||||
#pragma GCC diagnostic ignored "-Wsign-compare"
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-value"
|
#pragma GCC diagnostic ignored "-Wunused-value"
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#ifdef HAVE_PTHREAD_NP_H
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#endif
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
|
||||||
#include "frr_pthread.h"
|
#include "frr_pthread.h"
|
||||||
@ -163,10 +166,14 @@ int frr_pthread_set_name(struct frr_pthread *fpt, const char *name,
|
|||||||
pthread_mutex_lock(&fpt->mtx);
|
pthread_mutex_lock(&fpt->mtx);
|
||||||
snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name);
|
snprintf(fpt->os_name, OS_THREAD_NAMELEN, "%s", os_name);
|
||||||
pthread_mutex_unlock(&fpt->mtx);
|
pthread_mutex_unlock(&fpt->mtx);
|
||||||
#ifdef GNU_LINUX
|
#ifdef HAVE_PTHREAD_SETNAME_NP
|
||||||
|
# ifdef GNU_LINUX
|
||||||
ret = pthread_setname_np(fpt->thread, fpt->os_name);
|
ret = pthread_setname_np(fpt->thread, fpt->os_name);
|
||||||
#elif defined(OPEN_BSD)
|
# else /* NetBSD */
|
||||||
ret = pthread_set_name_np(fpt->thread, fpt->os_name);
|
ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL);
|
||||||
|
# endif
|
||||||
|
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||||
|
pthread_set_name_np(fpt->thread, fpt->os_name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "memory_vty.h"
|
#include "memory_vty.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "memory_vty.h"
|
#include "memory_vty.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
* DEALINGS IN THE SOFTWARE.
|
* DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
|
|
||||||
|
2
lib/if.c
2
lib/if.c
@ -619,7 +619,7 @@ DEFUN (no_interface_desc,
|
|||||||
* if not:
|
* if not:
|
||||||
* - no idea, just get the name in its entirety.
|
* - no idea, just get the name in its entirety.
|
||||||
*/
|
*/
|
||||||
static struct interface *if_sunwzebra_get(char *name, vrf_id_t vrf_id)
|
static struct interface *if_sunwzebra_get(const char *name, vrf_id_t vrf_id)
|
||||||
{
|
{
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "lib_errors.h"
|
#include "lib_errors.h"
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
#ifdef HAVE_MALLOC_H
|
#ifdef HAVE_MALLOC_H
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_MALLOC_NP_H
|
||||||
|
#include <malloc_np.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_MALLOC_MALLOC_H
|
#ifdef HAVE_MALLOC_MALLOC_H
|
||||||
#include <malloc/malloc.h>
|
#include <malloc/malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,6 +41,10 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <lib/openbsd-tree.h>
|
#include <lib/openbsd-tree.h>
|
||||||
|
@ -17,6 +17,11 @@
|
|||||||
* with this program; see the file COPYING; if not, write to the Free Software
|
* with this program; see the file COPYING; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -270,7 +270,7 @@ void stream_forward_endp(struct stream *s, size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Copy from stream to destination. */
|
/* Copy from stream to destination. */
|
||||||
inline bool stream_get2(void *dst, struct stream *s, size_t size)
|
bool stream_get2(void *dst, struct stream *s, size_t size)
|
||||||
{
|
{
|
||||||
STREAM_VERIFY_SANE(s);
|
STREAM_VERIFY_SANE(s);
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ void stream_get(void *dst, struct stream *s, size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get next character from the stream. */
|
/* Get next character from the stream. */
|
||||||
inline bool stream_getc2(struct stream *s, uint8_t *byte)
|
bool stream_getc2(struct stream *s, uint8_t *byte)
|
||||||
{
|
{
|
||||||
STREAM_VERIFY_SANE(s);
|
STREAM_VERIFY_SANE(s);
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ uint8_t stream_getc_from(struct stream *s, size_t from)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool stream_getw2(struct stream *s, uint16_t *word)
|
bool stream_getw2(struct stream *s, uint16_t *word)
|
||||||
{
|
{
|
||||||
STREAM_VERIFY_SANE(s);
|
STREAM_VERIFY_SANE(s);
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ void stream_get_from(void *dst, struct stream *s, size_t from, size_t size)
|
|||||||
memcpy(dst, s->data + from, size);
|
memcpy(dst, s->data + from, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool stream_getl2(struct stream *s, uint32_t *l)
|
bool stream_getl2(struct stream *s, uint32_t *l)
|
||||||
{
|
{
|
||||||
STREAM_VERIFY_SANE(s);
|
STREAM_VERIFY_SANE(s);
|
||||||
|
|
||||||
|
@ -20,11 +20,13 @@
|
|||||||
/* adapted for Quagga from glibc patch submission originally from
|
/* adapted for Quagga from glibc patch submission originally from
|
||||||
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
|
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#ifndef HAVE_STRLCAT
|
#ifndef HAVE_STRLCAT
|
||||||
#undef strlcat
|
#undef strlcat
|
||||||
|
|
||||||
|
@ -20,9 +20,11 @@
|
|||||||
/* adapted for Quagga from glibc patch submission originally from
|
/* adapted for Quagga from glibc patch submission originally from
|
||||||
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
|
* Florian Weimer <fweimer@redhat.com>, 2016-05-18 */
|
||||||
|
|
||||||
#include <string.h>
|
#ifdef HAVE_CONFIG_H
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef HAVE_STRLCPY
|
#ifndef HAVE_STRLCPY
|
||||||
#undef strlcpy
|
#undef strlcpy
|
||||||
|
@ -254,9 +254,10 @@ lib_grammar_sandbox_SOURCES = \
|
|||||||
lib_grammar_sandbox_LDADD = \
|
lib_grammar_sandbox_LDADD = \
|
||||||
lib/libfrr.la
|
lib/libfrr.la
|
||||||
|
|
||||||
lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY @SAN_CLIPPY_FLAGS@
|
lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
|
||||||
lib_clippy_CFLAGS = $(PYTHON_CFLAGS) @SAN_CLIPPY_FLAGS@
|
lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
|
||||||
lib_clippy_LDADD = $(PYTHON_LIBS)
|
lib_clippy_LDADD = $(PYTHON_LIBS)
|
||||||
|
lib_clippy_LDFLAGS = -export-dynamic
|
||||||
lib_clippy_SOURCES = \
|
lib_clippy_SOURCES = \
|
||||||
lib/clippy.c \
|
lib/clippy.c \
|
||||||
lib/command_graph.c \
|
lib/command_graph.c \
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
|
|
||||||
#ifdef SUNOS_5
|
#ifdef SUNOS_5
|
||||||
#define _XPG4_2
|
|
||||||
typedef unsigned int uint32_t;
|
typedef unsigned int uint32_t;
|
||||||
typedef unsigned short uint16_t;
|
typedef unsigned short uint16_t;
|
||||||
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
||||||
|
@ -109,7 +109,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
|||||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||||
|
|
||||||
pkg_failed=no
|
pkg_failed=no
|
||||||
AC_MSG_CHECKING([for $1])
|
AC_MSG_CHECKING([for $1 ($2)])
|
||||||
|
|
||||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <netinet/if_ether.h>
|
#include <netinet/if_ether.h>
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include "zebra.h"
|
#include "zebra.h"
|
||||||
#include "linklist.h"
|
#include "linklist.h"
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "zebra.h"
|
#include "zebra.h"
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <netinet/if_ether.h>
|
#include <netinet/if_ether.h>
|
||||||
#include "nhrpd.h"
|
#include "nhrpd.h"
|
||||||
#include "zbuf.h"
|
#include "zbuf.h"
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <netinet/if_ether.h>
|
#include <netinet/if_ether.h>
|
||||||
|
|
||||||
#include "zebra.h"
|
#include "zebra.h"
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "nhrpd.h"
|
#include "nhrpd.h"
|
||||||
#include "table.h"
|
#include "table.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "nhrpd.h"
|
#include "nhrpd.h"
|
||||||
#include "table.h"
|
#include "table.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <ares.h>
|
#include <ares.h>
|
||||||
#include <ares_version.h>
|
#include <ares_version.h>
|
||||||
|
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
@ -7,7 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -7,6 +7,10 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -130,7 +130,7 @@ uint8_t ospf6_lstype_debug(uint16_t type)
|
|||||||
{
|
{
|
||||||
const struct ospf6_lsa_handler *handler;
|
const struct ospf6_lsa_handler *handler;
|
||||||
handler = ospf6_get_lsa_handler(type);
|
handler = ospf6_get_lsa_handler(type);
|
||||||
return handler->debug;
|
return handler->lh_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RFC2328: Section 13.2 */
|
/* RFC2328: Section 13.2 */
|
||||||
@ -844,13 +844,13 @@ DEFUN (debug_ospf6_lsa_type,
|
|||||||
|
|
||||||
if (argc == 5) {
|
if (argc == 5) {
|
||||||
if (strmatch(argv[idx_type]->text, "originate"))
|
if (strmatch(argv[idx_type]->text, "originate"))
|
||||||
SET_FLAG(handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
|
SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_ORIGINATE);
|
||||||
else if (strmatch(argv[idx_type]->text, "examine"))
|
else if (strmatch(argv[idx_type]->text, "examine"))
|
||||||
SET_FLAG(handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
|
SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_EXAMIN);
|
||||||
else if (strmatch(argv[idx_type]->text, "flooding"))
|
else if (strmatch(argv[idx_type]->text, "flooding"))
|
||||||
SET_FLAG(handler->debug, OSPF6_LSA_DEBUG_FLOOD);
|
SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_FLOOD);
|
||||||
} else
|
} else
|
||||||
SET_FLAG(handler->debug, OSPF6_LSA_DEBUG);
|
SET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -896,13 +896,14 @@ DEFUN (no_debug_ospf6_lsa_type,
|
|||||||
|
|
||||||
if (argc == 6) {
|
if (argc == 6) {
|
||||||
if (strmatch(argv[idx_type]->text, "originate"))
|
if (strmatch(argv[idx_type]->text, "originate"))
|
||||||
UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
|
UNSET_FLAG(handler->lh_debug,
|
||||||
|
OSPF6_LSA_DEBUG_ORIGINATE);
|
||||||
if (strmatch(argv[idx_type]->text, "examine"))
|
if (strmatch(argv[idx_type]->text, "examine"))
|
||||||
UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
|
UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_EXAMIN);
|
||||||
if (strmatch(argv[idx_type]->text, "flooding"))
|
if (strmatch(argv[idx_type]->text, "flooding"))
|
||||||
UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG_FLOOD);
|
UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_FLOOD);
|
||||||
} else
|
} else
|
||||||
UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG);
|
UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -924,16 +925,16 @@ int config_write_ospf6_debug_lsa(struct vty *vty)
|
|||||||
handler = vector_slot(ospf6_lsa_handler_vector, i);
|
handler = vector_slot(ospf6_lsa_handler_vector, i);
|
||||||
if (handler == NULL)
|
if (handler == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG))
|
if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG))
|
||||||
vty_out(vty, "debug ospf6 lsa %s\n",
|
vty_out(vty, "debug ospf6 lsa %s\n",
|
||||||
ospf6_lsa_handler_name(handler));
|
ospf6_lsa_handler_name(handler));
|
||||||
if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG_ORIGINATE))
|
if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_ORIGINATE))
|
||||||
vty_out(vty, "debug ospf6 lsa %s originate\n",
|
vty_out(vty, "debug ospf6 lsa %s originate\n",
|
||||||
ospf6_lsa_handler_name(handler));
|
ospf6_lsa_handler_name(handler));
|
||||||
if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG_EXAMIN))
|
if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_EXAMIN))
|
||||||
vty_out(vty, "debug ospf6 lsa %s examine\n",
|
vty_out(vty, "debug ospf6 lsa %s examine\n",
|
||||||
ospf6_lsa_handler_name(handler));
|
ospf6_lsa_handler_name(handler));
|
||||||
if (CHECK_FLAG(handler->debug, OSPF6_LSA_DEBUG_FLOOD))
|
if (CHECK_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG_FLOOD))
|
||||||
vty_out(vty, "debug ospf6 lsa %s flooding\n",
|
vty_out(vty, "debug ospf6 lsa %s flooding\n",
|
||||||
ospf6_lsa_handler_name(handler));
|
ospf6_lsa_handler_name(handler));
|
||||||
}
|
}
|
||||||
|
@ -137,21 +137,14 @@ struct ospf6_lsa {
|
|||||||
#define OSPF6_LSA_SEQWRAPPED 0x20
|
#define OSPF6_LSA_SEQWRAPPED 0x20
|
||||||
|
|
||||||
struct ospf6_lsa_handler {
|
struct ospf6_lsa_handler {
|
||||||
const struct {
|
uint16_t lh_type; /* host byte order */
|
||||||
uint16_t type; /* host byte order */
|
const char *lh_name;
|
||||||
const char *name;
|
const char *lh_short_name;
|
||||||
const char *short_name;
|
int (*lh_show)(struct vty *, struct ospf6_lsa *);
|
||||||
int (*show)(struct vty *, struct ospf6_lsa *);
|
char *(*lh_get_prefix_str)(struct ospf6_lsa *, char *buf,
|
||||||
char *(*get_prefix_str)(struct ospf6_lsa *, char *buf,
|
|
||||||
int buflen, int pos);
|
int buflen, int pos);
|
||||||
} s;
|
|
||||||
#define lh_type s.type
|
uint8_t lh_debug;
|
||||||
#define lh_name s.name
|
|
||||||
#define lh_short_name s.short_name
|
|
||||||
#define lh_show s.show
|
|
||||||
#define lh_get_prefix_str s.get_prefix_str
|
|
||||||
uint8_t debug;
|
|
||||||
#define lh_debug debug
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define OSPF6_LSA_IS_KNOWN(t) \
|
#define OSPF6_LSA_IS_KNOWN(t) \
|
||||||
|
@ -921,7 +921,7 @@ DEFUN (no_debug_ospf6,
|
|||||||
handler = vector_slot(ospf6_lsa_handler_vector, i);
|
handler = vector_slot(ospf6_lsa_handler_vector, i);
|
||||||
|
|
||||||
if (handler != NULL) {
|
if (handler != NULL) {
|
||||||
UNSET_FLAG(handler->debug, OSPF6_LSA_DEBUG);
|
UNSET_FLAG(handler->lh_debug, OSPF6_LSA_DEBUG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|
||||||
#include "pim_igmp_mtrace.h"
|
#include "pim_igmp_mtrace.h"
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|
||||||
#include <asm/types.h>
|
#include <asm/types.h>
|
||||||
|
@ -615,7 +615,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr,
|
|||||||
static uint32_t qry_id, qry_src;
|
static uint32_t qry_id, qry_src;
|
||||||
char mtrace_buf[MTRACE_HDR_SIZE + MTRACE_MAX_HOPS * MTRACE_RSP_SIZE];
|
char mtrace_buf[MTRACE_HDR_SIZE + MTRACE_MAX_HOPS * MTRACE_RSP_SIZE];
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
struct interface *out_ifp;
|
struct interface *out_ifp = NULL;
|
||||||
struct pim_interface *pim_ifp;
|
struct pim_interface *pim_ifp;
|
||||||
struct pim_instance *pim;
|
struct pim_instance *pim;
|
||||||
struct igmp_mtrace *mtracep;
|
struct igmp_mtrace *mtracep;
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "pim_igmp_stats.h"
|
#include "pim_igmp_stats.h"
|
||||||
|
|
||||||
void igmp_stats_init(struct igmp_stats *stats)
|
void igmp_stats_init(struct igmp_stats *stats)
|
||||||
|
@ -96,7 +96,7 @@ class IP4Handler(IPBase):
|
|||||||
code = Template('_fail = !inet_aton(argv[_i]->arg, &$varname);')
|
code = Template('_fail = !inet_aton(argv[_i]->arg, &$varname);')
|
||||||
class IP6Handler(IPBase):
|
class IP6Handler(IPBase):
|
||||||
argtype = 'struct in6_addr'
|
argtype = 'struct in6_addr'
|
||||||
decl = Template('struct in6_addr $varname = IN6ADDR_ANY_INIT;')
|
decl = Template('struct in6_addr $varname = {};')
|
||||||
code = Template('_fail = !inet_pton(AF_INET6, argv[_i]->arg, &$varname);')
|
code = Template('_fail = !inet_pton(AF_INET6, argv[_i]->arg, &$varname);')
|
||||||
class IPGenHandler(IPBase):
|
class IPGenHandler(IPBase):
|
||||||
argtype = 'const union sockunion *'
|
argtype = 'const union sockunion *'
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "linear_allocator.h"
|
#include "linear_allocator.h"
|
||||||
|
|
||||||
#include "qpb_allocator.h"
|
#include "qpb_allocator.h"
|
||||||
|
@ -2,44 +2,36 @@ if HAVE_PROTOBUF
|
|||||||
lib_LTLIBRARIES += qpb/libfrr_pb.la
|
lib_LTLIBRARIES += qpb/libfrr_pb.la
|
||||||
endif
|
endif
|
||||||
|
|
||||||
qpb_libfrr_pb_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir) -I$(top_builddir)/lib \
|
qpb_libfrr_pb_la_CPPFLAGS = $(AM_CPPFLAGS) $(PROTOBUF_C_CFLAGS)
|
||||||
$(Q_PROTOBUF_C_CLIENT_INCLUDES)
|
qpb_libfrr_pb_la_LIBADD = $(PROTOBUF_C_LIBS)
|
||||||
qpb_libfrr_pb_la_LDFLAGS = -version-info 0:0:0
|
qpb_libfrr_pb_la_LDFLAGS = -version-info 0:0:0
|
||||||
|
|
||||||
qpb_libfrr_pb_la_SOURCES = \
|
qpb_libfrr_pb_la_SOURCES = \
|
||||||
|
qpb/qpb.c \
|
||||||
|
qpb/qpb_allocator.c \
|
||||||
|
# end
|
||||||
|
nodist_qpb_libfrr_pb_la_SOURCES = \
|
||||||
|
qpb/qpb.pb-c.c \
|
||||||
|
# end
|
||||||
|
|
||||||
|
noinst_HEADERS += \
|
||||||
qpb/linear_allocator.h \
|
qpb/linear_allocator.h \
|
||||||
qpb/qpb.h \
|
qpb/qpb.h \
|
||||||
qpb/qpb.c \
|
|
||||||
qpb/qpb_allocator.h \
|
qpb/qpb_allocator.h \
|
||||||
# end
|
# end
|
||||||
|
|
||||||
if HAVE_PROTOBUF
|
|
||||||
qpb_libfrr_pb_la_SOURCES += qpb/qpb_allocator.c
|
|
||||||
nodist_qpb_libfrr_pb_la_SOURCES = qpb/qpb.pb-c.c
|
|
||||||
CLEANFILES += \
|
CLEANFILES += \
|
||||||
qpb/qpb.pb-c.c \
|
qpb/qpb.pb-c.c \
|
||||||
qpb/qpb.pb-c.h \
|
qpb/qpb.pb-c.h \
|
||||||
# end
|
# end
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST += qpb/qpb.proto
|
EXTRA_DIST += qpb/qpb.proto
|
||||||
|
|
||||||
if HAVE_PROTOBUF
|
if HAVE_PROTOBUF
|
||||||
|
|
||||||
# Uncomment to use an non-system version of libprotobuf-c.
|
|
||||||
#
|
|
||||||
# Q_PROTOBUF_C_CLIENT_INCLUDES = -I$(top_srcdir)/third-party/protobuf-c/src
|
|
||||||
# Q_PROTOBUF_C_CLIENT_LDOPTS = $(top_builddir)/third-party/protobuf-c/src/libprotobuf-c.la
|
|
||||||
|
|
||||||
Q_PROTOBUF_C_CLIENT_INCLUDES=
|
|
||||||
Q_PROTOBUF_C_CLIENT_LDOPTS=-lprotobuf-c
|
|
||||||
|
|
||||||
Q_PROTOC=protoc
|
|
||||||
Q_PROTOC_C=protoc-c
|
|
||||||
|
|
||||||
# Rules
|
# Rules
|
||||||
.proto.pb.h:
|
.proto.pb.h:
|
||||||
$(Q_PROTOC) -I$(top_srcdir) --cpp_out=$(top_srcdir) $(top_srcdir)/$^
|
$(PROTOC) -I$(top_srcdir) --cpp_out=$(top_srcdir) $(top_srcdir)/$^
|
||||||
|
|
||||||
AM_V_PROTOC_C = $(am__v_PROTOC_C_$(V))
|
AM_V_PROTOC_C = $(am__v_PROTOC_C_$(V))
|
||||||
am__v_PROTOC_C_ = $(am__v_PROTOC_C_$(AM_DEFAULT_VERBOSITY))
|
am__v_PROTOC_C_ = $(am__v_PROTOC_C_$(AM_DEFAULT_VERBOSITY))
|
||||||
@ -47,15 +39,8 @@ am__v_PROTOC_C_0 = @echo " PROTOC_C" $@;
|
|||||||
am__v_PROTOC_C_1 =
|
am__v_PROTOC_C_1 =
|
||||||
|
|
||||||
.proto.pb-c.c:
|
.proto.pb-c.c:
|
||||||
$(AM_V_PROTOC_C)$(Q_PROTOC_C) -I$(top_srcdir) --c_out=$(top_srcdir) $(top_srcdir)/$^
|
$(AM_V_PROTOC_C)$(PROTOC_C) -I$(top_srcdir) --c_out=$(top_srcdir) $(top_srcdir)/$^
|
||||||
.pb-c.c.pb-c.h:
|
.pb-c.c.pb-c.h:
|
||||||
@/bin/true
|
@/bin/true
|
||||||
|
|
||||||
#
|
|
||||||
# Information about how to link to various libraries.
|
|
||||||
#
|
|
||||||
Q_FRR_PB_CLIENT_LDOPTS = $(top_srcdir)/qpb/libfrr_pb.la $(Q_PROTOBUF_C_CLIENT_LDOPTS)
|
|
||||||
|
|
||||||
Q_FPM_PB_CLIENT_LDOPTS = $(top_srcdir)/fpm/libfrrfpm_pb.la $(Q_FRR_PB_CLIENT_LDOPTS)
|
|
||||||
|
|
||||||
endif # HAVE_PROTOBUF
|
endif # HAVE_PROTOBUF
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "test_fuzz_isis_tlv_tests.h"
|
#include "test_fuzz_isis_tlv_tests.h"
|
||||||
|
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
|
@ -108,7 +108,7 @@ TESTS_CPPFLAGS = $(AM_CPPFLAGS) \
|
|||||||
-I$(top_srcdir)/tests/helpers/c \
|
-I$(top_srcdir)/tests/helpers/c \
|
||||||
-I$(top_builddir)/tests/helpers/c \
|
-I$(top_builddir)/tests/helpers/c \
|
||||||
# end
|
# end
|
||||||
TESTS_CFLAGS = @ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@
|
TESTS_CFLAGS = $(SAN_FLAGS)
|
||||||
# note no -Werror
|
# note no -Werror
|
||||||
|
|
||||||
ALL_TESTS_LDADD = lib/libfrr.la @LIBCAP@
|
ALL_TESTS_LDADD = lib/libfrr.la @LIBCAP@
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "lib/stream.h"
|
#include "lib/stream.h"
|
||||||
#include "lib/zclient.h"
|
#include "lib/zclient.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
|
@ -25,12 +25,17 @@
|
|||||||
* the whole automake/config.h dance.
|
* the whole automake/config.h dance.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LXC
|
#ifdef HAVE_LXC
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#endif /* HAVE_LXC */
|
#endif /* HAVE_LXC */
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#undef VERSION
|
||||||
#define VERSION "1.9.18"
|
#define VERSION "1.9.18"
|
||||||
|
|
||||||
#define MIN_POLL_INTERVAL 20000 /*us*/
|
#define MIN_POLL_INTERVAL 20000 /*us*/
|
||||||
@ -602,7 +607,7 @@ static int pid_is_exec(pid_t pid, const struct stat *esb)
|
|||||||
struct stat sb;
|
struct stat sb;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
sprintf(buf, "/proc/%d/exe", pid);
|
sprintf(buf, "/proc/%ld/exe", (long)pid);
|
||||||
if (stat(buf, &sb) != 0)
|
if (stat(buf, &sb) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
return (sb.st_dev == esb->st_dev && sb.st_ino == esb->st_ino);
|
return (sb.st_dev == esb->st_dev && sb.st_ino == esb->st_ino);
|
||||||
@ -614,7 +619,7 @@ static int pid_is_user(pid_t pid, uid_t uid)
|
|||||||
struct stat sb;
|
struct stat sb;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
sprintf(buf, "/proc/%d", pid);
|
sprintf(buf, "/proc/%ld", (long)pid);
|
||||||
if (stat(buf, &sb) != 0)
|
if (stat(buf, &sb) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
return (sb.st_uid == uid);
|
return (sb.st_uid == uid);
|
||||||
@ -627,7 +632,7 @@ static int pid_is_cmd(pid_t pid, const char *name)
|
|||||||
FILE *f;
|
FILE *f;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
sprintf(buf, "/proc/%d/stat", pid);
|
sprintf(buf, "/proc/%ld/stat", (long)pid);
|
||||||
f = fopen(buf, "r");
|
f = fopen(buf, "r");
|
||||||
if (!f)
|
if (!f)
|
||||||
return 0;
|
return 0;
|
||||||
@ -659,12 +664,12 @@ static void check(pid_t pid)
|
|||||||
static void do_pidfile(const char *name)
|
static void do_pidfile(const char *name)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
pid_t pid;
|
long pid;
|
||||||
|
|
||||||
f = fopen(name, "r");
|
f = fopen(name, "r");
|
||||||
if (f) {
|
if (f) {
|
||||||
if (fscanf(f, "%d", &pid) == 1)
|
if (fscanf(f, "%ld", &pid) == 1)
|
||||||
check(pid);
|
check((pid_t)pid);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
} else if (errno != ENOENT)
|
} else if (errno != ENOENT)
|
||||||
fatal("open pidfile %s: %s", name, strerror(errno));
|
fatal("open pidfile %s: %s", name, strerror(errno));
|
||||||
@ -677,7 +682,7 @@ static void do_procinit(void)
|
|||||||
DIR *procdir;
|
DIR *procdir;
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
int foundany;
|
int foundany;
|
||||||
pid_t pid;
|
long pid;
|
||||||
|
|
||||||
procdir = opendir("/proc");
|
procdir = opendir("/proc");
|
||||||
if (!procdir)
|
if (!procdir)
|
||||||
@ -685,10 +690,10 @@ static void do_procinit(void)
|
|||||||
|
|
||||||
foundany = 0;
|
foundany = 0;
|
||||||
while ((entry = readdir(procdir)) != NULL) {
|
while ((entry = readdir(procdir)) != NULL) {
|
||||||
if (sscanf(entry->d_name, "%d", &pid) != 1)
|
if (sscanf(entry->d_name, "%ld", &pid) != 1)
|
||||||
continue;
|
continue;
|
||||||
foundany++;
|
foundany++;
|
||||||
check(pid);
|
check((pid_t)pid);
|
||||||
}
|
}
|
||||||
closedir(procdir);
|
closedir(procdir);
|
||||||
if (!foundany)
|
if (!foundany)
|
||||||
@ -723,21 +728,21 @@ static void do_stop(int signal_nr, int quietmode, int *n_killed,
|
|||||||
|
|
||||||
for (p = found; p; p = p->next) {
|
for (p = found; p; p = p->next) {
|
||||||
if (testmode)
|
if (testmode)
|
||||||
printf("Would send signal %d to %d.\n", signal_nr,
|
printf("Would send signal %d to %ld.\n", signal_nr,
|
||||||
p->pid);
|
(long)p->pid);
|
||||||
else if (kill(p->pid, signal_nr) == 0) {
|
else if (kill(p->pid, signal_nr) == 0) {
|
||||||
push(&killed, p->pid);
|
push(&killed, p->pid);
|
||||||
(*n_killed)++;
|
(*n_killed)++;
|
||||||
} else {
|
} else {
|
||||||
printf("%s: warning: failed to kill %d: %s\n", progname,
|
printf("%s: warning: failed to kill %ld: %s\n",
|
||||||
p->pid, strerror(errno));
|
progname, (long)p->pid, strerror(errno));
|
||||||
(*n_notkilled)++;
|
(*n_notkilled)++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (quietmode < 0 && killed) {
|
if (quietmode < 0 && killed) {
|
||||||
printf("Stopped %s (pid", what_stop);
|
printf("Stopped %s (pid", what_stop);
|
||||||
for (p = killed; p; p = p->next)
|
for (p = killed; p; p = p->next)
|
||||||
printf(" %d", p->pid);
|
printf(" %ld", (long)p->pid);
|
||||||
putchar(')');
|
putchar(')');
|
||||||
if (retry_nr > 0)
|
if (retry_nr > 0)
|
||||||
printf(", retry #%d", retry_nr);
|
printf(", retry #%d", retry_nr);
|
||||||
@ -1050,7 +1055,7 @@ int main(int argc, char **argv)
|
|||||||
if (pidf == NULL)
|
if (pidf == NULL)
|
||||||
fatal("Unable to open pidfile `%s' for writing: %s",
|
fatal("Unable to open pidfile `%s' for writing: %s",
|
||||||
pidfile, strerror(errno));
|
pidfile, strerror(errno));
|
||||||
fprintf(pidf, "%d\n", pidt);
|
fprintf(pidf, "%ld\n", (long)pidt);
|
||||||
fclose(pidf);
|
fclose(pidf);
|
||||||
}
|
}
|
||||||
set_namespaces();
|
set_namespaces();
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "zebra/interface.h"
|
#include "zebra/interface.h"
|
||||||
#include "zebra/ioctl_solaris.h"
|
#include "zebra/ioctl_solaris.h"
|
||||||
#include "zebra/rib.h"
|
#include "zebra/rib.h"
|
||||||
|
#include "zebra/rt.h"
|
||||||
|
|
||||||
static int if_get_addr(struct interface *, struct sockaddr *, const char *);
|
static int if_get_addr(struct interface *, struct sockaddr *, const char *);
|
||||||
static void interface_info_ioctl(struct interface *);
|
static void interface_info_ioctl(struct interface *);
|
||||||
@ -55,7 +56,6 @@ static int interface_list_ioctl(int af)
|
|||||||
struct lifconf lifconf;
|
struct lifconf lifconf;
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
int n;
|
int n;
|
||||||
int save_errno;
|
|
||||||
size_t needed, lastneeded = 0;
|
size_t needed, lastneeded = 0;
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
|
|
||||||
@ -76,13 +76,11 @@ calculate_lifc_len:
|
|||||||
lifn.lifn_flags = LIFC_NOXMIT;
|
lifn.lifn_flags = LIFC_NOXMIT;
|
||||||
/* we want NOXMIT interfaces too */
|
/* we want NOXMIT interfaces too */
|
||||||
ret = ioctl(sock, SIOCGLIFNUM, &lifn);
|
ret = ioctl(sock, SIOCGLIFNUM, &lifn);
|
||||||
save_errno = errno;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
zlog_warn("interface_list_ioctl: SIOCGLIFNUM failed %s",
|
zlog_warn("interface_list_ioctl: SIOCGLIFNUM failed %s",
|
||||||
safe_strerror(save_errno));
|
safe_strerror(errno));
|
||||||
close(sock);
|
close(sock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "zebra/rib.h"
|
#include "zebra/rib.h"
|
||||||
#include "zebra/rt.h"
|
#include "zebra/rt.h"
|
||||||
|
#include "zebra/zebra_pbr.h"
|
||||||
|
|
||||||
/* Thank you, Solaris, for polluting application symbol namespace. */
|
/* Thank you, Solaris, for polluting application symbol namespace. */
|
||||||
#undef hook_register
|
#undef hook_register
|
||||||
|
@ -149,10 +149,11 @@ zebra_zebra_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
|
|||||||
zebra_zebra_snmp_la_LIBADD = lib/libfrrsnmp.la
|
zebra_zebra_snmp_la_LIBADD = lib/libfrrsnmp.la
|
||||||
|
|
||||||
zebra_zebra_fpm_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
|
zebra_zebra_fpm_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
|
||||||
zebra_zebra_fpm_la_LIBADD = $(Q_FPM_PB_CLIENT_LDOPTS)
|
zebra_zebra_fpm_la_LIBADD =
|
||||||
zebra_zebra_fpm_la_SOURCES = zebra/zebra_fpm.c
|
zebra_zebra_fpm_la_SOURCES = zebra/zebra_fpm.c
|
||||||
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_netlink.c
|
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_netlink.c
|
||||||
if HAVE_PROTOBUF
|
if HAVE_PROTOBUF
|
||||||
|
zebra_zebra_fpm_la_LIBADD += fpm/libfrrfpm_pb.la qpb/libfrr_pb.la $(PROTOBUF_C_LIBS)
|
||||||
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_protobuf.c
|
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_protobuf.c
|
||||||
if DEV_BUILD
|
if DEV_BUILD
|
||||||
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_dt.c
|
zebra_zebra_fpm_la_SOURCES += zebra/zebra_fpm_dt.c
|
||||||
|
Loading…
Reference in New Issue
Block a user